aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-01-18 05:55:27 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-01-18 05:55:27 +0000
commit4b462672d2b4950e5f059bd093db524aa10e8377 (patch)
tree0e134115051fa77fef54d115163c54e15dee78e6 /lib/Target/ARM
parent6ec56204f372df73e4a27085b188a72548b867ac (diff)
downloadexternal_llvm-4b462672d2b4950e5f059bd093db524aa10e8377.zip
external_llvm-4b462672d2b4950e5f059bd093db524aa10e8377.tar.gz
external_llvm-4b462672d2b4950e5f059bd093db524aa10e8377.tar.bz2
McARM: Use accessors where appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 1f5f64a..6482087 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -266,11 +266,11 @@ public:
bool isToken() const { return Kind == Token; }
bool isMemory() const { return Kind == Memory; }
bool isMemMode5() const {
- if (!isMemory() || Mem.OffsetIsReg || Mem.OffsetRegShifted ||
- Mem.Writeback || Mem.Negative)
+ if (!isMemory() || getMemOffsetIsReg() || getMemWriteback() ||
+ getMemNegative())
return false;
- const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Mem.Offset.Value);
+ const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getMemOffset());
if (!CE) return false;
// The offset must be a multiple of 4 in the range 0-1020.
@@ -278,15 +278,15 @@ public:
return ((Value & 0x3) == 0 && Value <= 1020 && Value >= -1020);
}
bool isMemModeRegThumb() const {
- if (!isMemory() || !Mem.OffsetIsReg || Mem.Writeback)
+ if (!isMemory() || !getMemOffsetIsReg() || getMemWriteback())
return false;
return true;
}
bool isMemModeImmThumb() const {
- if (!isMemory() || Mem.OffsetIsReg || Mem.Writeback)
+ if (!isMemory() || getMemOffsetIsReg() || getMemWriteback())
return false;
- const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Mem.Offset.Value);
+ const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getMemOffset());
if (!CE) return false;
// The offset must be a multiple of 4 in the range 0-124.
@@ -345,12 +345,12 @@ public:
void addMemMode5Operands(MCInst &Inst, unsigned N) const {
assert(N == 2 && isMemMode5() && "Invalid number of operands!");
- Inst.addOperand(MCOperand::CreateReg(Mem.BaseRegNum));
- assert(!Mem.OffsetIsReg && "Invalid mode 5 operand");
+ Inst.addOperand(MCOperand::CreateReg(getMemBaseRegNum()));
+ assert(!getMemOffsetIsReg() && "Invalid mode 5 operand");
// FIXME: #-0 is encoded differently than #0. Does the parser preserve
// the difference?
- const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Mem.Offset.Value);
+ const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getMemOffset());
assert(CE && "Non-constant mode 5 offset operand!");
// The MCInst offset operand doesn't include the low two bits (like
@@ -366,14 +366,14 @@ public:
void addMemModeRegThumbOperands(MCInst &Inst, unsigned N) const {
assert(N == 2 && isMemModeRegThumb() && "Invalid number of operands!");
- Inst.addOperand(MCOperand::CreateReg(Mem.BaseRegNum));
- Inst.addOperand(MCOperand::CreateReg(Mem.Offset.RegNum));
+ Inst.addOperand(MCOperand::CreateReg(getMemBaseRegNum()));
+ Inst.addOperand(MCOperand::CreateReg(getMemOffsetRegNum()));
}
void addMemModeImmThumbOperands(MCInst &Inst, unsigned N) const {
assert(N == 2 && isMemModeImmThumb() && "Invalid number of operands!");
- Inst.addOperand(MCOperand::CreateReg(Mem.BaseRegNum));
- const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Mem.Offset.Value);
+ Inst.addOperand(MCOperand::CreateReg(getMemBaseRegNum()));
+ const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getMemOffset());
assert(CE && "Non-constant mode offset operand!");
Inst.addOperand(MCOperand::CreateImm(CE->getValue()));
}