Add missing const qualifiers.
[oota-llvm.git] / include / llvm / CodeGen / SelectionDAGNodes.h
index 5d1a0e3efb4f0f094095b11623a66f4936747c0e..23682c765c52217866163546e866730b966e7bd8 100644 (file)
@@ -95,7 +95,8 @@ namespace ISD {
     // Various leaf nodes.
     STRING, BasicBlock, VALUETYPE, CONDCODE, Register,
     Constant, ConstantFP,
-    GlobalAddress, FrameIndex, JumpTable, ConstantPool, ExternalSymbol,
+    GlobalAddress, GlobalTLSAddress, FrameIndex,
+    JumpTable, ConstantPool, ExternalSymbol,
 
     // The address of the GOT
     GLOBAL_OFFSET_TABLE,
@@ -124,6 +125,7 @@ namespace ISD {
     // anything else with this node, and this is valid in the target-specific
     // dag, turning into a GlobalAddress operand.
     TargetGlobalAddress,
+    TargetGlobalTLSAddress,
     TargetFrameIndex,
     TargetJumpTable,
     TargetConstantPool,
@@ -247,7 +249,7 @@ namespace ISD {
     
     /// VINSERT_VECTOR_ELT(VECTOR, VAL, IDX,  COUNT,TYPE) - Given a vector
     /// VECTOR, an element ELEMENT, and a (potentially variable) index IDX,
-    /// return an vector with the specified element of VECTOR replaced with VAL.
+    /// return a vector with the specified element of VECTOR replaced with VAL.
     /// COUNT and TYPE specify the type of vector, as is standard for V* nodes.
     VINSERT_VECTOR_ELT,
     
@@ -300,7 +302,7 @@ namespace ISD {
     /// Simple abstract vector operators.  Unlike the integer and floating point
     /// binary operators, these nodes also take two additional operands:
     /// a constant element count, and a value type node indicating the type of
-    /// the elements.  The order is count, type, op0, op1.  All vector opcodes,
+    /// the elements.  The order is op0, op1, count, type.  All vector opcodes,
     /// including VLOAD and VConstant must currently have count and type as
     /// their last two operands.
     VADD, VSUB, VMUL, VSDIV, VUDIV,
@@ -430,10 +432,11 @@ namespace ISD {
     TRUNCSTORE,
 
     // DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
-    // to a specified boundary.  The first operand is the token chain, the
-    // second is the number of bytes to allocate, and the third is the alignment
-    // boundary.  The size is guaranteed to be a multiple of the stack 
-    // alignment, and the alignment is guaranteed to be bigger than the stack 
+    // to a specified boundary.  This node always has two return values: a new
+    // stack pointer value and a chain. The first operand is the token chain,
+    // the second is the number of bytes to allocate, and the third is the
+    // alignment boundary.  The size is guaranteed to be a multiple of the stack
+    // alignment, and the alignment is guaranteed to be bigger than the stack
     // alignment (if required) or 0 to get standard stack alignment.
     DYNAMIC_STACKALLOC,
 
@@ -911,7 +914,7 @@ public:
 
   /// getOperationName - Return the opcode of this operation for printing.
   ///
-  const char* getOperationName(const SelectionDAG *G = 0) const;
+  std::string getOperationName(const SelectionDAG *G = 0) const;
   static const char* getIndexedModeName(ISD::MemIndexedMode AM);
   void dump() const;
   void dump(const SelectionDAG *G) const;
@@ -1162,11 +1165,7 @@ class GlobalAddressSDNode : public SDNode {
 protected:
   friend class SelectionDAG;
   GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
-                      int o = 0)
-    : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress,
-             getSDVTList(VT)), Offset(o) {
-    TheGlobal = const_cast<GlobalValue*>(GA);
-  }
+                      int o = 0);
 public:
 
   GlobalValue *getGlobal() const { return TheGlobal; }
@@ -1175,11 +1174,12 @@ public:
   static bool classof(const GlobalAddressSDNode *) { return true; }
   static bool classof(const SDNode *N) {
     return N->getOpcode() == ISD::GlobalAddress ||
-           N->getOpcode() == ISD::TargetGlobalAddress;
+           N->getOpcode() == ISD::TargetGlobalAddress ||
+           N->getOpcode() == ISD::GlobalTLSAddress ||
+           N->getOpcode() == ISD::TargetGlobalTLSAddress;
   }
 };
 
-
 class FrameIndexSDNode : public SDNode {
   int FI;
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
@@ -1438,7 +1438,7 @@ protected:
   friend class SelectionDAG;
   LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
              ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
-             const Value *SV, int O=0, unsigned Align=1, bool Vol=false)
+             const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
     : SDNode(ISD::LOAD, VTs),
       AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O),
       Alignment(Align), IsVolatile(Vol) {
@@ -1446,6 +1446,7 @@ protected:
     Ops[1] = ChainPtrOff[1]; // Ptr
     Ops[2] = ChainPtrOff[2]; // Off
     InitOperands(Ops, 3);
+    assert(Align != 0 && "Loads should have non-zero aligment");
     assert((getOffset().getOpcode() == ISD::UNDEF ||
             AddrMode != ISD::UNINDEXED) &&
            "Only indexed load has a non-undef offset operand");
@@ -1508,6 +1509,7 @@ protected:
     Ops[2] = ChainValuePtrOff[2]; // Ptr
     Ops[3] = ChainValuePtrOff[3]; // Off
     InitOperands(Ops, 4);
+    assert(Align != 0 && "Stores should have non-zero aligment");
     assert((getOffset().getOpcode() == ISD::UNDEF || 
             AddrMode != ISD::UNINDEXED) &&
            "Only indexed store has a non-undef offset operand");