implement some methods.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / LegalizeTypes.cpp
index eb1b84fa3fa0c5fc0d7b43d72e9aa0edd90fcc38..fb3e81c9cd428457d6c3c05a1857bd93e011a168 100644 (file)
@@ -320,8 +320,7 @@ void DAGTypeLegalizer::GetExpandedOp(SDOperand Op, SDOperand &Lo,
   Hi = Entry.second;
 }
 
-void DAGTypeLegalizer::SetExpandedOp(SDOperand Op, SDOperand Lo, 
-                                     SDOperand Hi) {
+void DAGTypeLegalizer::SetExpandedOp(SDOperand Op, SDOperand Lo, SDOperand Hi) {
   // Remember that this is the result of the node.
   std::pair<SDOperand, SDOperand> &Entry = ExpandedNodes[Op];
   assert(Entry.first.Val == 0 && "Node already expanded");
@@ -335,6 +334,30 @@ void DAGTypeLegalizer::SetExpandedOp(SDOperand Op, SDOperand Lo,
     MarkNewNodes(Hi.Val);
 }
 
+void DAGTypeLegalizer::GetSplitOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi) {
+  std::pair<SDOperand, SDOperand> &Entry = SplitNodes[Op];
+  RemapNode(Entry.first);
+  RemapNode(Entry.second);
+  assert(Entry.first.Val && "Operand isn't split");
+  Lo = Entry.first;
+  Hi = Entry.second;
+}
+
+void DAGTypeLegalizer::SetSplitOp(SDOperand Op, SDOperand Lo, SDOperand Hi) {
+  // Remember that this is the result of the node.
+  std::pair<SDOperand, SDOperand> &Entry = SplitNodes[Op];
+  assert(Entry.first.Val == 0 && "Node already split");
+  Entry.first = Lo;
+  Entry.second = Hi;
+  
+  // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
+  if (Lo.Val->getNodeId() == NewNode) 
+    MarkNewNodes(Lo.Val);
+  if (Hi.Val->getNodeId() == NewNode) 
+    MarkNewNodes(Hi.Val);
+}
+
+
 SDOperand DAGTypeLegalizer::CreateStackStoreLoad(SDOperand Op, 
                                                  MVT::ValueType DestVT) {
   // Create the stack frame object.