diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-02 00:17:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-02 00:17:47 +0000 |
commit | 43f33dd550a2d165c41cbf01cae97d513dd5002c (patch) | |
tree | 18b9610a956fa4d7b81bdd1e792381e3c5e77660 /llvm/lib/Target/X86/X86FastISel.cpp | |
parent | f7691d398dd2c240eb6b01fbe2bfd07ef7a923ee (diff) | |
download | bcm5719-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/X86FastISel.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86FastISel.cpp | 5 |
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; } |