mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 15:39:00 +00:00
Use find with std::map, when that's what's needed, instead of lower_bound
with extra checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f56c2f7a4b
commit
0383bc014c
@ -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...
|
||||
|
@ -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...
|
||||
|
Loading…
Reference in New Issue
Block a user