Skip to content

Commit 6e6516c

Browse files
authored
Merge pull request #84332 from kavon/use-isSelfParameter
silgen: use isSelfParameter instead of custom check
2 parents ce5dc9a + ecf7011 commit 6e6516c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/SILGen/SILGenLValue.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3701,8 +3701,7 @@ RValue SILGenFunction::emitRValueForNonMemberVarDecl(SILLocation loc,
37013701
// If we have self, see if we are in an 'init' delegation sequence. If so,
37023702
// call out to the special delegation init routine. Otherwise, use the
37033703
// normal RValue emission logic.
3704-
if (var->getName() == getASTContext().Id_self &&
3705-
SelfInitDelegationState != NormalSelf) {
3704+
if (var->isSelfParameter() && SelfInitDelegationState != NormalSelf) {
37063705
auto rvalue =
37073706
emitRValueForSelfInDelegationInit(loc, formalRValueType, accessAddr, C);
37083707
return propagateRValuePastAccess(std::move(rvalue));

0 commit comments

Comments
 (0)