Skip to content

Commit

Permalink
Remove more than half the stack usage of CFG traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
dberlin committed Feb 6, 2019
1 parent 7febc9c commit e63c341
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/llvmir2hll/graphs/cfg/cfg_traversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ bool CFGTraversal::getCurrRetVal() const {
*/
bool CFGTraversal::performTraversalImpl(ShPtr<CFG::Node> node,
CFG::stmt_iterator stmtIter) {
if (stmtIter != node->stmt_end()) {
while (stmtIter != node->stmt_end()) {
// We're not at the end of the node, so check the statement under
// stmtIter.

Expand All @@ -182,7 +182,7 @@ bool CFGTraversal::performTraversalImpl(ShPtr<CFG::Node> node,
return getCurrRetVal();
}

return performTraversalImpl(node, ++stmtIter);
++stmtIter;
}

// We have reached the end of the node, so check node's successors.
Expand Down Expand Up @@ -216,7 +216,7 @@ bool CFGTraversal::performReverseTraversalImpl(ShPtr<CFG::Node> node,
return getCurrRetVal();
}

return performReverseTraversalImpl(node, ++stmtRIter);
++stmtRIter;
}

// We have reached the start of the node, so check node's predecessors.
Expand Down

0 comments on commit e63c341

Please sign in to comment.