diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-23 00:57:37 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-23 00:57:37 +0000 |
commit | 146a310e6612e703fc9fc84483102258e73bcc6f (patch) | |
tree | 6a5cf2b437811571989312a2e89fa92c55c9b494 /lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | |
parent | ab192b71a63ddf96b1528bc1e80d21b2aa8656a8 (diff) | |
download | external_llvm-146a310e6612e703fc9fc84483102258e73bcc6f.zip external_llvm-146a310e6612e703fc9fc84483102258e73bcc6f.tar.gz external_llvm-146a310e6612e703fc9fc84483102258e73bcc6f.tar.bz2 |
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
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 65ce5ac..c2b053e 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(); |