Skip to content

Commit baa45a1

Browse files
committed
[Gardening] Pull Out Callee Variable
1 parent f730ff1 commit baa45a1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/SILOptimizer/Mandatory/DiagnoseInfiniteRecursion.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ static bool hasRecursiveCallInPath(SILBasicBlock &Block,
5252

5353
if (FullApplySite FAI = FullApplySite::isa(&I)) {
5454
// Don't touch dynamic dispatch.
55-
if (isa<SuperMethodInst>(FAI.getCallee()) ||
56-
isa<ObjCSuperMethodInst>(FAI.getCallee()) ||
57-
isa<ObjCMethodInst>(FAI.getCallee())) {
55+
const auto callee = FAI.getCallee();
56+
if (isa<SuperMethodInst>(callee) ||
57+
isa<ObjCSuperMethodInst>(callee) ||
58+
isa<ObjCMethodInst>(callee)) {
5859
continue;
5960
}
6061

6162
auto &M = FAI.getModule();
62-
if (auto *CMI = dyn_cast<ClassMethodInst>(FAI.getCallee())) {
63+
if (auto *CMI = dyn_cast<ClassMethodInst>(callee)) {
6364
auto ClassType = CMI->getOperand()->getType().getASTType();
6465

6566
// FIXME: If we're not inside the module context of the method,
@@ -93,7 +94,7 @@ static bool hasRecursiveCallInPath(SILBasicBlock &Block,
9394
continue;
9495
}
9596

96-
if (auto *WMI = dyn_cast<WitnessMethodInst>(FAI.getCallee())) {
97+
if (auto *WMI = dyn_cast<WitnessMethodInst>(callee)) {
9798
SILFunction *F;
9899
SILWitnessTable *WT;
99100

0 commit comments

Comments
 (0)