[llvm-commits] [llvm] r75298 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Fri Jul 10 14:57:22 PDT 2009
Author: lattner
Date: Fri Jul 10 16:57:21 2009
New Revision: 75298
URL: http://llvm.org/viewvc/llvm-project?rev=75298&view=rev
Log:
make pcrel and non-pcrel global printing more similar.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=75298&r1=75297&r2=75298&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Fri Jul 10 16:57:21 2009
@@ -107,6 +107,10 @@
const Function *F = dyn_cast<Function>(GV);
if (!F) return;
+ // Save function name for later type emission.
+ if (Subtarget->isTargetCygMing() && F->isDeclaration())
+ CygMingStubs.insert(Name);
+
// We don't want to decorate non-stdcall or non-fastcall functions right now
unsigned CC = F->getCallingConv();
if (CC != CallingConv::X86_StdCall && CC != CallingConv::X86_FastCall)
@@ -319,18 +323,15 @@
O << Name;
}
+ if (needCloseParen)
+ O << ')';
+
// Assemble call via PLT for externally visible symbols.
if (MO.getTargetFlags() == X86II::MO_PLT)
O << "@PLT";
- if (Subtarget->isTargetCygMing() && GV->isDeclaration())
- // Save function name for later type emission
- CygMingStubs.insert(Name);
-
printOffset(MO.getOffset());
- if (needCloseParen)
- O << ')';
return;
}
@@ -413,14 +414,15 @@
}
case MachineOperand::MO_GlobalAddress: {
bool isMemOp = Modifier && !strcmp(Modifier, "mem");
+ if (!isMemOp)
+ O << '$';
+
const GlobalValue *GV = MO.getGlobal();
std::string Name = Mang->getValueName(GV);
decorateName(Name, GV);
bool needCloseParen = false;
- if (!isMemOp)
- O << '$';
- else if (Name[0] == '$') {
+ if (Name[0] == '$') {
// The name begins with a dollar-sign. In order to avoid having it look
// like an integer immediate to the assembler, enclose it in parens.
O << '(';
@@ -438,6 +440,9 @@
MO.getTargetFlags() == X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE){
HiddenGVStubs.insert(Name);
printSuffixedName(Name, "$non_lazy_ptr");
+ } else if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB) {
+ FnStubs.insert(Name);
+ printSuffixedName(Name, "$stub");
} else {
O << Name;
}
@@ -445,6 +450,10 @@
if (needCloseParen)
O << ')';
+ // Assemble call via PLT for externally visible symbols.
+ if (MO.getTargetFlags() == X86II::MO_PLT)
+ O << "@PLT";
+
printOffset(MO.getOffset());
break;
}
@@ -596,8 +605,7 @@
void X86ATTAsmPrinter::printPICJumpTableEntry(const MachineJumpTableInfo *MJTI,
const MachineBasicBlock *MBB,
- unsigned uid) const
-{
+ unsigned uid) const {
const char *JTEntryDirective = MJTI->getEntrySize() == 4 ?
TAI->getData32bitsDirective() : TAI->getData64bitsDirective();
More information about the llvm-commits
mailing list