OSDN Git Service

Make the masm codepath work like the normal code path.
authorChris Lattner <sabre@nondot.org>
Tue, 9 May 2006 05:15:58 +0000 (05:15 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 9 May 2006 05:15:58 +0000 (05:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28188 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp

index 242a4fb..28ff772 100644 (file)
@@ -79,7 +79,8 @@ void AsmPrinter::SwitchToTextSection(const char *NewSection,
       if (!CurrentSection.empty())
         O << CurrentSection << "\tends\n\n";
       CurrentSection = NS;
-      O << CurrentSection << "\tsegment 'CODE'\n";
+      if (!CurrentSection.empty())
+        O << CurrentSection << "\tsegment 'CODE'\n";
     }
   } else {
     if (GV && GV->hasSection())
@@ -115,7 +116,8 @@ void AsmPrinter::SwitchToDataSection(const char *NewSection,
       if (!CurrentSection.empty())
         O << CurrentSection << "\tends\n\n";
       CurrentSection = NS;
-      O << CurrentSection << "\tsegment 'DATA'\n";
+      if (!CurrentSection.empty())
+        O << CurrentSection << "\tsegment 'DATA'\n";
     }
   } else {
     if (GV && GV->hasSection())