From: Michael Gottesman Date: Thu, 19 Feb 2015 00:42:34 +0000 (+0000) Subject: [objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=db011405b38aa3bf16ef90eb0091af2f8c920330;p=oota-llvm.git [objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong. NFC. Makes it clearer what this method is actually supposed to do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229795 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/ObjCARC/ObjCARCContract.cpp b/lib/Transforms/ObjCARC/ObjCARCContract.cpp index 2a7039a96c5..86f23ec1027 100644 --- a/lib/Transforms/ObjCARC/ObjCARCContract.cpp +++ b/lib/Transforms/ObjCARC/ObjCARCContract.cpp @@ -87,7 +87,8 @@ namespace { SmallPtrSetImpl &DependingInstructions, SmallPtrSetImpl &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(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.