diff options
author | Paul Robinson <paul.robinson@sony.com> | 2018-03-27 21:28:59 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2018-03-27 21:28:59 +0000 |
commit | 7cb26ad2ef0714b010269d92eb5570f6a1b619df (patch) | |
tree | 0b8c5949be20c7b3a899e28bbfbf2c6d3af6a24a /llvm/lib/MC/MCDwarf.cpp | |
parent | 01bfd6c4e5c48d8f3997f12103735161e8bd09cc (diff) | |
download | bcm5719-llvm-7cb26ad2ef0714b010269d92eb5570f6a1b619df.tar.gz bcm5719-llvm-7cb26ad2ef0714b010269d92eb5570f6a1b619df.zip |
[DWARF] Suppress split line tables more carefully.
If a given split type unit does not have source locations, don't have
it refer to the split line table.
If no split type unit refers to the split line table, don't emit the
line table at all.
This will save a little space on rare occasions, but also refactors
things a bit to improve which class is responsible for what.
Responding to review comments on r326395.
Differential Revision: https://reviews.llvm.org/D44220
llvm-svn: 328670
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 685b46a606d..2da69fe1e4e 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -257,9 +257,12 @@ void MCDwarfLineTable::Emit(MCObjectStreamer *MCOS, LineStr->emitSection(MCOS); } -void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, - MCDwarfLineTableParams Params) const { +void MCDwarfDwoLineTable::Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params, + MCSection *Section) const { + if (Header.MCDwarfFiles.empty()) + return; Optional<MCDwarfLineStr> NoLineStr(None); + MCOS.SwitchSection(Section); MCOS.EmitLabel(Header.Emit(&MCOS, Params, None, NoLineStr).second); } |