Refactor code in ObjCARC.cpp. NFC

This is in preparation for another patch I'm planning to send later.
This commit is contained in:
Akira Hatanaka 2021-10-07 11:25:01 -07:00
parent f66b1b2717
commit 392a2a554c
1 changed files with 4 additions and 5 deletions

View File

@ -114,8 +114,8 @@ CallInst *BundledRetainClaimRVs::insertRVCallWithColors(
}
BundledRetainClaimRVs::~BundledRetainClaimRVs() {
if (ContractPass) {
for (auto P : RVCalls) {
for (auto P : RVCalls) {
if (ContractPass) {
CallBase *CB = P.second;
// At this point, we know that the annotated calls can't be tail calls
// as they are followed by marker instructions and retainRV/claimRV
@ -129,10 +129,9 @@ BundledRetainClaimRVs::~BundledRetainClaimRVs() {
auto *NewCB = CallBase::Create(CB, OB, CB);
CB->replaceAllUsesWith(NewCB);
CB->eraseFromParent();
}
} else {
for (auto P : RVCalls)
} else {
EraseInstruction(P.first);
}
}
RVCalls.clear();