[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.
authorMichael Gottesman <mgottesman@apple.com>
Thu, 19 Feb 2015 00:42:34 +0000 (00:42 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Thu, 19 Feb 2015 00:42:34 +0000 (00:42 +0000)
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

lib/Transforms/ObjCARC/ObjCARCContract.cpp

index 2a7039a96c57cd7c427d12111bc2579ae02e58fe..86f23ec10276b7cc1d7e9b250f9f9ea9f8da8ec1 100644 (file)
@@ -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.