Skip to content

Commit b2f6e64

Browse files
committed
GenericCloner: remove FunctionExits
It's not used
1 parent baf5a72 commit b2f6e64

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

include/swift/SILOptimizer/Utils/GenericCloner.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class GenericCloner
4242

4343
llvm::SmallVector<AllocStackInst *, 8> AllocStacks;
4444
llvm::SmallVector<StoreBorrowInst *, 8> StoreBorrowsToCleanup;
45-
llvm::SmallVector<TermInst *, 8> FunctionExits;
4645
AllocStackInst *ReturnValueAddr = nullptr;
4746

4847
public:
@@ -94,11 +93,6 @@ class GenericCloner
9493
if (Callback)
9594
Callback(Orig, Cloned);
9695

97-
if (auto *termInst = dyn_cast<TermInst>(Cloned)) {
98-
if (termInst->isFunctionExiting()) {
99-
FunctionExits.push_back(termInst);
100-
}
101-
}
10296
SILClonerWithScopes<GenericCloner>::postProcess(Orig, Cloned);
10397
}
10498

lib/SILOptimizer/Utils/GenericCloner.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ void GenericCloner::visitTerminator(SILBasicBlock *BB) {
192192
getBuilder().createDeallocStack(ASI->getLoc(), ASI);
193193
}
194194
if (ReturnValue) {
195-
auto *NewReturn = getBuilder().createReturn(RI->getLoc(), ReturnValue);
196-
FunctionExits.push_back(NewReturn);
195+
getBuilder().createReturn(RI->getLoc(), ReturnValue);
197196
return;
198197
}
199198
} else if (OrigTermInst->isFunctionExiting()) {

0 commit comments

Comments
 (0)