[LLVMdev] How to use the DominanceFrontier?

Wenbin Zhang zhangwen at cse.ohio-state.edu
Wed Sep 1 13:54:25 PDT 2010


Hi all,
Previously I used PostDominatorTree in this way:

PostDominatorTree pdt;
pdt.runOnFunction(*F);

And then I can have the post-dominator tree via pdt.
Now I'll trying to use the DominanceFrontier in a similar way:

DominanceFrontier df;
Df.runOnFunction(*F);

but an error shows up:
opt: /home/a_i/llvm/llvm-2.7/include/llvm/PassAnalysisSupport.h:210:
AnalysisType& llvm::Pass::getAnalysis() const [with AnalysisType =
llvm::DominatorTree]: Assertion `Resolver && "Pass has not been inserted
into a PassManager object!"` failed.

I'm not sure how to use this correctly. Can someone please give me some
hints? 
Also, what's the difference when using PostDominaterTree and
DominanceFrontier? Why my way works for at first but failed for the latter
one?
Thanks a lot.

Best,
--Wenbin




More information about the llvm-dev mailing list