Skip to content

Commit 9b29f75

Browse files
committed
[SILGen] NFC: Remove unused emitApplyMethod
1 parent 2d3cb3c commit 9b29f75

File tree

2 files changed

+0
-76
lines changed

2 files changed

+0
-76
lines changed

lib/SILGen/SILGenApply.cpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5265,78 +5265,6 @@ RValue SILGenFunction::emitApplyAllocatingInitializer(SILLocation loc,
52655265
return result;
52665266
}
52675267

5268-
/// Emit an application of the given method.
5269-
RValue SILGenFunction::emitApplyMethod(SILLocation loc, ConcreteDeclRef declRef,
5270-
ArgumentSource &&self,
5271-
PreparedArguments &&args, SGFContext C) {
5272-
auto *call = cast<AbstractFunctionDecl>(declRef.getDecl());
5273-
5274-
// Form the reference to the method.
5275-
auto callRef = SILDeclRef(call, SILDeclRef::Kind::Func)
5276-
.asForeign(requiresForeignEntryPoint(declRef.getDecl()));
5277-
5278-
if (auto distributedThunk = call->getDistributedThunk()) {
5279-
callRef = SILDeclRef(distributedThunk).asDistributed();
5280-
} else if (call->isBackDeployed()) {
5281-
callRef =
5282-
callRef.asBackDeploymentKind(SILDeclRef::BackDeploymentKind::Thunk);
5283-
}
5284-
5285-
auto declRefConstant = getConstantInfo(getTypeExpansionContext(), callRef);
5286-
auto subs = declRef.getSubstitutions();
5287-
bool throws = false;
5288-
bool markedAsRethrows = call->getAttrs().hasAttribute<swift::RethrowsAttr>();
5289-
PolymorphicEffectKind rethrowingKind =
5290-
call->getPolymorphicEffectKind(EffectKind::Throws);
5291-
if (rethrowingKind == PolymorphicEffectKind::ByConformance) {
5292-
for (auto conformanceRef : subs.getConformances()) {
5293-
if (conformanceRef.hasEffect(EffectKind::Throws)) {
5294-
throws = true;
5295-
break;
5296-
}
5297-
}
5298-
} else if (markedAsRethrows &&
5299-
rethrowingKind == PolymorphicEffectKind::Always) {
5300-
throws = true;
5301-
}
5302-
5303-
// Scope any further writeback just within this operation.
5304-
FormalEvaluationScope writebackScope(*this);
5305-
5306-
// Form the metatype argument.
5307-
ManagedValue selfMetaVal;
5308-
SILType selfMetaTy;
5309-
{
5310-
// Determine the self metatype type.
5311-
CanSILFunctionType substFnType =
5312-
declRefConstant.SILFnType->substGenericArgs(SGM.M, subs,
5313-
getTypeExpansionContext());
5314-
SILType selfParamMetaTy =
5315-
getSILType(substFnType->getSelfParameter(), substFnType);
5316-
selfMetaTy = selfParamMetaTy;
5317-
}
5318-
5319-
// Form the callee.
5320-
Optional<Callee> callee;
5321-
if (isa<ProtocolDecl>(call->getDeclContext())) {
5322-
callee.emplace(Callee::forWitnessMethod(*this, selfMetaTy.getASTType(),
5323-
callRef, subs, loc));
5324-
} else if (getMethodDispatch(call) == MethodDispatch::Class) {
5325-
callee.emplace(Callee::forClassMethod(*this, callRef, subs, loc));
5326-
} else {
5327-
callee.emplace(Callee::forDirect(*this, callRef, subs, loc));
5328-
}
5329-
5330-
auto substFormalType = callee->getSubstFormalType();
5331-
5332-
// Form the call emission.
5333-
CallEmission emission(*this, std::move(*callee), std::move(writebackScope));
5334-
emission.addSelfParam(loc, std::move(self), substFormalType.getParams()[0]);
5335-
emission.addCallSite(loc, std::move(args), !throws);
5336-
5337-
return emission.apply(C);
5338-
}
5339-
53405268
RValue SILGenFunction::emitApplyOfPropertyWrapperBackingInitializer(
53415269
SILLocation loc,
53425270
VarDecl *var,

lib/SILGen/SILGenFunction.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,10 +1751,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
17511751
PreparedArguments &&args, Type overriddenSelfType,
17521752
SGFContext ctx);
17531753

1754-
RValue emitApplyMethod(SILLocation loc, ConcreteDeclRef declRef,
1755-
ArgumentSource &&self, PreparedArguments &&args,
1756-
SGFContext C);
1757-
17581754
CleanupHandle emitBeginApply(SILLocation loc, ManagedValue fn,
17591755
SubstitutionMap subs, ArrayRef<ManagedValue> args,
17601756
CanSILFunctionType substFnType,

0 commit comments

Comments
 (0)