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
This commit is contained in:
Chris Lattner 2010-04-04 23:17:54 +00:00
parent 4ad1efec92
commit be15beb54a

View 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)