summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
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
commit43f33dd550a2d165c41cbf01cae97d513dd5002c (patch)
tree18b9610a956fa4d7b81bdd1e792381e3c5e77660 /llvm/lib/Target/X86
parentf7691d398dd2c240eb6b01fbe2bfd07ef7a923ee (diff)
downloadbcm5719-llvm-43f33dd550a2d165c41cbf01cae97d513dd5002c.tar.gz
bcm5719-llvm-43f33dd550a2d165c41cbf01cae97d513dd5002c.zip
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
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86FastISel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index ea29f73a066..bd994dea8f4 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud