Skip to content

Commit 53b78a6

Browse files
committed
[gardening] Rename variable from inst => User to fit its... use. NFC.
1 parent 64c709c commit 53b78a6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/SILOptimizer/Mandatory/DIMemoryUseCollector.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,26 +1042,26 @@ static SILInstruction *isSuperInitUse(UpcastInst *Inst) {
10421042
// "Inst" is an Upcast instruction. Check to see if it is used by an apply
10431043
// that came from a call to super.init.
10441044
for (auto UI : Inst->getUses()) {
1045-
auto *inst = UI->getUser();
1045+
auto *User = UI->getUser();
10461046
// If this used by another upcast instruction, recursively handle it, we may
10471047
// have a multiple upcast chain.
1048-
if (auto *UCIU = dyn_cast<UpcastInst>(inst))
1048+
if (auto *UCIU = dyn_cast<UpcastInst>(User))
10491049
if (auto *subAI = isSuperInitUse(UCIU))
10501050
return subAI;
10511051

10521052
// The call to super.init has to either be an apply or a try_apply.
1053-
if (!isa<FullApplySite>(inst))
1053+
if (!isa<FullApplySite>(User))
10541054
continue;
10551055

1056-
auto *LocExpr = inst->getLoc().getAsASTNode<ApplyExpr>();
1056+
auto *LocExpr = User->getLoc().getAsASTNode<ApplyExpr>();
10571057
if (!LocExpr) {
10581058
// If we're reading a .sil file, treat a call to "superinit" as a
10591059
// super.init call as a hack to allow us to write testcases.
1060-
auto *AI = dyn_cast<ApplyInst>(inst);
1061-
if (AI && inst->getLoc().isSILFile())
1060+
auto *AI = dyn_cast<ApplyInst>(User);
1061+
if (AI && User->getLoc().isSILFile())
10621062
if (auto *Fn = AI->getReferencedFunction())
10631063
if (Fn->getName() == "superinit")
1064-
return inst;
1064+
return User;
10651065
continue;
10661066
}
10671067

@@ -1076,7 +1076,7 @@ static SILInstruction *isSuperInitUse(UpcastInst *Inst) {
10761076
continue;
10771077

10781078
if (LocExpr->getArg()->isSuperExpr())
1079-
return inst;
1079+
return User;
10801080

10811081
// Instead of super_ref_expr, we can also get this for inherited delegating
10821082
// initializers:
@@ -1087,7 +1087,7 @@ static SILInstruction *isSuperInitUse(UpcastInst *Inst) {
10871087
if (auto *DRE = dyn_cast<DeclRefExpr>(DTB->getSubExpr()))
10881088
if (DRE->getDecl()->isImplicit() &&
10891089
DRE->getDecl()->getName().str() == "self")
1090-
return inst;
1090+
return User;
10911091
}
10921092

10931093
return nullptr;

0 commit comments

Comments
 (0)