diff options
| author | Dan Gohman <gohman@apple.com> | 2008-02-25 22:16:29 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-02-25 22:16:29 +0000 |
| commit | 8c7a9228de57649eb07600d425b505aedb2061b4 (patch) | |
| tree | 33e7ec41e6f29670c8d95ba168de935ffc89c50e | |
| parent | 0be2f3b941ba529a1af1d4ff5e245c59feb2187e (diff) | |
| download | bcm5719-llvm-8c7a9228de57649eb07600d425b505aedb2061b4.tar.gz bcm5719-llvm-8c7a9228de57649eb07600d425b505aedb2061b4.zip | |
Factor the assert for indexed loads/stores out of LoadSDNode
and StoreSDNode into LSBaseSDNode.
llvm-svn: 47570
| -rw-r--r-- | llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h index 64c9fe3988e..56645f708eb 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1632,6 +1632,8 @@ public: 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 @@ 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) { - 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 @@ 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) { - 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; } |

