New API for traversing graph
authorChris Lattner <sabre@nondot.org>
Wed, 29 Jan 2003 21:09:59 +0000 (21:09 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 29 Jan 2003 21:09:59 +0000 (21:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5430 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DSNode.h
include/llvm/Analysis/DSSupport.h
include/llvm/Analysis/DataStructure/DSNode.h
include/llvm/Analysis/DataStructure/DSSupport.h

index a8339fde2f0c4a23702ced3f1e09a73aac8323b6..cf298a234e438ad85c5298b6eaccf323562220be 100644 (file)
@@ -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;
 
index 29351cc8e5d1a2b16ae5a432bd1b92dcb2e40b90..f0f261e0b9e0fde1e3949ab9f7be7beea7a8a392 100644 (file)
@@ -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;
index a8339fde2f0c4a23702ced3f1e09a73aac8323b6..cf298a234e438ad85c5298b6eaccf323562220be 100644 (file)
@@ -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;
 
index 29351cc8e5d1a2b16ae5a432bd1b92dcb2e40b90..f0f261e0b9e0fde1e3949ab9f7be7beea7a8a392 100644 (file)
@@ -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;