summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-01-08 00:46:00 +0000
committerTed Kremenek <kremenek@apple.com>2008-01-08 00:46:00 +0000
commit9384343c11df8880bbcc5a9b797624187942532c (patch)
tree343a7cc45cea739525c183a3e97b32b591bf341e
parenta3da232ce7a5c292708c68269e979081dbbcf5a8 (diff)
downloadbcm5719-llvm-9384343c11df8880bbcc5a9b797624187942532c.tar.gz
bcm5719-llvm-9384343c11df8880bbcc5a9b797624187942532c.zip
Added nodes_iterator to the GraphTrait for ExplodedNode<>.
llvm-svn: 45730
-rw-r--r--clang/include/clang/Analysis/PathSensitive/ExplodedNode.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/ExplodedNode.h b/clang/include/clang/Analysis/PathSensitive/ExplodedNode.h
index 4ba138f8529..c8828347ff0 100644
--- a/clang/include/clang/Analysis/PathSensitive/ExplodedNode.h
+++ b/clang/include/clang/Analysis/PathSensitive/ExplodedNode.h
@@ -20,6 +20,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/GraphTraits.h"
+#include "llvm/ADT/DepthFirstIterator.h"
namespace clang {
@@ -159,8 +160,9 @@ public:
namespace llvm {
template<typename StateTy>
struct GraphTraits<clang::ExplodedNode<StateTy>*> {
- typedef clang::ExplodedNode<StateTy> NodeType;
- typedef typename NodeType::succ_iterator ChildIteratorType;
+ typedef clang::ExplodedNode<StateTy> NodeType;
+ typedef typename NodeType::succ_iterator ChildIteratorType;
+ typedef llvm::df_iterator<NodeType*> nodes_iterator;
static inline NodeType* getEntryNode(NodeType* N) {
return N;
@@ -173,12 +175,21 @@ struct GraphTraits<clang::ExplodedNode<StateTy>*> {
static inline ChildIteratorType child_end(NodeType* N) {
return N->succ_end();
}
+
+ static inline nodes_iterator nodes_begin(NodeType* N) {
+ return df_begin(N);
+ }
+
+ static inline nodes_iterator nodes_end(NodeType* N) {
+ return df_end(N);
+ }
};
template<typename StateTy>
struct GraphTraits<const clang::ExplodedNode<StateTy>*> {
typedef const clang::ExplodedNode<StateTy> NodeType;
- typedef typename NodeType::succ_iterator ChildIteratorType;
+ typedef typename NodeType::succ_iterator ChildIteratorType;
+ typedef llvm::df_iterator<NodeType*> nodes_iterator;
static inline NodeType* getEntryNode(NodeType* N) {
return N;
@@ -191,6 +202,14 @@ struct GraphTraits<const clang::ExplodedNode<StateTy>*> {
static inline ChildIteratorType child_end(NodeType* N) {
return N->succ_end();
}
+
+ static inline nodes_iterator nodes_begin(NodeType* N) {
+ return df_begin(N);
+ }
+
+ static inline nodes_iterator nodes_end(NodeType* N) {
+ return df_end(N);
+ }
};
}
#endif
OpenPOWER on IntegriCloud