print section info
authorChris Lattner <sabre@nondot.org>
Sat, 12 Nov 2005 00:10:19 +0000 (00:10 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 12 Nov 2005 00:10:19 +0000 (00:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24313 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index e770ea855f11ae0195a6a06a1c91831f592f934a..ecdc521457f68ddc9261f1a8059e213a00ac07d6 100644 (file)
@@ -833,10 +833,11 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
     writeOperand(GV->getInitializer(), false, isa<GlobalValue>(C));
   }
   
-  if (GV->getAlignment()) {
+  if (GV->hasSection())
+    Out << ", section \"" << GV->getSection() << '"';
+  if (GV->getAlignment())
     Out << ", align " << GV->getAlignment();
-  }
-
+  
   printInfoComment(*GV);
   Out << "\n";
 }
@@ -944,9 +945,11 @@ void AssemblyWriter::printFunction(const Function *F) {
   }
   Out << ')';
 
+  if (F->hasSection())
+    Out << " section \"" << F->getSection() << '"';
   if (F->getAlignment())
     Out << " align " << F->getAlignment();
-  
+
   if (F->isExternal()) {
     Out << "\n";
   } else {