From: Daniel Dunbar Date: Fri, 14 Aug 2009 03:42:12 +0000 (+0000) Subject: Add X86 instruction printer support for printing MCValue operands. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=61466c50df9d00c4a07b1fd72536399cfb418ebd;p=oota-llvm.git 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 --- 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() ||