convert the rest of this over to use SwitchSection
authorChris Lattner <sabre@nondot.org>
Mon, 21 Nov 2005 07:16:34 +0000 (07:16 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Nov 2005 07:16:34 +0000 (07:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24448 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ATTAsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86IntelAsmPrinter.cpp

index 70332a38a23adefe69d7a9e3c5dabcda7be986f7..dd0da7d2e30ef5d601bac82a0abc5147975d5380 100755 (executable)
@@ -32,7 +32,7 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   printConstantPool(MF.getConstantPool());
 
   // Print out labels for the function.
-  O << "\t.text\n";
+  SwitchSection("\t.text\n", MF.getFunction());
   emitAlignment(4);     // FIXME: This should be parameterized somewhere.
   O << "\t.globl\t" << CurrentFnName << "\n";
   if (!forCygwin && !forDarwin)
index dc12d87d96b0bf7eddee0af2d7b23aee781fe954..e0bd0de6c86e87ef183b31b309445ae9bbf5f33e 100644 (file)
@@ -84,11 +84,7 @@ void X86SharedAsmPrinter::printConstantPool(MachineConstantPool *MCP) {
 
   if (CP.empty()) return;
 
-  if (forDarwin) {
-    O << "\t.const\n";
-  } else {
-    O << "\t.section .rodata\n";
-  }
+  SwitchSection(forDarwin ? "\t.const\n" : "\t.section .rodata\n", 0);
   
   for (unsigned i = 0, e = CP.size(); i != e; ++i) {
     // FIXME: force doubles to be naturally aligned.  We should handle this
@@ -168,6 +164,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
     }
 
   if (forDarwin) {
+    SwitchSection("", 0);
     // Output stubs for external global variables
     if (GVStubs.begin() != GVStubs.end())
       O << "\t.non_lazy_symbol_pointer\n";
index a9d7c63ccda8ca409d1b51c6a658cf61ecc63a78..71dc0b2821a983b6548b2234c61678e30dbd792e 100755 (executable)
@@ -32,7 +32,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   printConstantPool(MF.getConstantPool());
 
   // Print out labels for the function.
-  O << "\t.text\n";
+  SwitchSection("\t.text\n", MF.getFunction());
   emitAlignment(4);
   O << "\t.globl\t" << CurrentFnName << "\n";
   if (!forCygwin && !forDarwin)