aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/AsmPrinter
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-03 18:06:07 +0000
committerChris Lattner <sabre@nondot.org>2009-08-03 18:06:07 +0000
commit1763766a577a8a239c653936d8036f254d5af62f (patch)
tree106d5cac497bf48391e4cae21f1fffb382480d0a /lib/Target/X86/AsmPrinter
parentd54a6b8c58bf0228b965ab00c7d9e2e87239161f (diff)
downloadexternal_llvm-1763766a577a8a239c653936d8036f254d5af62f.zip
external_llvm-1763766a577a8a239c653936d8036f254d5af62f.tar.gz
external_llvm-1763766a577a8a239c653936d8036f254d5af62f.tar.bz2
eliminate textual section switching from intel asm printer.
This will cause it to enter the ".text" section instead of "_text" but masm is already broken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmPrinter')
-rw-r--r--lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
index 337fc79..64037ae 100644
--- a/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
+++ b/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
@@ -143,7 +143,8 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
decorateName(CurrentFnName, F);
- SwitchToTextSection("_text", F);
+ SwitchToSection(getObjFileLowering().SectionForGlobal(F, Mang, TM));
+
switch (F->getLinkage()) {
default: llvm_unreachable("Unsupported linkage type!");
case Function::PrivateLinkage:
@@ -494,14 +495,14 @@ void X86IntelAsmPrinter::PrintGlobalVariable(const GlobalVariable *GV) {
case GlobalValue::LinkOnceODRLinkage:
case GlobalValue::WeakAnyLinkage:
case GlobalValue::WeakODRLinkage:
- SwitchToDataSection("");
+ SwitchToSection(0);
O << name << "?\tSEGEMNT PARA common 'COMMON'\n";
bCustomSegment = true;
// FIXME: the default alignment is 16 bytes, but 1, 2, 4, and 256
// are also available.
break;
case GlobalValue::AppendingLinkage:
- SwitchToDataSection("");
+ SwitchToSection(0);
O << name << "?\tSEGMENT PARA public 'DATA'\n";
bCustomSegment = true;
// FIXME: the default alignment is 16 bytes, but 1, 2, 4, and 256
@@ -538,7 +539,7 @@ void X86IntelAsmPrinter::PrintGlobalVariable(const GlobalVariable *GV) {
bool X86IntelAsmPrinter::doFinalization(Module &M) {
// Output linker support code for dllexported globals
if (!DLLExportedGVs.empty() || !DLLExportedFns.empty()) {
- SwitchToDataSection("");
+ SwitchToSection(0);
O << "; WARNING: The following code is valid only with MASM v8.x"
<< "and (possible) higher\n"
<< "; This version of MASM is usually shipped with Microsoft "
@@ -548,24 +549,23 @@ bool X86IntelAsmPrinter::doFinalization(Module &M) {
<< "; dllexported symbols in the earlier versions of MASM in fully "
<< "automatic way\n\n";
O << "_drectve\t segment info alias('.drectve')\n";
- }
- for (StringSet<>::iterator i = DLLExportedGVs.begin(),
- e = DLLExportedGVs.end();
- i != e; ++i)
- O << "\t db ' /EXPORT:" << i->getKeyData() << ",data'\n";
+ for (StringSet<>::iterator i = DLLExportedGVs.begin(),
+ e = DLLExportedGVs.end();
+ i != e; ++i)
+ O << "\t db ' /EXPORT:" << i->getKeyData() << ",data'\n";
- for (StringSet<>::iterator i = DLLExportedFns.begin(),
- e = DLLExportedFns.end();
- i != e; ++i)
- O << "\t db ' /EXPORT:" << i->getKeyData() << "'\n";
+ for (StringSet<>::iterator i = DLLExportedFns.begin(),
+ e = DLLExportedFns.end();
+ i != e; ++i)
+ O << "\t db ' /EXPORT:" << i->getKeyData() << "'\n";
- if (!DLLExportedGVs.empty() || !DLLExportedFns.empty())
O << "_drectve\t ends\n";
+ }
// Bypass X86SharedAsmPrinter::doFinalization().
bool Result = AsmPrinter::doFinalization(M);
- SwitchToDataSection("");
+ SwitchToSection(0);
O << "\tend\n";
return Result;
}