diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-09 19:51:00 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-09 19:51:00 +0000 |
commit | 0383bc014c82ce3979416e5fe28caaca59142a05 (patch) | |
tree | 64f8b17fc9a0de8200b67654d55c173e3299a059 /lib/CodeGen/RegAllocSimple.cpp | |
parent | f56c2f7a4b03ccb469ac902bed40981cc4ff3b66 (diff) |
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
Diffstat (limited to 'lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocSimple.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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... |