aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Analysis/DSNode.h6
-rw-r--r--include/llvm/Analysis/DSSupport.h7
-rw-r--r--include/llvm/Analysis/DataStructure/DSNode.h6
-rw-r--r--include/llvm/Analysis/DataStructure/DSSupport.h7
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;