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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 11:47:36 PST 2018


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


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


================
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)
----------------
Guessing this is somewhat hand-crafted IR? You could drop the s1 member, probably, to simplify this further?


Repository:
  rL LLVM

https://reviews.llvm.org/D44220





More information about the llvm-commits mailing list