convert the rest of this over to use SwitchSection


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24448 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index dc12d87..e0bd0de 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -84,11 +84,7 @@
 
   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 @@
     }
 
   if (forDarwin) {
+    SwitchSection("", 0);
     // Output stubs for external global variables
     if (GVStubs.begin() != GVStubs.end())
       O << "\t.non_lazy_symbol_pointer\n";