- Change "ExternalSymbolSDNode" to "SymbolSDNode".
[oota-llvm.git] / lib / Target / IA64 / IA64ISelDAGToDAG.cpp
index 8173e96ccbfc9c6b2f37daaf20d8fa3c2cf63b40..19ea472868215504dac3ccb8fac97d2dcfb612ae 100644 (file)
@@ -80,7 +80,7 @@ namespace {
 
     /// InstructionSelect - This callback is invoked by
     /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-    virtual void InstructionSelect(SelectionDAG &DAG);
+    virtual void InstructionSelect();
     
     virtual const char *getPassName() const {
       return "IA64 (Itanium) DAG->DAG Instruction Selector";
@@ -96,16 +96,16 @@ private:
 
 /// InstructionSelect - This callback is invoked by
 /// SelectionDAGISel when it has created a SelectionDAG for us to codegen.
-void IA64DAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
+void IA64DAGToDAGISel::InstructionSelect() {
   DEBUG(BB->dump());
 
   // Select target instructions for the DAG.
   SelectRoot();
-  DAG.RemoveDeadNodes();
+  CurDAG->RemoveDeadNodes();
 }
 
 SDNode *IA64DAGToDAGISel::SelectDIV(SDValue Op) {
-  SDNode *N = Op.Val;
+  SDNode *N = Op.getNode();
   SDValue Chain = N->getOperand(0);
   SDValue Tmp1 = N->getOperand(0);
   SDValue Tmp2 = N->getOperand(1);
@@ -304,7 +304,7 @@ SDNode *IA64DAGToDAGISel::SelectDIV(SDValue Op) {
 // Select - Convert the specified operand from a target-independent to a
 // target-specific node if it hasn't already been changed.
 SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
-  SDNode *N = Op.Val;
+  SDNode *N = Op.getNode();
   if (N->isMachineOpcode())
     return NULL;   // Already selected.
 
@@ -329,7 +329,7 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
       dyn_cast<GlobalAddressSDNode>(N->getOperand(1))) {
       CallOpcode = IA64::BRCALL_IPREL_GA;
       CallOperand = CurDAG->getTargetGlobalAddress(GASD->getGlobal(), MVT::i64);
-    } else if (isa<ExternalSymbolSDNode>(N->getOperand(1))) {
+    } else if (isa<SymbolSDNode>(N->getOperand(1))) {
       // FIXME: we currently NEED this case for correctness, to avoid
       // "non-pic code with imm reloc.n against dynamic symbol" errors
     CallOpcode = IA64::BRCALL_IPREL_ES;
@@ -359,7 +359,8 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
 
     Chain = CurDAG->getCopyToReg(Chain, IA64::r1, targetGP, InFlag);
     InFlag = Chain.getValue(1);
-    Chain = CurDAG->getCopyToReg(Chain, IA64::B6, targetEntryPoint, InFlag); // FLAG these?
+    Chain = CurDAG->getCopyToReg(Chain, IA64::B6,
+                                 targetEntryPoint, InFlag); // FLAG these?
     InFlag = Chain.getValue(1);
     
     CallOperand = CurDAG->getRegister(IA64::B6, MVT::i64);
@@ -367,7 +368,7 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
   }
  
    // Finally, once everything is setup, emit the call itself
-   if(InFlag.Val)
+   if (InFlag.getNode())
      Chain = SDValue(CurDAG->getTargetNode(CallOpcode, MVT::Other, MVT::Flag,
                                              CallOperand, InFlag), 0);
    else // there might be no arguments
@@ -447,9 +448,9 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
   }
   
 /* XXX
-   case ISD::ExternalSymbol: {
-     SDValue EA = CurDAG->getTargetExternalSymbol(
-       cast<ExternalSymbolSDNode>(N)->getSymbol(),
+   case ISD::Symbol: {
+     SDValue EA = CurDAG->getTargetSymbol(
+       cast<SymbolSDNode>(N)->getSymbol(),
        MVT::i64);
      SDValue Tmp = CurDAG->getTargetNode(IA64::ADDL_EA, MVT::i64, 
                                            CurDAG->getRegister(IA64::r1,
@@ -520,7 +521,8 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
         AddToISelQueue(Tmp);
         Tmp =
           SDValue(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial,
-                                          CurDAG->getTargetConstant(1, MVT::i64),
+                                          CurDAG->getTargetConstant(1,
+                                                                    MVT::i64),
                                           Tmp), 0);
         return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain);
       }
@@ -558,7 +560,7 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
 
   case ISD::CALLSEQ_START:
   case ISD::CALLSEQ_END: {
-    int64_t Amt = cast<ConstantSDNode>(N->getOperand(1))->getValue();
+    int64_t Amt = cast<ConstantSDNode>(N->getOperand(1))->getZExtValue();
     unsigned Opc = N->getOpcode() == ISD::CALLSEQ_START ?
       IA64::ADJUSTCALLSTACKDOWN : IA64::ADJUSTCALLSTACKUP;
     SDValue N0 = N->getOperand(0);