diff options
author | Anna Zaks <ganna@apple.com> | 2011-12-05 19:17:04 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-12-05 19:17:04 +0000 |
commit | e15402f92b6949d2474cc82648239fe22e5a2209 (patch) | |
tree | 3a8d9b6a4490722e9480b6fba1c0617086a3fd45 /include/llvm/ADT/GraphTraits.h | |
parent | fef3f9aed38950877deff6c55331f42dfd852c1c (diff) | |
download | external_llvm-e15402f92b6949d2474cc82648239fe22e5a2209.zip external_llvm-e15402f92b6949d2474cc82648239fe22e5a2209.tar.gz external_llvm-e15402f92b6949d2474cc82648239fe22e5a2209.tar.bz2 |
Change the Dominators recalculate() function to only rely on GraphTraits
This is a patch by Guoping Long!
As part of utilizing LLVM Dominator computation in Clang, made two changes to LLVM dominators tree implementation:
- (1) Change the recalculate() template function to only rely on GraphTraits.
- (2) Add a size() method to GraphTraits template class to query the number of nodes in the graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145837 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/GraphTraits.h')
-rw-r--r-- | include/llvm/ADT/GraphTraits.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/ADT/GraphTraits.h b/include/llvm/ADT/GraphTraits.h index 0fd1f50..823caef 100644 --- a/include/llvm/ADT/GraphTraits.h +++ b/include/llvm/ADT/GraphTraits.h @@ -43,9 +43,12 @@ struct GraphTraits { // typedef ...iterator nodes_iterator; // static nodes_iterator nodes_begin(GraphType *G) // static nodes_iterator nodes_end (GraphType *G) - // // nodes_iterator/begin/end - Allow iteration over all nodes in the graph + // static unsigned size (GraphType *G) + // Return total number of nodes in the graph + // + // If anyone tries to use this class without having an appropriate // specialization, make an error. If you get this error, it's because you |