diff options
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/RegAllocSimple.cpp | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index ed45961db9..7acf982bdf 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -250,9 +250,9 @@ namespace { /// to be held on the stack. int RALocal::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) { // Find the location Reg would belong... - std::map<unsigned, int>::iterator I =StackSlotForVirtReg.lower_bound(VirtReg); + std::map<unsigned, int>::iterator I = StackSlotForVirtReg.find(VirtReg); - if (I != StackSlotForVirtReg.end() && I->first == VirtReg) + if (I != StackSlotForVirtReg.end()) return I->second; // Already has space allocated? // Allocate a new stack object for this spill location... diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp index 081edd8d5e..f07f7f92be 100644 --- a/lib/CodeGen/RegAllocSimple.cpp +++ b/lib/CodeGen/RegAllocSimple.cpp @@ -103,10 +103,9 @@ namespace { int RegAllocSimple::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) { // Find the location VirtReg would belong... - std::map<unsigned, int>::iterator I = - StackSlotForVirtReg.lower_bound(VirtReg); + std::map<unsigned, int>::iterator I = StackSlotForVirtReg.find(VirtReg); - if (I != StackSlotForVirtReg.end() && I->first == VirtReg) + if (I != StackSlotForVirtReg.end()) return I->second; // Already has space allocated? // Allocate a new stack object for this spill location... |