diff options
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r-- | lib/Transforms/Scalar/IndVarSimplify.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index d5eb668107..d375dcf4a9 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -185,8 +185,10 @@ void IndVarSimplify::LinearFunctionTestReplace(Loop *L, SCEV *IterationCount, ScalarEvolutionRewriter &RW) { // Find the exit block for the loop. We can currently only handle loops with // a single exit. - if (L->getExitBlocks().size() != 1) return; - BasicBlock *ExitBlock = L->getExitBlocks()[0]; + std::vector<BasicBlock*> ExitBlocks; + L->getExitBlocks(ExitBlocks); + if (ExitBlocks.size() != 1) return; + BasicBlock *ExitBlock = ExitBlocks[0]; // Make sure there is only one predecessor block in the loop. BasicBlock *ExitingBlock = 0; @@ -269,8 +271,10 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L) { // We insert the code into the preheader of the loop if the loop contains // multiple exit blocks, or in the exit block if there is exactly one. BasicBlock *BlockToInsertInto; - if (L->getExitBlocks().size() == 1) - BlockToInsertInto = L->getExitBlocks()[0]; + std::vector<BasicBlock*> ExitBlocks; + L->getExitBlocks(ExitBlocks); + if (ExitBlocks.size() == 1) + BlockToInsertInto = ExitBlocks[0]; else BlockToInsertInto = Preheader; BasicBlock::iterator InsertPt = BlockToInsertInto->begin(); |