<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Mar 7, 2018 at 12:47 PM Paul Robinson via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">probinson added inline comments.<br>
<br>
<br>
================<br>
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:301-302<br>
 unsigned DwarfTypeUnit::getOrCreateSourceID(const DIFile *File) {<br>
-  return SplitLineTable<br>
-             ? SplitLineTable->getFile(File->getDirectory(),<br>
-                                       File->getFilename(),<br>
-                                       getMD5AsBytes(File),<br>
-                                       File->getSource())<br>
-             : getCU().getOrCreateSourceID(File);<br>
+  if (!SplitLineTable)<br>
+    return getCU().getOrCreateSourceID(File);<br>
+  if (!UsedLineTable) {<br>
----------------<br>
dblaikie wrote:<br>
> 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.<br>
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.<br></blockquote><div><br>Yep - still, worth a comment somewhere I'd think.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
================<br>
Comment at: llvm/test/CodeGen/X86/dwarf-split-line-1.ll:36-39<br>
+!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", size: 32, elements: !7, identifier: "_ZTS1S")<br>
+!7 = !{!8}<br>
+!8 = !DIDerivedType(tag: DW_TAG_member, name: "s1", scope: !6, baseType: !9, size: 32)<br>
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br>
----------------<br>
dblaikie wrote:<br>
> Guessing this is somewhat hand-crafted IR? You could drop the s1 member, probably, to simplify this further?<br>
So the composite type would have no elements?  I suppose that is legal.<br></blockquote><div><br>Yep - "struct foo {};" is valid.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D44220" rel="noreferrer" target="_blank">https://reviews.llvm.org/D44220</a><br>
<br>
<br>
<br>
</blockquote></div></div>