summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 23:17:54 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 23:17:54 +0000
commitbe15beb54ace72508cb3e597c1819132bbbe66f1 (patch)
treead11fc148d19f0f2a0b8d87df3ada7df63412e42 /lib/CodeGen
parent4ad1efec925f36cb5ab461fc3c7e40baaf70ae1a (diff)
downloadexternal_llvm-be15beb54ace72508cb3e597c1819132bbbe66f1.zip
external_llvm-be15beb54ace72508cb3e597c1819132bbbe66f1.tar.gz
external_llvm-be15beb54ace72508cb3e597c1819132bbbe66f1.tar.bz2
only emit section labels if we have debug info, fixing a few
regtest failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 977ab12..428f146 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -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)