forked from OSchip/llvm-project
Add some constantness to GetSuccessorNumber().
llvm-svn: 253733
This commit is contained in:
parent
aa4d7596f4
commit
a1f61fe841
|
@ -40,7 +40,7 @@ void FindFunctionBackedges(
|
||||||
/// Search for the specified successor of basic block BB and return its position
|
/// Search for the specified successor of basic block BB and return its position
|
||||||
/// in the terminator instruction's list of successors. It is an error to call
|
/// in the terminator instruction's list of successors. It is an error to call
|
||||||
/// this with a block that is not a successor.
|
/// this with a block that is not a successor.
|
||||||
unsigned GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ);
|
unsigned GetSuccessorNumber(const BasicBlock *BB, const BasicBlock *Succ);
|
||||||
|
|
||||||
/// Return true if the specified edge is a critical edge. Critical edges are
|
/// Return true if the specified edge is a critical edge. Critical edges are
|
||||||
/// edges from a block with multiple successors to a block with multiple
|
/// edges from a block with multiple successors to a block with multiple
|
||||||
|
|
|
@ -69,8 +69,9 @@ void llvm::FindFunctionBackedges(const Function &F,
|
||||||
/// and return its position in the terminator instruction's list of
|
/// and return its position in the terminator instruction's list of
|
||||||
/// successors. It is an error to call this with a block that is not a
|
/// successors. It is an error to call this with a block that is not a
|
||||||
/// successor.
|
/// successor.
|
||||||
unsigned llvm::GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ) {
|
unsigned llvm::GetSuccessorNumber(const BasicBlock *BB,
|
||||||
TerminatorInst *Term = BB->getTerminator();
|
const BasicBlock *Succ) {
|
||||||
|
const TerminatorInst *Term = BB->getTerminator();
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
unsigned e = Term->getNumSuccessors();
|
unsigned e = Term->getNumSuccessors();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue