From 61466c50df9d00c4a07b1fd72536399cfb418ebd Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 14 Aug 2009 03:42:12 +0000 Subject: [PATCH] Add X86 instruction printer support for printing MCValue operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78984 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp index 34908dae298..52950aa323b 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp @@ -55,6 +55,8 @@ void X86ATTAsmPrinter::print_pcrel_imm(const MCInst *MI, unsigned OpNo) { if (Op.isImm()) O << Op.getImm(); + else if (Op.isMCValue()) + Op.getMCValue().print(O); else if (Op.isMBBLabel()) // FIXME: Keep in sync with printBasicBlockLabel. printBasicBlockLabel // should eventually call into this code, not the other way around. @@ -88,6 +90,10 @@ void X86ATTAsmPrinter::printOperand(const MCInst *MI, unsigned OpNo, O << '$'; O << Op.getImm(); return; + } else if (Op.isMCValue()) { + O << '$'; + Op.getMCValue().print(O); + return; } O << "<>"; @@ -103,6 +109,8 @@ void X86ATTAsmPrinter::printLeaMemReference(const MCInst *MI, unsigned Op) { int64_t DispVal = DispSpec.getImm(); if (DispVal || (!IndexReg.getReg() && !BaseReg.getReg())) O << DispVal; + } else if (DispSpec.isMCValue()) { + DispSpec.getMCValue().print(O); } else { llvm_unreachable("non-immediate displacement for LEA?"); //assert(DispSpec.isGlobal() || DispSpec.isCPI() || -- 2.34.1