[llvm-commits] [llvm] r171791 - /llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
Michael Gottesman
mgottesman at apple.com
Mon Jan 7 13:26:07 PST 2013
Author: mgottesman
Date: Mon Jan 7 15:26:07 2013
New Revision: 171791
URL: http://llvm.org/viewvc/llvm-project?rev=171791&view=rev
Log:
Fixed EOL whitespace.
Modified:
llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp?rev=171791&r1=171790&r2=171791&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp Mon Jan 7 15:26:07 2013
@@ -886,9 +886,9 @@
for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ++I) {
Instruction *Inst = &*I;
-
+
DEBUG(dbgs() << "ObjCARCExpand: Visiting: " << *Inst << "\n");
-
+
switch (GetBasicInstructionClass(Inst)) {
case IC_Retain:
case IC_RetainRV:
@@ -911,9 +911,9 @@
break;
}
}
-
+
DEBUG(dbgs() << "ObjCARCExpand: Finished List.\n\n");
-
+
return Changed;
}
@@ -2199,13 +2199,13 @@
// Turn it to an objc_retainAutoreleasedReturnValue..
Changed = true;
++NumPeeps;
-
+
DEBUG(dbgs() << "ObjCARCOpt::OptimizeRetainCall: Transforming "
"objc_retainAutoreleasedReturnValue => "
"objc_retain since the operand is not a return value.\n"
" Old: "
<< *Retain << "\n");
-
+
cast<CallInst>(Retain)->setCalledFunction(getRetainRVCallee(F.getParent()));
DEBUG(dbgs() << " New: "
@@ -2247,11 +2247,11 @@
GetObjCArg(I) == Arg) {
Changed = true;
++NumPeeps;
-
+
DEBUG(dbgs() << "ObjCARCOpt::OptimizeRetainRVCall: Erasing " << *I << "\n"
<< " Erasing " << *RetainRV
<< "\n");
-
+
EraseInstruction(I);
EraseInstruction(RetainRV);
return true;
@@ -2261,13 +2261,13 @@
// Turn it to a plain objc_retain.
Changed = true;
++NumPeeps;
-
+
DEBUG(dbgs() << "ObjCARCOpt::OptimizeRetainRVCall: Transforming "
"objc_retainAutoreleasedReturnValue => "
"objc_retain since the operand is not a return value.\n"
" Old: "
<< *RetainRV << "\n");
-
+
cast<CallInst>(RetainRV)->setCalledFunction(getRetainCallee(F.getParent()));
DEBUG(dbgs() << " New: "
@@ -2308,10 +2308,10 @@
cast<CallInst>(AutoreleaseRV)->
setCalledFunction(getAutoreleaseCallee(F.getParent()));
-
+
DEBUG(dbgs() << " New: "
<< *AutoreleaseRV << "\n");
-
+
}
/// OptimizeIndividualCalls - Visit each call, one at a time, and make
@@ -2361,12 +2361,12 @@
new StoreInst(UndefValue::get(cast<PointerType>(Ty)->getElementType()),
Constant::getNullValue(Ty),
CI);
- llvm::Value *NewValue = UndefValue::get(CI->getType());
+ llvm::Value *NewValue = UndefValue::get(CI->getType());
DEBUG(dbgs() << "ObjCARCOpt::OptimizeIndividualCalls: A null "
"pointer-to-weak-pointer is undefined behavior.\n"
" Old = " << *CI <<
"\n New = " <<
- *NewValue << "\n");
+ *NewValue << "\n");
CI->replaceAllUsesWith(NewValue);
CI->eraseFromParent();
continue;
@@ -2390,7 +2390,7 @@
" Old = " << *CI <<
"\n New = " <<
*NewValue << "\n");
-
+
CI->replaceAllUsesWith(NewValue);
CI->eraseFromParent();
continue;
@@ -2425,14 +2425,14 @@
Call->getArgOperand(0), "", Call);
NewCall->setMetadata(ImpreciseReleaseMDKind,
MDNode::get(C, ArrayRef<Value *>()));
-
+
DEBUG(dbgs() << "ObjCARCOpt::OptimizeIndividualCalls: Replacing "
"objc_autorelease(x) with objc_release(x) since x is "
"otherwise unused.\n"
" Old: " << *Call <<
"\n New: " <<
*NewCall << "\n");
-
+
EraseInstruction(Call);
Inst = NewCall;
Class = IC_Release;
@@ -3626,9 +3626,9 @@
done:;
}
}
-
+
DEBUG(dbgs() << "ObjCARCOpt::OptimizeWeakCalls: Finished List.\n\n");
-
+
}
/// OptimizeSequences - Identify program paths which execute sequences of
@@ -3766,9 +3766,9 @@
DependingInstructions.clear();
Visited.clear();
}
-
+
DEBUG(dbgs() << "ObjCARCOpt::OptimizeReturns: Finished List.\n\n");
-
+
}
bool ObjCARCOpt::doInitialization(Module &M) {
@@ -4027,20 +4027,20 @@
Changed = true;
++NumPeeps;
-
+
DEBUG(dbgs() << "ObjCARCContract::ContractAutorelease: Fusing "
"retain/autorelease. Erasing: " << *Autorelease << "\n"
" Old Retain: "
<< *Retain << "\n");
-
+
if (Class == IC_AutoreleaseRV)
Retain->setCalledFunction(getRetainAutoreleaseRVCallee(F.getParent()));
else
Retain->setCalledFunction(getRetainAutoreleaseCallee(F.getParent()));
-
+
DEBUG(dbgs() << " New Retain: "
<< *Retain << "\n");
-
+
EraseInstruction(Autorelease);
return true;
}
@@ -4190,9 +4190,9 @@
SmallPtrSet<const BasicBlock *, 4> Visited;
for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ) {
Instruction *Inst = &*I++;
-
+
DEBUG(dbgs() << "ObjCARCContract: Visiting: " << *Inst << "\n");
-
+
// Only these library routines return their argument. In particular,
// objc_retainBlock does not necessarily return its argument.
InstructionClass Class = GetBasicInstructionClass(Inst);
@@ -4251,10 +4251,10 @@
ConstantPointerNull::get(cast<PointerType>(CI->getType()));
Changed = true;
new StoreInst(Null, CI->getArgOperand(0), CI);
-
+
DEBUG(dbgs() << "OBJCARCContract: Old = " << *CI << "\n"
<< " New = " << *Null << "\n");
-
+
CI->replaceAllUsesWith(Null);
CI->eraseFromParent();
}
More information about the llvm-commits
mailing list