Skip to content

Commit

Permalink
[SjLj] Replace recursive block marking algorithm with iterative algor…
Browse files Browse the repository at this point in the history
…ithm

Summary:
Some programs run into a stack overflow issue. This change avoids this
problem by replacing the recursive algorithm with the iterative version.

Reviewers: MatzeB, t.p.northover, dblaikie

Reviewed By: MatzeB

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D35105

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307860 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Gerolf-Apple committed Jul 12, 2017
1 parent e7149b9 commit 5dcc059
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/CodeGen/SjLjEHPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ static void MarkBlocksLiveIn(BasicBlock *BB,
if (!LiveBBs.insert(BB).second)
return; // already been here.

for (BasicBlock *PredBB : predecessors(BB))
MarkBlocksLiveIn(PredBB, LiveBBs);
df_iterator_default_set<BasicBlock*> Visited;

for (BasicBlock *B : inverse_depth_first_ext(BB, Visited))
LiveBBs.insert(B);

}

/// substituteLPadValues - Substitute the values returned by the landingpad
Expand Down

0 comments on commit 5dcc059

Please sign in to comment.