summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-07 17:46:23 +0000
committerDan Gohman <gohman@apple.com>2008-07-07 17:46:23 +0000
commit38740a98b2702ee8cf894969b505183e1af70da3 (patch)
tree14ab533c1e3f73f3df0e60e201e1e674e73a8bd6 /llvm/lib/CodeGen/SelectionDAG
parent86b4249c9719a4418f14e48f9844389016718b84 (diff)
downloadbcm5719-llvm-38740a98b2702ee8cf894969b505183e1af70da3.tar.gz
bcm5719-llvm-38740a98b2702ee8cf894969b505183e1af70da3.zip
Make DenseMap's insert return a pair, to more closely resemble std::map.
llvm-svn: 53177
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp5
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp18
2 files changed, 14 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 1fa1f3fa2a3..5cf637e0468 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -115,7 +115,7 @@ class VISIBILITY_HIDDEN SelectionDAGLegalize {
LegalizedNodes.insert(std::make_pair(To, To));
}
void AddPromotedOperand(SDOperand From, SDOperand To) {
- bool isNew = PromotedNodes.insert(std::make_pair(From, To));
+ bool isNew = PromotedNodes.insert(std::make_pair(From, To)).second;
assert(isNew && "Got into the map somehow?");
// If someone requests legalization of the new node, return itself.
LegalizedNodes.insert(std::make_pair(To, To));
@@ -6734,7 +6734,8 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
}
// Remember in a map if the values will be reused later.
- bool isNew = ExpandedNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi)));
+ bool isNew =
+ ExpandedNodes.insert(std::make_pair(Op, std::make_pair(Lo, Hi))).second;
assert(isNew && "Value already expanded?!?");
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index f41e14aa7e1..10a5e8c9df3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -413,9 +413,10 @@ void ScheduleDAG::EmitCopyFromReg(SDNode *Node, unsigned ResNo,
unsigned VRBase = 0;
if (TargetRegisterInfo::isVirtualRegister(SrcReg)) {
// Just use the input register directly!
+ SDOperand Op(Node, ResNo);
if (IsClone)
- VRBaseMap.erase(SDOperand(Node, ResNo));
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo),SrcReg));
+ VRBaseMap.erase(Op);
+ bool isNew = VRBaseMap.insert(std::make_pair(Op, SrcReg)).second;
isNew = isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
return;
@@ -472,9 +473,10 @@ void ScheduleDAG::EmitCopyFromReg(SDNode *Node, unsigned ResNo,
TII->copyRegToReg(*BB, BB->end(), VRBase, SrcReg, DstRC, SrcRC);
}
+ SDOperand Op(Node, ResNo);
if (IsClone)
- VRBaseMap.erase(SDOperand(Node, ResNo));
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,ResNo), VRBase));
+ VRBaseMap.erase(Op);
+ bool isNew = VRBaseMap.insert(std::make_pair(Op, VRBase)).second;
isNew = isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
@@ -532,7 +534,8 @@ void ScheduleDAG::CreateVirtualRegisters(SDNode *Node, MachineInstr *MI,
MI->addOperand(MachineOperand::CreateReg(VRBase, true));
}
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,i), VRBase));
+ SDOperand Op(Node, i);
+ bool isNew = VRBaseMap.insert(std::make_pair(Op, VRBase)).second;
isNew = isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
@@ -786,7 +789,8 @@ void ScheduleDAG::EmitSubregNode(SDNode *Node,
} else
assert(0 && "Node is not insert_subreg, extract_subreg, or subreg_to_reg");
- bool isNew = VRBaseMap.insert(std::make_pair(SDOperand(Node,0), VRBase));
+ SDOperand Op(Node, 0);
+ bool isNew = VRBaseMap.insert(std::make_pair(Op, VRBase)).second;
isNew = isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
}
@@ -992,7 +996,7 @@ void ScheduleDAG::EmitCrossRCCopy(SUnit *SU,
// Copy from physical register.
assert(I->Reg && "Unknown physical register!");
unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC);
- bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase));
+ bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase)).second;
isNew = isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
TII->copyRegToReg(*BB, BB->end(), VRBase, I->Reg,
OpenPOWER on IntegriCloud