aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-22 01:54:35 +0000
committerChris Lattner <sabre@nondot.org>2008-02-22 01:54:35 +0000
commit2cf7bce2bb939088cfb6e939aea86122b107185d (patch)
treea04d15c333f2cf84aa3fecf9255aeb2b8fc7c499 /include
parent1d19abe0af2e96d4cb7853fd5964128ac905b0a2 (diff)
downloadexternal_llvm-2cf7bce2bb939088cfb6e939aea86122b107185d.zip
external_llvm-2cf7bce2bb939088cfb6e939aea86122b107185d.tar.gz
external_llvm-2cf7bce2bb939088cfb6e939aea86122b107185d.tar.bz2
minor cleanups to LSBaseSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index bffcfb2..d47e0a6 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -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) {