diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-24 21:19:30 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-24 21:19:30 +0000 |
commit | 91dcf0f97786a126e8dca3946a0579163038338d (patch) | |
tree | 40706777a9e46d3338c7a2f6d2cb8a5c36bcbc89 /llvm/lib/Analysis/LazyCallGraph.cpp | |
parent | d5835ee36815c82cc059b95a6a9cdb864dd193a7 (diff) | |
download | llvm-91dcf0f97786a126e8dca3946a0579163038338d.zip llvm-91dcf0f97786a126e8dca3946a0579163038338d.tar.gz llvm-91dcf0f97786a126e8dca3946a0579163038338d.tar.bz2 |
[LCG] Switch a weird do/while loop that actually couldn't fail its
condition into an obviously infinite loop with an assert about the
degenerate condition. No functionality changed.
llvm-svn: 207147
Diffstat (limited to 'llvm/lib/Analysis/LazyCallGraph.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyCallGraph.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp index 3b727a5..2e4fad3 100644 --- a/llvm/lib/Analysis/LazyCallGraph.cpp +++ b/llvm/lib/Analysis/LazyCallGraph.cpp @@ -444,7 +444,7 @@ LazyCallGraph::SCC *LazyCallGraph::getNextSCCInPostOrder() { DFSStack.push_back(std::make_pair(&N, N.begin())); } - do { + for (;;) { Node *N = DFSStack.back().first; assert(N->DFSNumber != 0 && "We should always assign a DFS number " "before placing a node onto the stack."); @@ -479,16 +479,15 @@ LazyCallGraph::SCC *LazyCallGraph::getNextSCCInPostOrder() { // Form the new SCC out of the top of the DFS stack. return formSCC(N, PendingSCCStack); + assert(!DFSStack.empty() && "We never found a viable root!"); + // At this point we know that N cannot ever be an SCC root. Its low-link // is not its dfs-number, and we've processed all of its children. It is // just sitting here waiting until some node further down the stack gets // low-link == dfs-number and pops it off as well. Move it to the pending // stack which is pulled into the next SCC to be formed. PendingSCCStack.push_back(N); - } while (!DFSStack.empty()); - - llvm_unreachable( - "We cannot reach the bottom of the stack without popping an SCC."); + } } char LazyCallGraphAnalysis::PassID; |