Add some constantness to GetSuccessorNumber().
authorRong Xu <xur@google.com>
Fri, 20 Nov 2015 23:02:06 +0000 (23:02 +0000)
committerRong Xu <xur@google.com>
Fri, 20 Nov 2015 23:02:06 +0000 (23:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253733 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/CFG.h
lib/Analysis/CFG.cpp

index 7c4df780198cb26468ef36ef5549c942ecfa27ac..35165f4061f1e8c3604588b8a452f0e62f95689a 100644 (file)
@@ -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
index 041fcb6313bd4d43405ea7d49f3c7770fd10e3fc..0dfd57d3cb6bb985bd8c597236cb6ae23591c281 100644 (file)
@@ -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