mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Handle post dominance correctly in the case where blocks do not have a path to
the exit node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4038 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4e4caeffbd
commit
7d821db958
@ -59,6 +59,18 @@ bool PostDominatorSet::runOnFunction(Function &F) {
|
|||||||
if (PredSet.size())
|
if (PredSet.size())
|
||||||
set_intersect(WorkingSet, PredSet);
|
set_intersect(WorkingSet, PredSet);
|
||||||
}
|
}
|
||||||
|
} else if (BB != Root) {
|
||||||
|
// If this isn't the root basic block and it has no successors, it must
|
||||||
|
// be an non-returning block. Fib a bit by saying that the root node
|
||||||
|
// postdominates this unreachable node. This isn't exactly true,
|
||||||
|
// because there is no path from this node to the root node, but it is
|
||||||
|
// sorta true because any paths to the exit node would have to go
|
||||||
|
// through this node.
|
||||||
|
//
|
||||||
|
// This allows for postdominator properties to be built for code that
|
||||||
|
// doesn't return in a reasonable manner.
|
||||||
|
//
|
||||||
|
WorkingSet = Doms[Root];
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkingSet.insert(BB); // A block always dominates itself
|
WorkingSet.insert(BB); // A block always dominates itself
|
||||||
|
Loading…
x
Reference in New Issue
Block a user