diff options
author | Michael Gottesman <mgottesman@apple.com> | 2015-02-19 00:42:34 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2015-02-19 00:42:34 +0000 |
commit | dfa3e4b08a89f76e228fdd03b55ff061c4100dd9 (patch) | |
tree | deedb8bef29de1e2ea24b26e0942f7f080afab31 /llvm/lib/Transforms/ObjCARC | |
parent | 1827973f803dd2c3b6fc541a383d1977ec1bf927 (diff) | |
download | bcm5719-llvm-dfa3e4b08a89f76e228fdd03b55ff061c4100dd9.tar.gz bcm5719-llvm-dfa3e4b08a89f76e228fdd03b55ff061c4100dd9.zip |
[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.
NFC. Makes it clearer what this method is actually supposed to do.
llvm-svn: 229795
Diffstat (limited to 'llvm/lib/Transforms/ObjCARC')
-rw-r--r-- | llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp index 2a7039a96c5..86f23ec1027 100644 --- a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp +++ b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp @@ -87,7 +87,8 @@ namespace { SmallPtrSetImpl<Instruction *> &DependingInstructions, SmallPtrSetImpl<const BasicBlock *> &Visited); - void contractRelease(Instruction *Release, inst_iterator &Iter); + void tryToContractReleaseIntoStoreStrong(Instruction *Release, + inst_iterator &Iter); void getAnalysisUsage(AnalysisUsage &AU) const override; bool doInitialization(Module &M) override; @@ -195,8 +196,9 @@ bool ObjCARCContract::contractAutorelease( /// an objc_storeStrong. This can be a little tricky because the instructions /// don't always appear in order, and there may be unrelated intervening /// instructions. -void ObjCARCContract::contractRelease(Instruction *Release, - inst_iterator &Iter) { +void +ObjCARCContract:: +tryToContractReleaseIntoStoreStrong(Instruction *Release, inst_iterator &Iter) { LoadInst *Load = dyn_cast<LoadInst>(GetObjCArg(Release)); if (!Load || !Load->isSimple()) return; @@ -368,7 +370,9 @@ bool ObjCARCContract::tryToPeepholeInstruction( return true; } case IC_Release: - contractRelease(Inst, Iter); + // Try to form an objc store strong from our release. If we fail, there is + // nothing further to do below, so continue. + tryToContractReleaseIntoStoreStrong(Inst, Iter); return true; case IC_User: // Be conservative if the function has any alloca instructions. |