aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-10 06:43:26 +0000
committerChris Lattner <sabre@nondot.org>2007-01-10 06:43:26 +0000
commit55e73a549359c949069550cbfc79b3e63c4c4119 (patch)
treec25b65c788f4ac4e1b4a0482732036067c382bef
parent7679693fdff990bd68692ca2f26c290c3c1b92ae (diff)
eliminate some iterator gymnastics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33052 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/AsmWriter.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index a5fbfefd99..263385c611 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1541,10 +1541,8 @@ void SlotMachine::CreateModuleSlot(const GlobalValue *V) {
unsigned DestSlot = 0;
const Type *VTy = V->getType();
- TypedPlanes::iterator I = mMap.find(VTy);
- if (I == mMap.end())
- I = mMap.insert(std::make_pair(VTy,ValuePlane())).first;
- DestSlot = I->second.map[V] = I->second.next_slot++;
+ ValuePlane &PlaneMap = mMap[VTy];
+ DestSlot = PlaneMap.map[V] = PlaneMap.next_slot++;
SC_DEBUG(" Inserting value [" << VTy << "] = " << V << " slot=" <<
DestSlot << " [");
@@ -1560,10 +1558,8 @@ void SlotMachine::CreateFunctionSlot(const Value *V) {
unsigned DestSlot = 0;
- TypedPlanes::iterator I = fMap.find(VTy);
- if (I == fMap.end())
- I = fMap.insert(std::make_pair(VTy,ValuePlane())).first;
- DestSlot = I->second.map[V] = I->second.next_slot++;
+ ValuePlane &PlaneMap = fMap[VTy];
+ DestSlot = PlaneMap.map[V] = PlaneMap.next_slot++;
// G = Global, F = Function, o = other
SC_DEBUG(" Inserting value [" << VTy << "] = " << V << " slot=" <<