aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-02 00:17:47 +0000
committerDan Gohman <gohman@apple.com>2009-07-02 00:17:47 +0000
commitf530c92cd55f35f64904e42e38b3a2bc92b347cb (patch)
tree90599072a77b48b5306f061b7006dcff85bf21d7 /lib/Target/X86/X86FastISel.cpp
parentc70e62110b7e165ab8f04c38ffd97f905dcda95d (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86FastISel.cpp')
-rw-r--r--lib/Target/X86/X86FastISel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp
index ea29f73a06..bd994dea8f 100644
--- a/lib/Target/X86/X86FastISel.cpp
+++ b/lib/Target/X86/X86FastISel.cpp
@@ -452,8 +452,9 @@ bool X86FastISel::X86SelectAddress(Value *V, X86AddressMode &AM, bool isCall) {
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;
}