X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FPostDominators.cpp;h=f027949793f853e16c07c11d5839ce00f1635ce7;hb=c53544af06acf3fba1788613a364f1f40317869e;hp=c3320ee3db8f85a3d7f8446fb31e0b0a6c4f9496;hpb=546b027b3ee0ed3a8c5e551a7e13fc8a1775ede9;p=oota-llvm.git diff --git a/lib/Analysis/PostDominators.cpp b/lib/Analysis/PostDominators.cpp index c3320ee3db8..f027949793f 100644 --- a/lib/Analysis/PostDominators.cpp +++ b/lib/Analysis/PostDominators.cpp @@ -4,7 +4,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Analysis/Dominators.h" +#include "llvm/Analysis/PostDominators.h" #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h" #include "llvm/Support/CFG.h" #include "Support/DepthFirstIterator.h" @@ -59,6 +59,18 @@ bool PostDominatorSet::runOnFunction(Function &F) { if (PredSet.size()) 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 @@ -183,3 +195,7 @@ PostDominanceFrontier::calculate(const PostDominatorTree &DT, return S; } + +// stub - a dummy function to make linking work ok. +void PostDominanceFrontier::stub() { +}