[llvm-commits] [llvm] r47570 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Dan Gohman gohman at apple.com
Mon Feb 25 14:16:29 PST 2008


Author: djg
Date: Mon Feb 25 16:16:29 2008
New Revision: 47570

URL: http://llvm.org/viewvc/llvm-project?rev=47570&view=rev
Log:
Factor the assert for indexed loads/stores out of LoadSDNode
and StoreSDNode into LSBaseSDNode.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=47570&r1=47569&r2=47570&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Mon Feb 25 16:16:29 2008
@@ -1632,6 +1632,8 @@
       Ops[i] = Operands[i];
     InitOperands(Ops, NumOperands);
     assert(Align != 0 && "Loads and stores should have non-zero aligment");
+    assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
+           "Only indexed loads and stores have a non-undef offset operand");
   }
 
   const SDOperand &getChain() const { return getOperand(0); }
@@ -1682,10 +1684,7 @@
              const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
     : LSBaseSDNode(ISD::LOAD, ChainPtrOff, 3,
                    VTs, AM, LVT, SV, O, Align, Vol),
-      ExtType(ETy) {
-    assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
-           "Only indexed loads and stores have a non-undef offset operand");
-  }
+      ExtType(ETy) {}
 public:
 
   ISD::LoadExtType getExtensionType() const { return ExtType; }
@@ -1712,10 +1711,7 @@
               const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
     : LSBaseSDNode(ISD::STORE, ChainValuePtrOff, 4,
                    VTs, AM, SVT, SV, O, Align, Vol),
-      IsTruncStore(isTrunc) {
-    assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
-           "Only indexed loads and stores have a non-undef offset operand");
-  }
+      IsTruncStore(isTrunc) {}
 public:
 
   bool isTruncatingStore() const { return IsTruncStore; }





More information about the llvm-commits mailing list