Home | History | Annotate | Download | only in ObjCARC

Lines Matching refs:Retain

71     bool OptimizeRetainCall(Function &F, Instruction *Retain);
117 ObjCARCContract::OptimizeRetainCall(Function &F, Instruction *Retain) {
118 ImmutableCallSite CS(GetObjCArg(Retain));
122 if (Call->getParent() != Retain->getParent())
125 // Check that the call is next to the retain.
129 if (&*I != Retain)
138 "return value.\nOld: "<< *Retain << "\n");
141 // retain/retainRV have the same properties.
143 cast<CallInst>(Retain)->setCalledFunction(Decl);
145 DEBUG(dbgs() << "New: " << *Retain << "\n");
149 /// Merge an autorelease with a retain into a fused call.
159 // Check that there are no instructions between the retain and the autorelease
161 CallInst *Retain = nullptr;
177 Retain = dyn_cast_or_null<CallInst>(*DependingInstructions.begin());
180 if (!Retain ||
181 GetBasicInstructionClass(Retain) != IC_Retain ||
182 GetObjCArg(Retain) != Arg)
189 "retain/autorelease. Erasing: " << *Autorelease << "\n"
190 " Old Retain: "
191 << *Retain << "\n");
196 Retain->setCalledFunction(Decl);
198 DEBUG(dbgs() << " New Retain: "
199 << *Retain << "\n");
256 // Walk up to find the retain.
261 Instruction *Retain = I;
262 if (GetBasicInstructionClass(Retain) != IC_Retain) return;
263 if (GetObjCArg(Retain) != New) return;
290 EraseInstruction(Retain);