From 1bd1e6db1d5ae9ae0f07bef5db355e8a1cf5d5b4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 13 Mar 2010 02:10:00 +0000 Subject: [PATCH] switch to the text section at the start of the .s file for darwin/x86 targets. This is a temporary hack for the .o file writer that Daniel wants :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98413 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 5 +++++ lib/Target/X86/AsmPrinter/X86AsmPrinter.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp index 11ac0baef82..3e5833dfa18 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp @@ -459,6 +459,11 @@ bool X86AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, return false; } +void X86AsmPrinter::EmitStartOfAsmFile(Module &M) { + if (Subtarget->isTargetDarwin()) + OutStreamer.SwitchSection(getObjFileLowering().getTextSection()); +} + void X86AsmPrinter::EmitEndOfAsmFile(Module &M) { if (Subtarget->isTargetDarwin()) { diff --git a/lib/Target/X86/AsmPrinter/X86AsmPrinter.h b/lib/Target/X86/AsmPrinter/X86AsmPrinter.h index eb996a7832b..410bfb7ee17 100644 --- a/lib/Target/X86/AsmPrinter/X86AsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86AsmPrinter.h @@ -55,7 +55,8 @@ class VISIBILITY_HIDDEN X86AsmPrinter : public AsmPrinter { AsmPrinter::getAnalysisUsage(AU); } - + virtual void EmitStartOfAsmFile(Module &M); + virtual void EmitEndOfAsmFile(Module &M); virtual void EmitInstruction(const MachineInstr *MI);