diff options
| author | Gerolf Hoflehner <ghoflehner@apple.com> | 2017-07-12 23:05:15 +0000 |
|---|---|---|
| committer | Gerolf Hoflehner <ghoflehner@apple.com> | 2017-07-12 23:05:15 +0000 |
| commit | 3f164318e77bb1accbde6b79efb427cce7553b4c (patch) | |
| tree | 4d5b2bcf0fdda1370bebc49350c759a1682fdacb /llvm/lib | |
| parent | ac298951731bab2aceafd6f7f42ec1c0863316f4 (diff) | |
| download | bcm5719-llvm-3f164318e77bb1accbde6b79efb427cce7553b4c.tar.gz bcm5719-llvm-3f164318e77bb1accbde6b79efb427cce7553b4c.zip | |
[SjLj] Replace recursive block marking algorithm with iterative algorithm
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
llvm-svn: 307860
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SjLjEHPrepare.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp index 7886737b879..17a3a84ecda 100644 --- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp +++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp @@ -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 |

