diff options
author | Chris Lattner <sabre@nondot.org> | 2003-01-29 21:09:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-01-29 21:09:59 +0000 |
commit | 9e4b15b1a19b0903a14429f841b7b6a160dae44d (patch) | |
tree | da7f1ff56c05e79f2d5ce6675900d253706a5558 | |
parent | a4a684e4332400c4c38649375135b0023985112d (diff) |
New API for traversing graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5430 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/DSNode.h | 6 | ||||
-rw-r--r-- | include/llvm/Analysis/DSSupport.h | 7 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSNode.h | 6 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSSupport.h | 7 |
4 files changed, 26 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DSNode.h b/include/llvm/Analysis/DSNode.h index a8339fde2f..cf298a234e 100644 --- a/include/llvm/Analysis/DSNode.h +++ b/include/llvm/Analysis/DSNode.h @@ -218,6 +218,12 @@ public: /// specified mapping. void remapLinks(std::map<const DSNode*, DSNodeHandle> &OldNodeMap); + /// markReachableNodes - This method recursively traverses the specified + /// DSNodes, marking any nodes which are reachable. All reachable nodes it + /// adds to the set, which allows it to only traverse visited nodes once. + /// + void markReachableNodes(std::set<DSNode*> &ReachableNodes); + private: friend class DSNodeHandle; diff --git a/include/llvm/Analysis/DSSupport.h b/include/llvm/Analysis/DSSupport.h index 29351cc8e5..f0f261e0b9 100644 --- a/include/llvm/Analysis/DSSupport.h +++ b/include/llvm/Analysis/DSSupport.h @@ -9,6 +9,7 @@ #include <vector> #include <map> +#include <set> #include <functional> #include <string> @@ -214,6 +215,12 @@ public: getPtrArg(a).mergeWith(CS.getPtrArg(a)); } + /// markReachableNodes - This method recursively traverses the specified + /// DSNodes, marking any nodes which are reachable. All reachable nodes it + /// adds to the set, which allows it to only traverse visited nodes once. + /// + void markReachableNodes(std::set<DSNode*> &Nodes); + bool operator<(const DSCallSite &CS) const { if (Callee < CS.Callee) return true; // This must sort by callee first! if (Callee > CS.Callee) return false; diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index a8339fde2f..cf298a234e 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -218,6 +218,12 @@ public: /// specified mapping. void remapLinks(std::map<const DSNode*, DSNodeHandle> &OldNodeMap); + /// markReachableNodes - This method recursively traverses the specified + /// DSNodes, marking any nodes which are reachable. All reachable nodes it + /// adds to the set, which allows it to only traverse visited nodes once. + /// + void markReachableNodes(std::set<DSNode*> &ReachableNodes); + private: friend class DSNodeHandle; diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index 29351cc8e5..f0f261e0b9 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -9,6 +9,7 @@ #include <vector> #include <map> +#include <set> #include <functional> #include <string> @@ -214,6 +215,12 @@ public: getPtrArg(a).mergeWith(CS.getPtrArg(a)); } + /// markReachableNodes - This method recursively traverses the specified + /// DSNodes, marking any nodes which are reachable. All reachable nodes it + /// adds to the set, which allows it to only traverse visited nodes once. + /// + void markReachableNodes(std::set<DSNode*> &Nodes); + bool operator<(const DSCallSite &CS) const { if (Callee < CS.Callee) return true; // This must sort by callee first! if (Callee > CS.Callee) return false; |