diff options
| author | Akira Hatanaka <ahatanaka@apple.com> | 2021-10-07 11:25:01 -0700 |
|---|---|---|
| committer | Akira Hatanaka <ahatanaka@apple.com> | 2021-10-07 11:25:01 -0700 |
| commit | 392a2a554cdef684b27d2bf0abc4a736602e89c1 (patch) | |
| tree | 5d650665f09f0db284669ff654d10a268e3784b7 | |
| parent | f66b1b2717e84edef8a9e132638de6d866d01eab (diff) | |
| download | llvm-392a2a554cdef684b27d2bf0abc4a736602e89c1.zip llvm-392a2a554cdef684b27d2bf0abc4a736602e89c1.tar.gz llvm-392a2a554cdef684b27d2bf0abc4a736602e89c1.tar.bz2 | |
Refactor code in ObjCARC.cpp. NFC
This is in preparation for another patch I'm planning to send later.
| -rw-r--r-- | llvm/lib/Transforms/ObjCARC/ObjCARC.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp index 296610e..a0c9caa 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(); |
