From 146a310e6612e703fc9fc84483102258e73bcc6f Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 23 Apr 2009 00:57:37 +0000 Subject: [PATCH] Add support for printing MO_ExternalSymbol operands in memory operand tuples. This doesn't ever come up in normal code however. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69848 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 65ce5acb9df..c2b053edd75 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -501,6 +501,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, } case MachineOperand::MO_ExternalSymbol: { bool isCallOp = Modifier && !strcmp(Modifier, "call"); + bool isMemOp = Modifier && !strcmp(Modifier, "mem"); bool needCloseParen = false; std::string Name(TAI->getGlobalPrefix()); Name += MO.getSymbolName(); @@ -511,7 +512,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, printSuffixedName(Name, "$stub"); return; } - if (!isCallOp) + if (!isMemOp && !isCallOp) O << '$'; else if (Name[0] == '$') { // The name begins with a dollar-sign. In order to avoid having it look @@ -577,7 +578,8 @@ void X86ATTAsmPrinter::printLeaMemReference(const MachineInstr *MI, unsigned Op, bool NotRIPRel = IndexReg.getReg() || BaseReg.getReg(); if (DispSpec.isGlobal() || DispSpec.isCPI() || - DispSpec.isJTI()) { + DispSpec.isJTI() || + DispSpec.isSymbol()) { printOperand(MI, Op+3, "mem", NotRIPRel); } else { int DispVal = DispSpec.getImm(); -- 2.34.1