[llvm] r229795 - [objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.

Michael Gottesman mgottesman at apple.com
Wed Feb 18 16:42:35 PST 2015


Author: mgottesman
Date: Wed Feb 18 18:42:34 2015
New Revision: 229795

URL: http://llvm.org/viewvc/llvm-project?rev=229795&view=rev
Log:
[objc-arc-contract] Rename contractRelease => tryToContractReleaseIntoStoreStrong.

NFC. Makes it clearer what this method is actually supposed to do.

Modified:
    llvm/trunk/lib/Transforms/ObjCARC/ObjCARCContract.cpp

Modified: llvm/trunk/lib/Transforms/ObjCARC/ObjCARCContract.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ObjCARC/ObjCARCContract.cpp?rev=229795&r1=229794&r2=229795&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/ObjCARC/ObjCARCContract.cpp (original)
+++ llvm/trunk/lib/Transforms/ObjCARC/ObjCARCContract.cpp Wed Feb 18 18:42:34 2015
@@ -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::contractAutoreleas
 /// 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::tryToPeepholeInstr
       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.





More information about the llvm-commits mailing list