[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
This commit is contained in:
Michael Gottesman
2015-02-19 00:42:34 +00:00
parent 855f109cc0
commit db011405b3

View File

@@ -87,7 +87,8 @@ namespace {
SmallPtrSetImpl<Instruction *> &DependingInstructions, SmallPtrSetImpl<Instruction *> &DependingInstructions,
SmallPtrSetImpl<const BasicBlock *> &Visited); SmallPtrSetImpl<const BasicBlock *> &Visited);
void contractRelease(Instruction *Release, inst_iterator &Iter); void tryToContractReleaseIntoStoreStrong(Instruction *Release,
inst_iterator &Iter);
void getAnalysisUsage(AnalysisUsage &AU) const override; void getAnalysisUsage(AnalysisUsage &AU) const override;
bool doInitialization(Module &M) 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 /// an objc_storeStrong. This can be a little tricky because the instructions
/// don't always appear in order, and there may be unrelated intervening /// don't always appear in order, and there may be unrelated intervening
/// instructions. /// instructions.
void ObjCARCContract::contractRelease(Instruction *Release, void
inst_iterator &Iter) { ObjCARCContract::
tryToContractReleaseIntoStoreStrong(Instruction *Release, inst_iterator &Iter) {
LoadInst *Load = dyn_cast<LoadInst>(GetObjCArg(Release)); LoadInst *Load = dyn_cast<LoadInst>(GetObjCArg(Release));
if (!Load || !Load->isSimple()) return; if (!Load || !Load->isSimple()) return;
@@ -368,7 +370,9 @@ bool ObjCARCContract::tryToPeepholeInstruction(
return true; return true;
} }
case IC_Release: 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; return true;
case IC_User: case IC_User:
// Be conservative if the function has any alloca instructions. // Be conservative if the function has any alloca instructions.