Fix DenseMap iterator constness.
authorJeffrey Yasskin <jyasskin@google.com>
Tue, 10 Nov 2009 01:02:17 +0000 (01:02 +0000)
committerJeffrey Yasskin <jyasskin@google.com>
Tue, 10 Nov 2009 01:02:17 +0000 (01:02 +0000)
commit81cf4325698b48b02eddab921ac333c7f25005c3
tree86a9954e792abea91b94475c1c671a7491701f15
parentd06094f0682f2ede03caff4892b1a57469896d48
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
14 files changed:
include/llvm/ADT/DenseMap.h
include/llvm/Analysis/SparsePropagation.h
include/llvm/Support/type_traits.h
lib/Analysis/IPA/Andersens.cpp
lib/CodeGen/AsmPrinter/DwarfException.cpp
lib/CodeGen/PreAllocSplitting.cpp
lib/CodeGen/SlotIndexes.cpp
lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
lib/Target/X86/X86InstrInfo.cpp
lib/Transforms/Scalar/ABCD.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/SCCVN.cpp
lib/VMCore/Metadata.cpp
unittests/ADT/DenseMapTest.cpp