llvm.org GIT mirror llvm / 6ec5620
McARM: Fill in ASMOperand::dump() for memory operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123745 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
1 changed file(s) with 56 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
221221 return Imm.Val;
222222 }
223223
224 /// @name Memory Operand Accessors
225 /// @{
226
227 unsigned getMemBaseRegNum() const {
228 return Mem.BaseRegNum;
229 }
230 unsigned getMemOffsetRegNum() const {
231 assert(Mem.OffsetIsReg && "Invalid access!");
232 return Mem.Offset.RegNum;
233 }
234 const MCExpr *getMemOffset() const {
235 assert(!Mem.OffsetIsReg && "Invalid access!");
236 return Mem.Offset.Value;
237 }
238 unsigned getMemOffsetRegShifted() const {
239 assert(Mem.OffsetIsReg && "Invalid access!");
240 return Mem.OffsetRegShifted;
241 }
242 const MCExpr *getMemShiftAmount() const {
243 assert(Mem.OffsetIsReg && Mem.OffsetRegShifted && "Invalid access!");
244 return Mem.ShiftAmount;
245 }
246 enum ShiftType getMemShiftType() const {
247 assert(Mem.OffsetIsReg && Mem.OffsetRegShifted && "Invalid access!");
248 return Mem.ShiftType;
249 }
250 bool getMemPreindexed() const { return Mem.Preindexed; }
251 bool getMemPostindexed() const { return Mem.Postindexed; }
252 bool getMemOffsetIsReg() const { return Mem.OffsetIsReg; }
253 bool getMemNegative() const { return Mem.Negative; }
254 bool getMemWriteback() const { return Mem.Writeback; }
255
256 /// @}
257
224258 bool isCondCode() const { return Kind == CondCode; }
225259 bool isCCOut() const { return Kind == CCOut; }
226260 bool isImm() const { return Kind == Immediate; }
458492 getImm()->print(OS);
459493 break;
460494 case Memory:
461 OS << ">";
495 OS << " "
496 << "base:" << getMemBaseRegNum();
497 if (getMemOffsetIsReg()) {
498 OS << " offset:
499 if (getMemOffsetRegShifted()) {
500 OS << " offset-shift-type:" << getMemShiftType();
501 OS << " offset-shift-amount:" << *getMemShiftAmount();
502 }
503 } else {
504 OS << " offset:" << *getMemOffset();
505 }
506 if (getMemOffsetIsReg())
507 OS << " (offset-is-reg)";
508 if (getMemPreindexed())
509 OS << " (pre-indexed)";
510 if (getMemPostindexed())
511 OS << " (post-indexed)";
512 if (getMemNegative())
513 OS << " (negative)";
514 if (getMemWriteback())
515 OS << " (writeback)";
516 OS << ">";
462517 break;
463518 case Register:
464519 OS << "";