aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/PostDominators.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-18 04:05:53 +0000
committerChris Lattner <sabre@nondot.org>2009-10-18 04:05:53 +0000
commitf0d24f1f597a84b1a164019ab81831ccd7aea47f (patch)
treed59fb309c8e39f49d699b8e23c4cbadd439609e9 /include/llvm/Analysis/PostDominators.h
parent6bccb4c2373532b972ecf84e8428f800e5e9995f (diff)
add nodes_begin/end/iterator for dominfo, patch by Tobias Grosser!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/PostDominators.h')
-rw-r--r--include/llvm/Analysis/PostDominators.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/Analysis/PostDominators.h b/include/llvm/Analysis/PostDominators.h
index 171cfdb2ea..42a16e74a2 100644
--- a/include/llvm/Analysis/PostDominators.h
+++ b/include/llvm/Analysis/PostDominators.h
@@ -74,6 +74,21 @@ struct PostDominatorTree : public FunctionPass {
FunctionPass* createPostDomTree();
+template <> struct GraphTraits<PostDominatorTree*>
+ : public GraphTraits<DomTreeNode*> {
+ static NodeType *getEntryNode(PostDominatorTree *DT) {
+ return DT->getRootNode();
+ }
+
+ static nodes_iterator nodes_begin(PostDominatorTree *N) {
+ return df_begin(getEntryNode(N));
+ }
+
+ static nodes_iterator nodes_end(PostDominatorTree *N) {
+ return df_end(getEntryNode(N));
+ }
+};
+
/// PostDominanceFrontier Class - Concrete subclass of DominanceFrontier that is
/// used to compute the a post-dominance frontier.
///