Don't emit .dwo sections unless they exist.

llvm-svn: 181224
This commit is contained in:
Eric Christopher 2013-05-06 17:50:42 +00:00
parent dbbcaf31b6
commit 92f3c0b49c
1 changed files with 32 additions and 26 deletions

View File

@ -110,17 +110,22 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
}
if (DumpType == DIDT_All || DumpType == DIDT_AbbrevDwo) {
const DWARFDebugAbbrev *D = getDebugAbbrevDWO();
if (D) {
OS << "\n.debug_abbrev.dwo contents:\n";
getDebugAbbrevDWO()->dump(OS);
}
}
if (DumpType == DIDT_All || DumpType == DIDT_InfoDwo) {
if (DumpType == DIDT_All || DumpType == DIDT_InfoDwo)
if (getNumDWOCompileUnits()) {
OS << "\n.debug_info.dwo contents:\n";
for (unsigned i = 0, e = getNumDWOCompileUnits(); i != e; ++i)
getDWOCompileUnitAtIndex(i)->dump(OS);
}
if (DumpType == DIDT_All || DumpType == DIDT_StrDwo) {
if (DumpType == DIDT_All || DumpType == DIDT_StrDwo)
if (!getStringDWOSection().empty()) {
OS << "\n.debug_str.dwo contents:\n";
DataExtractor strDWOData(getStringDWOSection(), isLittleEndian(), 0);
offset = 0;
@ -131,7 +136,8 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
}
}
if (DumpType == DIDT_All || DumpType == DIDT_StrOffsetsDwo) {
if (DumpType == DIDT_All || DumpType == DIDT_StrOffsetsDwo)
if (!getStringOffsetDWOSection().empty()) {
OS << "\n.debug_str_offsets.dwo contents:\n";
DataExtractor strOffsetExt(getStringOffsetDWOSection(), isLittleEndian(), 0);
offset = 0;