aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-11-06 17:00:41 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-11-06 17:00:41 +0000
commitdb7ab14434a7b15911c850ebdf740b0d8ebbb9e4 (patch)
treef416748aab608e399d1526ad1d77524f9ca48794
parent8aa5aeab8415ebff819cbe1bf4203ed49b7875f7 (diff)
Add const version of function getNodeForValue:
const DSNodeHandle &getNodeForValue(Value *V) const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4566 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/DSGraph.h7
-rw-r--r--include/llvm/Analysis/DataStructure/DSGraph.h7
2 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DSGraph.h b/include/llvm/Analysis/DSGraph.h
index 3891c0e70d..a2687438ce 100644
--- a/include/llvm/Analysis/DSGraph.h
+++ b/include/llvm/Analysis/DSGraph.h
@@ -76,6 +76,13 @@ public:
///
DSNodeHandle &getNodeForValue(Value *V) { return ScalarMap[V]; }
+ const DSNodeHandle &getNodeForValue(Value *V) const {
+ std::map<Value*, DSNodeHandle>::const_iterator I = ScalarMap.find(V);
+ assert(I != ScalarMap.end() &&
+ "Use non-const lookup function if node may not be in the map");
+ return I->second;
+ }
+
const DSNodeHandle &getRetNode() const { return RetNode; }
DSNodeHandle &getRetNode() { return RetNode; }
diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h
index 3891c0e70d..a2687438ce 100644
--- a/include/llvm/Analysis/DataStructure/DSGraph.h
+++ b/include/llvm/Analysis/DataStructure/DSGraph.h
@@ -76,6 +76,13 @@ public:
///
DSNodeHandle &getNodeForValue(Value *V) { return ScalarMap[V]; }
+ const DSNodeHandle &getNodeForValue(Value *V) const {
+ std::map<Value*, DSNodeHandle>::const_iterator I = ScalarMap.find(V);
+ assert(I != ScalarMap.end() &&
+ "Use non-const lookup function if node may not be in the map");
+ return I->second;
+ }
+
const DSNodeHandle &getRetNode() const { return RetNode; }
DSNodeHandle &getRetNode() { return RetNode; }