Reputation: 1
I'm trying to write an analysis and one of the features that I need is to know if a node PostDominate another.
I already know that I have to use:
void LazyProfitability::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<PostDominatorTreeWrapperPas>();
AU.setPreservesAll();
}
Upvotes: 0
Views: 240
Reputation: 1614
You can get a PostDominatorTree
object from the analysis results:
auto PDT = &getAnalysis<PostDominatorTreeWrapperPass>().getPostDomTree();
And use it after that in the following manner:
// returns true iff A post-dominates B
PDT->dominates(A, B);
Upvotes: 1