diff options
author | Nate Begeman <natebegeman@mac.com> | 2005-07-12 01:37:28 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2005-07-12 01:37:28 +0000 |
commit | 73213f6c07afc1479f8d7bf53ea99adf7fd60b78 (patch) | |
tree | 9ff031b677d42b7187ba2b1931c1d5b91b2ba225 | |
parent | a3efca16f2688981672deeb718909cf6acbe474e (diff) |
Commit some pending darwin changes before subtarget support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22388 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-x | lib/Target/X86/X86ATTAsmPrinter.cpp | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 21 |
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp index 21069905a6..39a82ad4fe 100755 --- a/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -53,7 +53,8 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { printMachineInstruction(II); } } - O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n"; + if (!forDarwin) + O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n"; // We didn't modify anything. return false; diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 9f09885220..17752b9652 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -58,6 +58,7 @@ bool X86SharedAsmPrinter::doInitialization(Module& M) { leadingUnderscore = false; #endif } + if (leadingUnderscore || forCygwin || forDarwin) GlobalPrefix = "_"; @@ -159,6 +160,16 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) { } if (forDarwin) { + // Output stubs for external global variables + if (GVStubs.begin() != GVStubs.end()) + O << "\t.non_lazy_symbol_pointer\n"; + for (std::set<std::string>::iterator i = GVStubs.begin(), e = GVStubs.end(); + i != e; ++i) { + O << "L" << *i << "$non_lazy_ptr:\n"; + O << "\t.indirect_symbol " << *i << "\n"; + O << "\t.long\t0\n"; + } + // Output stubs for dynamically-linked functions unsigned j = 1; for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end(); @@ -178,16 +189,6 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) { O << "\n"; - // Output stubs for external global variables - if (GVStubs.begin() != GVStubs.end()) - O << ".data\n.non_lazy_symbol_pointer\n"; - for (std::set<std::string>::iterator i = GVStubs.begin(), e = GVStubs.end(); - i != e; ++i) { - O << "L" << *i << "$non_lazy_ptr:\n"; - O << "\t.indirect_symbol " << *i << "\n"; - O << "\t.long\t0\n"; - } - // Output stubs for link-once variables if (LinkOnceStubs.begin() != LinkOnceStubs.end()) O << ".data\n.align 2\n"; |