[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp
Evan Cheng
evan.cheng at apple.com
Wed Jan 17 17:50:13 PST 2007
Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.91 -> 1.92
X86AsmPrinter.cpp updated: 1.230 -> 1.231
---
Log message:
Minor code clean up.
---
Diffs of the changes: (+21 -18)
X86ATTAsmPrinter.cpp | 37 ++++++++++++++++++++-----------------
X86AsmPrinter.cpp | 2 +-
2 files changed, 21 insertions(+), 18 deletions(-)
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.91 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.92
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.91 Wed Jan 17 04:33:08 2007
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Jan 17 19:49:58 2007
@@ -31,16 +31,15 @@
STATISTIC(EmittedInsts, "Number of machine instrs printed");
-static std::string computePICLabel(unsigned fnNumber,
- const X86Subtarget* Subtarget)
-{
+static std::string computePICLabel(unsigned FnNum,
+ const TargetAsmInfo *TAI,
+ const X86Subtarget* Subtarget) {
std::string label;
-
- if (Subtarget->isTargetDarwin()) {
- label = "\"L" + utostr_32(fnNumber) + "$pb\"";
- } else if (Subtarget->isTargetELF()) {
- label = ".Lllvm$" + utostr_32(fnNumber) + "$piclabel";
- } else
+ if (Subtarget->isTargetDarwin())
+ label = "\"L" + utostr_32(FnNum) + "$pb\"";
+ else if (Subtarget->isTargetELF())
+ label = ".Lllvm$" + utostr_32(FnNum) + "$piclabel";
+ else
assert(0 && "Don't know how to print PIC label!\n");
return label;
@@ -227,7 +226,8 @@
if (TM.getRelocationModel() == Reloc::PIC_) {
if (Subtarget->isPICStyleStub())
- O << "-\"L" << getFunctionNumber() << "$pb\"";
+ O << "-\"" << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
+ << "$pb\"";
else if (Subtarget->isPICStyleGOT())
O << "@GOTOFF";
}
@@ -244,7 +244,8 @@
if (TM.getRelocationModel() == Reloc::PIC_) {
if (Subtarget->isPICStyleStub())
- O << "-\"L" << getFunctionNumber() << "$pb\"";
+ O << "-\"" << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
+ << "$pb\"";
if (Subtarget->isPICStyleGOT())
O << "@GOTOFF";
}
@@ -280,10 +281,10 @@
// Dynamically-resolved functions need a stub for the function.
if (isCallOp && isa<Function>(GV)) {
FnStubs.insert(Name);
- O << "L" << Name << "$stub";
+ O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
} else {
GVStubs.insert(Name);
- O << "L" << Name << "$non_lazy_ptr";
+ O << TAI->getPrivateGlobalPrefix() << Name << "$non_lazy_ptr";
}
} else {
if (GV->hasDLLImportLinkage()) {
@@ -293,7 +294,8 @@
}
if (!isCallOp && TM.getRelocationModel() == Reloc::PIC_)
- O << "-\"L" << getFunctionNumber() << "$pb\"";
+ O << "-\"" << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
+ << "$pb\"";
} else {
if (GV->hasDLLImportLinkage()) {
O << "__imp_";
@@ -346,7 +348,7 @@
Name += MO.getSymbolName();
if (isCallOp && Subtarget->isPICStyleStub()) {
FnStubs.insert(Name);
- O << "L" << Name << "$stub";
+ O << TAI->getPrivateGlobalPrefix() << Name << "$stub";
return;
}
if (!isCallOp) O << '$';
@@ -363,7 +365,8 @@
// piclabel:
// popl %some_register
// addl $_GLOBAL_ADDRESS_TABLE_ + [.-piclabel], %some_register
- O << " + [.-" << computePICLabel(getFunctionNumber(), Subtarget) << "]";
+ O << " + [.-"
+ << computePICLabel(getFunctionNumber(), TAI, Subtarget) << "]";
}
if (isCallOp && Subtarget->isPICStyleGOT())
@@ -440,7 +443,7 @@
}
void X86ATTAsmPrinter::printPICLabel(const MachineInstr *MI, unsigned Op) {
- std::string label = computePICLabel(getFunctionNumber(), Subtarget);
+ std::string label = computePICLabel(getFunctionNumber(), TAI, Subtarget);
O << label << "\n" << label << ":";
}
Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.230 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.231
--- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.230 Wed Jan 17 11:44:25 2007
+++ llvm/lib/Target/X86/X86AsmPrinter.cpp Wed Jan 17 19:49:58 2007
@@ -166,7 +166,7 @@
if (I->hasInternalLinkage()) {
O << TAI->getLCOMMDirective() << name << "," << Size;
if (Subtarget->isTargetDarwin())
- O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align);
+ O << "," << Align;
} else
O << TAI->getCOMMDirective() << name << "," << Size;
} else {
More information about the llvm-commits
mailing list