[llvm] 392a2a5 - Refactor code in ObjCARC.cpp. NFC
Akira Hatanaka via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 7 11:26:23 PDT 2021
Author: Akira Hatanaka
Date: 2021-10-07T11:25:01-07:00
New Revision: 392a2a554cdef684b27d2bf0abc4a736602e89c1
URL: https://github.com/llvm/llvm-project/commit/392a2a554cdef684b27d2bf0abc4a736602e89c1
DIFF: https://github.com/llvm/llvm-project/commit/392a2a554cdef684b27d2bf0abc4a736602e89c1.diff
LOG: Refactor code in ObjCARC.cpp. NFC
This is in preparation for another patch I'm planning to send later.
Added:
Modified:
llvm/lib/Transforms/ObjCARC/ObjCARC.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp
index 296610eedccd9..a0c9caa6d26cc 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp
@@ -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();
More information about the llvm-commits
mailing list