From 4b462672d2b4950e5f059bd093db524aa10e8377 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 18 Jan 2011 05:55:27 +0000 Subject: [PATCH] McARM: Use accessors where appropriate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123746 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 1f5f64a3a60..6482087be26 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(Mem.Offset.Value); + const MCConstantExpr *CE = dyn_cast(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(Mem.Offset.Value); + const MCConstantExpr *CE = dyn_cast(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(Mem.Offset.Value); + const MCConstantExpr *CE = dyn_cast(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(Mem.Offset.Value); + Inst.addOperand(MCOperand::CreateReg(getMemBaseRegNum())); + const MCConstantExpr *CE = dyn_cast(getMemOffset()); assert(CE && "Non-constant mode offset operand!"); Inst.addOperand(MCOperand::CreateImm(CE->getValue())); }