diff options
author | Devang Patel <dpatel@apple.com> | 2007-06-07 22:17:16 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-06-07 22:17:16 +0000 |
commit | 4b90e3a276c0bb1bd4d90289e27aa3c4f890b5af (patch) | |
tree | bc1da155feade95e2eefab818753f7d984a5e839 /include/llvm/Analysis/Dominators.h | |
parent | 326821ef12c911af1d785e305e81dc3c07e456a5 (diff) | |
download | external_llvm-4b90e3a276c0bb1bd4d90289e27aa3c4f890b5af.zip external_llvm-4b90e3a276c0bb1bd4d90289e27aa3c4f890b5af.tar.gz external_llvm-4b90e3a276c0bb1bd4d90289e27aa3c4f890b5af.tar.bz2 |
Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/Dominators.h')
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 8530766..f98db6f 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -142,6 +142,16 @@ protected: return getNode(BB); } + /// getIDomBlock - return basic block BB's immediate domiantor basic block. + /// + BasicBlock *getIDomBlock(BasicBlock *BB) { + DomTreeNode *N = getNode(BB); + assert (N && "Missing dominator tree node"); + DomTreeNode *I = N->getIDom(); + assert (N && "Missing immediate dominator"); + return I->getBlock(); + } + /// getRootNode - This returns the entry node for the CFG of the function. If /// this tree represents the post-dominance relations for a function, however, /// this root may be a node with the block == NULL. This is the case when |