Fix a bunch of other places that used operator[] to test whether
a key is present in a std::map or DenseMap to use find instead.
llvm-svn: 74676
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index ea29f73..bd994de 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -452,8 +452,9 @@
if (Subtarget->GVRequiresExtraLoad(GV, TM, isCall)) {
// Check to see if we've already materialized this
// value in a register in this block.
- if (unsigned Reg = LocalValueMap[V]) {
- AM.Base.Reg = Reg;
+ DenseMap<const Value *, unsigned>::iterator I = LocalValueMap.find(V);
+ if (I != LocalValueMap.end() && I->second != 0) {
+ AM.Base.Reg = I->second;
AM.GV = 0;
return true;
}