Split SwitchSection into SwitchTo{Text|Data}Section methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28184 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp
index 47ed6fc..da2a31e 100644
--- a/lib/Target/Sparc/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/SparcAsmPrinter.cpp
@@ -98,8 +98,8 @@
   CurrentFnName = Mang->getValueName(MF.getFunction());
 
   // Print out labels for the function.
-  O << "\t.text\n";
-  O << "\t.align 16\n";
+  SwitchToTextSection(".text", MF.getFunction());
+  EmitAlignment(4, MF.getFunction());
   O << "\t.globl\t" << CurrentFnName << "\n";
   O << "\t.type\t" << CurrentFnName << ", #function\n";
   O << CurrentFnName << ":\n";
@@ -238,7 +238,7 @@
       if (C->isNullValue() &&
           (I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
            I->hasWeakLinkage() /* FIXME: Verify correct */)) {
-        SwitchSection(".data", I);
+        SwitchToDataSection(".data", I);
         if (I->hasInternalLinkage())
           O << "\t.local " << name << "\n";
 
@@ -253,7 +253,7 @@
         case GlobalValue::WeakLinkage:   // FIXME: Verify correct for weak.
           // Nonnull linkonce -> weak
           O << "\t.weak " << name << "\n";
-          SwitchSection("", I);
+          SwitchToDataSection("", I);
           O << "\t.section\t\".llvm.linkonce.d." << name
             << "\",\"aw\",@progbits\n";
           break;
@@ -267,9 +267,9 @@
           // FALL THROUGH
         case GlobalValue::InternalLinkage:
           if (C->isNullValue())
-            SwitchSection(".bss", I);
+            SwitchToDataSection(".bss", I);
           else
-            SwitchSection(".data", I);
+            SwitchToDataSection(".data", I);
           break;
         case GlobalValue::GhostLinkage:
           std::cerr << "Should not have any unmaterialized functions!\n";