summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2015-11-20 23:02:06 +0000
committerRong Xu <xur@google.com>2015-11-20 23:02:06 +0000
commita1f61fe841b7a830a6a4249b5bcea1030409cae4 (patch)
tree59dfe6f91270bf025cd3f5b1716f7f76e2a612d9 /llvm
parentaa4d7596f4d8bcbb8a537c24c88e671ef99410bf (diff)
downloadbcm5719-llvm-a1f61fe841b7a830a6a4249b5bcea1030409cae4.tar.gz
bcm5719-llvm-a1f61fe841b7a830a6a4249b5bcea1030409cae4.zip
Add some constantness to GetSuccessorNumber().
llvm-svn: 253733
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Analysis/CFG.h2
-rw-r--r--llvm/lib/Analysis/CFG.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/Analysis/CFG.h b/llvm/include/llvm/Analysis/CFG.h
index 7c4df780198..35165f4061f 100644
--- a/llvm/include/llvm/Analysis/CFG.h
+++ b/llvm/include/llvm/Analysis/CFG.h
@@ -40,7 +40,7 @@ void FindFunctionBackedges(
/// 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
/// 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
/// edges from a block with multiple successors to a block with multiple
diff --git a/llvm/lib/Analysis/CFG.cpp b/llvm/lib/Analysis/CFG.cpp
index 041fcb6313b..0dfd57d3cb6 100644
--- a/llvm/lib/Analysis/CFG.cpp
+++ b/llvm/lib/Analysis/CFG.cpp
@@ -69,8 +69,9 @@ void llvm::FindFunctionBackedges(const Function &F,
/// 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
/// successor.
-unsigned llvm::GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ) {
- TerminatorInst *Term = BB->getTerminator();
+unsigned llvm::GetSuccessorNumber(const BasicBlock *BB,
+ const BasicBlock *Succ) {
+ const TerminatorInst *Term = BB->getTerminator();
#ifndef NDEBUG
unsigned e = Term->getNumSuccessors();
#endif
OpenPOWER on IntegriCloud