const DSNodeHandle &getNodeForValue(Value *V) const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4566
91177308-0d34-0410-b5e6-
96231b3b80d8
///
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; }
///
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; }