Page MenuHomePhabricator

[DWARF] Suppress split line tables more carefully.
ClosedPublic

Authored by probinson on Mar 7 2018, 11:32 AM.

Details

Summary

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.

Diff Detail

Event Timeline

probinson created this revision.Mar 7 2018, 11:32 AM
dblaikie accepted this revision.Mar 7 2018, 11:45 AM
dblaikie added inline comments.
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
301–302

Presumably this could be improved to omit the stmt_list for non-split type units that don't use file names? Maybe a comment suggesting/mentioning that here or elsewhere might be nice.

llvm/test/CodeGen/X86/dwarf-split-line-1.ll
36–39

Guessing this is somewhat hand-crafted IR? You could drop the s1 member, probably, to simplify this further?

This revision is now accepted and ready to land.Mar 7 2018, 11:45 AM
probinson added inline comments.Mar 7 2018, 12:47 PM
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
301–302

If you look at the code I removed from the DwarfTypeUnit ctor, it was adding stmt_list only for split type units. So I am doing the same here. I'm actually not sure where we add the stmt_list for a non-split unit.

llvm/test/CodeGen/X86/dwarf-split-line-1.ll
36–39

So the composite type would have no elements? I suppose that is legal.

This revision was automatically updated to reflect the committed changes.