summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/SparsePropagation.h
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
commit81cf4325698b48b02eddab921ac333c7f25005c3 (patch)
tree86a9954e792abea91b94475c1c671a7491701f15 /include/llvm/Analysis/SparsePropagation.h
parentd06094f0682f2ede03caff4892b1a57469896d48 (diff)
downloadllvm-81cf4325698b48b02eddab921ac333c7f25005c3.tar.gz
llvm-81cf4325698b48b02eddab921ac333c7f25005c3.tar.bz2
llvm-81cf4325698b48b02eddab921ac333c7f25005c3.tar.xz
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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/SparsePropagation.h')
-rw-r--r--include/llvm/Analysis/SparsePropagation.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/Analysis/SparsePropagation.h b/include/llvm/Analysis/SparsePropagation.h
index 820e1bd1e4..677d41d80b 100644
--- a/include/llvm/Analysis/SparsePropagation.h
+++ b/include/llvm/Analysis/SparsePropagation.h
@@ -153,7 +153,7 @@ public:
/// value. If an value is not in the map, it is returned as untracked,
/// unlike the getOrInitValueState method.
LatticeVal getLatticeState(Value *V) const {
- DenseMap<Value*, LatticeVal>::iterator I = ValueState.find(V);
+ DenseMap<Value*, LatticeVal>::const_iterator I = ValueState.find(V);
return I != ValueState.end() ? I->second : LatticeFunc->getUntrackedVal();
}