forked from OSchip/llvm-project
Small cleanups.
Cleaned up trailing whitespace and added extra slashes in front of a function level comment so that it follow the convention of having 3 slashes. llvm-svn: 178712
This commit is contained in:
parent
151976694a
commit
c2d5bf5c53
|
@ -1949,9 +1949,9 @@ ObjCARCOpt::VisitBottomUp(BasicBlock *BB,
|
||||||
}
|
}
|
||||||
|
|
||||||
// If ARC Annotations are enabled, output the current state of pointers at the
|
// If ARC Annotations are enabled, output the current state of pointers at the
|
||||||
// bottom of the basic block.
|
// bottom of the basic block.
|
||||||
ANNOTATE_BOTTOMUP_BBEND(MyStates, BB);
|
ANNOTATE_BOTTOMUP_BBEND(MyStates, BB);
|
||||||
|
|
||||||
// Visit all the instructions, bottom-up.
|
// Visit all the instructions, bottom-up.
|
||||||
for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; --I) {
|
for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; --I) {
|
||||||
Instruction *Inst = llvm::prior(I);
|
Instruction *Inst = llvm::prior(I);
|
||||||
|
@ -1978,7 +1978,7 @@ ObjCARCOpt::VisitBottomUp(BasicBlock *BB,
|
||||||
// If ARC Annotations are enabled, output the current state of pointers at the
|
// If ARC Annotations are enabled, output the current state of pointers at the
|
||||||
// top of the basic block.
|
// top of the basic block.
|
||||||
ANNOTATE_BOTTOMUP_BBSTART(MyStates, BB);
|
ANNOTATE_BOTTOMUP_BBSTART(MyStates, BB);
|
||||||
|
|
||||||
return NestingDetected;
|
return NestingDetected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2151,7 +2151,7 @@ ObjCARCOpt::VisitTopDown(BasicBlock *BB,
|
||||||
// If ARC Annotations are enabled, output the current state of pointers at the
|
// If ARC Annotations are enabled, output the current state of pointers at the
|
||||||
// top of the basic block.
|
// top of the basic block.
|
||||||
ANNOTATE_TOPDOWN_BBSTART(MyStates, BB);
|
ANNOTATE_TOPDOWN_BBSTART(MyStates, BB);
|
||||||
|
|
||||||
// Visit all the instructions, top-down.
|
// Visit all the instructions, top-down.
|
||||||
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
|
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
|
||||||
Instruction *Inst = I;
|
Instruction *Inst = I;
|
||||||
|
@ -2160,11 +2160,11 @@ ObjCARCOpt::VisitTopDown(BasicBlock *BB,
|
||||||
|
|
||||||
NestingDetected |= VisitInstructionTopDown(Inst, Releases, MyStates);
|
NestingDetected |= VisitInstructionTopDown(Inst, Releases, MyStates);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If ARC Annotations are enabled, output the current state of pointers at the
|
// If ARC Annotations are enabled, output the current state of pointers at the
|
||||||
// bottom of the basic block.
|
// bottom of the basic block.
|
||||||
ANNOTATE_TOPDOWN_BBEND(MyStates, BB);
|
ANNOTATE_TOPDOWN_BBEND(MyStates, BB);
|
||||||
|
|
||||||
CheckForCFGHazards(BB, BBStates, MyStates);
|
CheckForCFGHazards(BB, BBStates, MyStates);
|
||||||
return NestingDetected;
|
return NestingDetected;
|
||||||
}
|
}
|
||||||
|
@ -2779,9 +2779,9 @@ bool ObjCARCOpt::OptimizeSequences(Function &F) {
|
||||||
NestingDetected;
|
NestingDetected;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there is a dependent call earlier that does not have anything in
|
/// Check if there is a dependent call earlier that does not have anything in
|
||||||
// between the Retain and the call that can affect the reference count of their
|
/// between the Retain and the call that can affect the reference count of their
|
||||||
// shared pointer argument. Note that Retain need not be in BB.
|
/// shared pointer argument. Note that Retain need not be in BB.
|
||||||
static bool
|
static bool
|
||||||
HasSafePathToPredecessorCall(const Value *Arg, Instruction *Retain,
|
HasSafePathToPredecessorCall(const Value *Arg, Instruction *Retain,
|
||||||
SmallPtrSet<Instruction *, 4> &DepInsts,
|
SmallPtrSet<Instruction *, 4> &DepInsts,
|
||||||
|
@ -2791,19 +2791,19 @@ HasSafePathToPredecessorCall(const Value *Arg, Instruction *Retain,
|
||||||
DepInsts, Visited, PA);
|
DepInsts, Visited, PA);
|
||||||
if (DepInsts.size() != 1)
|
if (DepInsts.size() != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CallInst *Call =
|
CallInst *Call =
|
||||||
dyn_cast_or_null<CallInst>(*DepInsts.begin());
|
dyn_cast_or_null<CallInst>(*DepInsts.begin());
|
||||||
|
|
||||||
// Check that the pointer is the return value of the call.
|
// Check that the pointer is the return value of the call.
|
||||||
if (!Call || Arg != Call)
|
if (!Call || Arg != Call)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check that the call is a regular call.
|
// Check that the call is a regular call.
|
||||||
InstructionClass Class = GetBasicInstructionClass(Call);
|
InstructionClass Class = GetBasicInstructionClass(Call);
|
||||||
if (Class != IC_CallOrUser && Class != IC_Call)
|
if (Class != IC_CallOrUser && Class != IC_Call)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2868,7 +2868,7 @@ void ObjCARCOpt::OptimizeReturns(Function &F) {
|
||||||
|
|
||||||
DependingInstructions.clear();
|
DependingInstructions.clear();
|
||||||
Visited.clear();
|
Visited.clear();
|
||||||
|
|
||||||
// Check that there is nothing that can affect the reference count
|
// Check that there is nothing that can affect the reference count
|
||||||
// between the retain and the call. Note that Retain need not be in BB.
|
// between the retain and the call. Note that Retain need not be in BB.
|
||||||
if (HasSafePathToPredecessorCall(Arg, Retain, DependingInstructions,
|
if (HasSafePathToPredecessorCall(Arg, Retain, DependingInstructions,
|
||||||
|
|
Loading…
Reference in New Issue