diff options
author | Owen Anderson <resistor@mac.com> | 2007-04-18 04:38:39 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-04-18 04:38:39 +0000 |
commit | 1c2b862be0cfb3c72870a69cfb72b2f29a93471b (patch) | |
tree | 845d1b1e8ec85ddb0349646ca923dd968b69840e | |
parent | 61a4c072b9407983df1a6c965ada57474766b282 (diff) |
Add an accessor to make ETForest more useful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36246 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index c550fe0d30..c8e753c149 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -320,6 +320,13 @@ public: return NULL; return Common->getData<BasicBlock>(); } + + /// Return the immediate dominator of A. + BasicBlock *getIDom(BasicBlock *A) { + ETNode *NodeA = getNode(A); + const ETNode *idom = NodeA->getFather(); + return idom ? idom->getData<BasicBlock>() : 0; + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); |