only emit section labels if we have debug info, fixing a few
authorChris Lattner <sabre@nondot.org>
Sun, 4 Apr 2010 23:17:54 +0000 (23:17 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 4 Apr 2010 23:17:54 +0000 (23:17 +0000)
regtest failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100366 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 977ab1210d5c685f736245c5117ebe3534818b38..428f14618b6ef5931c684bacb052e97959c2a249 100644 (file)
@@ -1794,9 +1794,10 @@ void DwarfDebug::beginModule(Module *M) {
   DebugInfoFinder DbgFinder;
   DbgFinder.processModule(*M);
 
-  // Emit initial sections
-  EmitSectionLabels();
-
+  // Emit initial sections.
+  if (DbgFinder.compile_unit_begin() != DbgFinder.compile_unit_end())
+    EmitSectionLabels();
+  
   // Create all the compile unit DIEs.
   for (DebugInfoFinder::iterator I = DbgFinder.compile_unit_begin(),
          E = DbgFinder.compile_unit_end(); I != E; ++I)
@@ -1804,7 +1805,7 @@ void DwarfDebug::beginModule(Module *M) {
 
   if (!ModuleCU)
     return;
-
+  
   // Create DIEs for each subprogram.
   for (DebugInfoFinder::iterator I = DbgFinder.subprogram_begin(),
          E = DbgFinder.subprogram_end(); I != E; ++I)