[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307860 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gerolf Hoflehner 2017-07-12 23:05:15 +00:00
parent e7149b956e
commit 5dcc05955f

View File

@ -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