Skip to content

Commit 1f35961

Browse files
authored
ObjCARC: Drop pointer bitcast handling (#134274)
There is more in the file to drop, but this looks like the easier part.
1 parent d7354e3 commit 1f35961

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp

-19
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ bool ObjCARCContract::run(Function &F, AAResults *A, DominatorTree *D) {
660660
};
661661

662662
Value *Arg = cast<CallInst>(Inst)->getArgOperand(0);
663-
Value *OrigArg = Arg;
664663

665664
// TODO: Change this to a do-while.
666665
for (;;) {
@@ -687,24 +686,6 @@ bool ObjCARCContract::run(Function &F, AAResults *A, DominatorTree *D) {
687686
break;
688687
}
689688
}
690-
691-
// Replace bitcast users of Arg that are dominated by Inst.
692-
SmallVector<BitCastInst *, 2> BitCastUsers;
693-
694-
// Add all bitcast users of the function argument first.
695-
for (User *U : OrigArg->users())
696-
if (auto *BC = dyn_cast<BitCastInst>(U))
697-
BitCastUsers.push_back(BC);
698-
699-
// Replace the bitcasts with the call return. Iterate until list is empty.
700-
while (!BitCastUsers.empty()) {
701-
auto *BC = BitCastUsers.pop_back_val();
702-
for (User *U : BC->users())
703-
if (auto *B = dyn_cast<BitCastInst>(U))
704-
BitCastUsers.push_back(B);
705-
706-
ReplaceArgUses(BC);
707-
}
708689
}
709690

710691
// If this function has no escaping allocas or suspicious vararg usage,

0 commit comments

Comments
 (0)