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
This commit is contained in:
Vikram S. Adve 2002-11-06 17:00:41 +00:00
parent 8aa5aeab84
commit db7ab14434
2 changed files with 14 additions and 0 deletions

View File

@ -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; }

View File

@ -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; }