Do not segfault when the post-dominator tree is empty (ie, there are no return

or unwind instructions in the function)

llvm-svn: 8537
This commit is contained in:
Chris Lattner 2003-09-15 15:47:40 +00:00
parent 3178b8abbc
commit 2233d8b00a

View File

@ -88,7 +88,8 @@ struct PostDominanceFrontier : public DominanceFrontierBase {
Frontiers.clear();
PostDominatorTree &DT = getAnalysis<PostDominatorTree>();
Roots = DT.getRoots();
calculate(DT, DT.getRootNode());
if (const DominatorTree::Node *Root = DT.getRootNode())
calculate(DT, Root);
return false;
}