[PATCH] D44220: [DWARF] Suppress split line tables more carefully.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 15:36:29 PST 2018


On Wed, Mar 7, 2018 at 12:47 PM Paul Robinson via Phabricator <
reviews at reviews.llvm.org> wrote:

> probinson added inline comments.
>
>
> ================
> Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:301-302
>  unsigned DwarfTypeUnit::getOrCreateSourceID(const DIFile *File) {
> -  return SplitLineTable
> -             ? SplitLineTable->getFile(File->getDirectory(),
> -                                       File->getFilename(),
> -                                       getMD5AsBytes(File),
> -                                       File->getSource())
> -             : getCU().getOrCreateSourceID(File);
> +  if (!SplitLineTable)
> +    return getCU().getOrCreateSourceID(File);
> +  if (!UsedLineTable) {
> ----------------
> dblaikie wrote:
> > 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.
> 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.
>

Yep - still, worth a comment somewhere I'd think.


>
>
> ================
> Comment at: llvm/test/CodeGen/X86/dwarf-split-line-1.ll:36-39
> +!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S",
> size: 32, elements: !7, identifier: "_ZTS1S")
> +!7 = !{!8}
> +!8 = !DIDerivedType(tag: DW_TAG_member, name: "s1", scope: !6, baseType:
> !9, size: 32)
> +!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
> ----------------
> dblaikie wrote:
> > Guessing this is somewhat hand-crafted IR? You could drop the s1 member,
> probably, to simplify this further?
> So the composite type would have no elements?  I suppose that is legal.
>

Yep - "struct foo {};" is valid.


>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D44220
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180307/59244fbe/attachment.html>


More information about the llvm-commits mailing list