1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

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

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

llvm-svn: 229795
This commit is contained in:
Michael Gottesman 2015-02-19 00:42:34 +00:00
parent 5352c179b7
commit b9380fca86

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.