<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 9, 2018 at 9:30 AM 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/include/llvm/MC/MCDwarf.h:56<br>
+  /// The MD5 checksum, if there is one.<br>
+  MD5::MD5Result *Checksum = nullptr;<br>
 };<br>
----------------<br>
aprantl wrote:<br>
> Optional<MD5::MD5Result>?<br>
This is a non-owning pointer to data allocated in MCContext.  Does that change your opinion?  (Or Blaikie's?)<br></blockquote><div><br>Roughly sounds OK to me, with some comments about that (and/or maybe a typedef/opaque handle type or something - and document the ownership where that type is defined)<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/lib/MC/MCParser/AsmParser.cpp:3361<br>
+      Checksum = fromHex(Checksum);<br>
+      assert(Checksum.size() == 16);<br>
+      CKMem = (MD5::MD5Result *)Ctx.allocate(sizeof(MD5::MD5Result), 1);<br>
----------------<br>
aprantl wrote:<br>
> I think I would feel more comfortable with a report_fatal_error on invalid inputs.<br>
Potentially being user input, this ought to be using the check() mechanism instead of an assertion.  Sorry about the brain-lapse here.<br>
<br>
<br>
================<br>
Comment at: llvm/test/MC/ELF/debug-md5.s:4<br>
+        .file 1 "dir1/foo"   md5 "00112233445566778899aabbccddeeff"<br>
+        .file 2 "dir2" "bar" md5 "ffeeddccbbaa99887766554433221100"<br>
+        .loc 1 1 0<br>
----------------<br>
aprantl wrote:<br>
> Just out of curiosity: why did you opt for a string literal instead of a hex numeral? Is there some precedent for that?<br>
I believe .cv_file does it that way (the CodeView version of .file).  IIRC the integer-parsing functions don't have a way to return a 128-bit result.  Handled as a string, I can parse it directly into the allocated MD5Result.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D41846" rel="noreferrer" target="_blank">https://reviews.llvm.org/D41846</a><br>
<br>
<br>
<br>
</blockquote></div></div>