Skip to content

Commit 5d3e557

Browse files
committed
Refactor code in ObjCARC.cpp. NFC
This is in preparation for another patch I'm planning to send later. (cherry picked from commit 392a2a5)
1 parent e22643a commit 5d3e557

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Transforms/ObjCARC/ObjCARC.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ CallInst *BundledRetainClaimRVs::insertRVCallWithColors(
114114
}
115115

116116
BundledRetainClaimRVs::~BundledRetainClaimRVs() {
117-
if (ContractPass) {
118-
for (auto P : RVCalls) {
117+
for (auto P : RVCalls) {
118+
if (ContractPass) {
119119
CallBase *CB = P.second;
120120
// At this point, we know that the annotated calls can't be tail calls
121121
// as they are followed by marker instructions and retainRV/claimRV
@@ -129,10 +129,9 @@ BundledRetainClaimRVs::~BundledRetainClaimRVs() {
129129
auto *NewCB = CallBase::Create(CB, OB, CB);
130130
CB->replaceAllUsesWith(NewCB);
131131
CB->eraseFromParent();
132-
}
133-
} else {
134-
for (auto P : RVCalls)
132+
} else {
135133
EraseInstruction(P.first);
134+
}
136135
}
137136

138137
RVCalls.clear();

0 commit comments

Comments
 (0)