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

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 12:47:22 PST 2018


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.


================
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D44220





More information about the llvm-commits mailing list