minor cleanups to LSBaseSDNode.
authorChris Lattner <sabre@nondot.org>
Fri, 22 Feb 2008 01:54:35 +0000 (01:54 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 22 Feb 2008 01:54:35 +0000 (01:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47469 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h

index bffcfb245e18bf2add168602798cef341aee2138..d47e0a69a7dd9d60614afb47f71c1930495a9d86 100644 (file)
@@ -1353,7 +1353,7 @@ protected:
   }
 public:
     
-    int getIndex() const { return JTI; }
+  int getIndex() const { return JTI; }
   
   static bool classof(const JumpTableSDNode *) { return true; }
   static bool classof(const SDNode *N) {
@@ -1615,29 +1615,17 @@ public:
                const Value *SV, int SVO, unsigned Align, bool Vol)
     : SDNode(NodeTy, VTs),
       AddrMode(AM), MemoryVT(VT),
-      SrcValue(SV), SVOffset(SVO), Alignment(Align), IsVolatile(Vol)
-  {
+      SrcValue(SV), SVOffset(SVO), Alignment(Align), IsVolatile(Vol) {
     for (unsigned i = 0; i != NumOperands; ++i)
       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);
-  }
-  const SDOperand getBasePtr() const {
+  const SDOperand &getChain() const { return getOperand(0); }
+  const SDOperand &getBasePtr() const {
     return getOperand(getOpcode() == ISD::LOAD ? 1 : 2);
   }
-  const SDOperand getOffset() const {
-    return getOperand(getOpcode() == ISD::LOAD ? 2 : 3);
-  }
-  const SDOperand getValue() const {
-    assert(getOpcode() == ISD::STORE);
-    return getOperand(1);
-  }
 
   const Value *getSrcValue() const { return SrcValue; }
   int getSrcValueOffset() const { return SVOffset; }
@@ -1679,10 +1667,15 @@ protected:
              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) { }
+      ExtType(ETy) {
+    assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
+           "Only indexed loads and stores have a non-undef offset operand");
+  }
 public:
 
   ISD::LoadExtType getExtensionType() const { return ExtType; }
+  const SDOperand &getBasePtr() const { return getOperand(1); }
+  const SDOperand &getOffset() const { return getOperand(2); }
   
   static bool classof(const LoadSDNode *) { return true; }
   static bool classof(const SDNode *N) {
@@ -1704,10 +1697,16 @@ protected:
               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) { }
+      IsTruncStore(isTrunc) {
+    assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
+           "Only indexed loads and stores have a non-undef offset operand");
+  }
 public:
 
   bool isTruncatingStore() const { return IsTruncStore; }
+  const SDOperand &getValue() const { return getOperand(1); }
+  const SDOperand &getBasePtr() const { return getOperand(2); }
+  const SDOperand &getOffset() const { return getOperand(3); }
   
   static bool classof(const StoreSDNode *) { return true; }
   static bool classof(const SDNode *N) {