summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-11-10 01:02:17 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-11-10 01:02:17 +0000
commitb40d3f76a01406b9f21de5e73aa0ff0274b8e96c (patch)
tree6f8f5855c6aad581a49c7cb33c1614e152f70d63 /llvm/lib/Analysis
parenta71e9d61be9676c6b0209b3ed9c08cd3ad5be53b (diff)
downloadbcm5719-llvm-b40d3f76a01406b9f21de5e73aa0ff0274b8e96c.tar.gz
bcm5719-llvm-b40d3f76a01406b9f21de5e73aa0ff0274b8e96c.zip
Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to DenseMap::iterator which was possible because DenseMapIterator inherited (publicly) from DenseMapConstIterator. Conversion the other way around is now allowed as one may expect. The template DenseMapConstIterator is removed and the template parameter IsConst which specifies whether the iterator is constant is added to DenseMapIterator. Actually IsConst parameter is not necessary since the constness can be determined from KeyT but this is not relevant to the fix and can be addressed later. Patch by Victor Zverovich! llvm-svn: 86636
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/IPA/Andersens.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp
index 17f304c0211..40a8cd5b23e 100644
--- a/llvm/lib/Analysis/IPA/Andersens.cpp
+++ b/llvm/lib/Analysis/IPA/Andersens.cpp
@@ -518,7 +518,7 @@ namespace {
/// getObject - Return the node corresponding to the memory object for the
/// specified global or allocation instruction.
unsigned getObject(Value *V) const {
- DenseMap<Value*, unsigned>::iterator I = ObjectNodes.find(V);
+ DenseMap<Value*, unsigned>::const_iterator I = ObjectNodes.find(V);
assert(I != ObjectNodes.end() &&
"Value does not have an object in the points-to graph!");
return I->second;
@@ -527,7 +527,7 @@ namespace {
/// getReturnNode - Return the node representing the return value for the
/// specified function.
unsigned getReturnNode(Function *F) const {
- DenseMap<Function*, unsigned>::iterator I = ReturnNodes.find(F);
+ DenseMap<Function*, unsigned>::const_iterator I = ReturnNodes.find(F);
assert(I != ReturnNodes.end() && "Function does not return a value!");
return I->second;
}
@@ -535,7 +535,7 @@ namespace {
/// getVarargNode - Return the node representing the variable arguments
/// formal for the specified function.
unsigned getVarargNode(Function *F) const {
- DenseMap<Function*, unsigned>::iterator I = VarargNodes.find(F);
+ DenseMap<Function*, unsigned>::const_iterator I = VarargNodes.find(F);
assert(I != VarargNodes.end() && "Function does not take var args!");
return I->second;
}
OpenPOWER on IntegriCloud