X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FCFG.cpp;h=0dfd57d3cb6bb985bd8c597236cb6ae23591c281;hb=e14c161b0e3691e5004303766678ec939155fd42;hp=e15109bd27027270a6643c554782350cb79e985e;hpb=1b6ca9d0ccb5bb8ac42d2a3bf94288e3b008faeb;p=oota-llvm.git diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index e15109bd270..0dfd57d3cb6 100644 --- a/lib/Analysis/CFG.cpp +++ b/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 @@ -203,7 +204,8 @@ bool llvm::isPotentiallyReachable(const Instruction *A, const Instruction *B, return true; // Linear scan, start at 'A', see whether we hit 'B' or the end first. - for (BasicBlock::const_iterator I = A, E = BB->end(); I != E; ++I) { + for (BasicBlock::const_iterator I = A->getIterator(), E = BB->end(); I != E; + ++I) { if (&*I == B) return true; }