<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 18, 2016, at 9:32 AM, David Jones <<a href="mailto:djones@xtreme-eda.com" class="">djones@xtreme-eda.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class="">That was it, thanks.<br class=""><br class=""></div>BTW, I'm likely to be filing a couple of bugs against the Debug Info Verifier. Once I added setSubprogram() in, I got asserts from the verifier for other issues. Once I cleaned those up, I got an assert from the DWARF generator that I traced back to a trivial issue that the verifier could have caught. So:<br class=""><br class=""></div>- The verifier fails to flag the absence of a DISubprogram metadata on a function, even when the DISubprogram metadata is present in the module, and reachable by other means.<br class=""></div>- The verifier fails to flag a DIArray instance whose element type was NULL.<br class=""></div></div></blockquote><div><br class=""></div><div>Please do! I'm *very* interested in making the Verifier stricter. If you can include example IR that (incorrectly) verifies that would be even better.</div><div><br class=""></div><div>-- adrian</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Nov 18, 2016 at 11:50 AM, Adrian Prantl <span dir="ltr" class=""><<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are you perhaps not calling<br class="">
<br class="">
 void Function::setSubprogram (DISubprogram * SP)<br class="">
<br class="">
<a href="http://llvm.org/doxygen/classllvm_1_1Function.html#a05a19abc8ee11d5909275d980efa1670" rel="noreferrer" target="_blank" class="">http://llvm.org/doxygen/<wbr class="">classllvm_1_1Function.html#<wbr class="">a05a19abc8ee11d5909275d980efa1<wbr class="">670</a><br class="">
?<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
-- adrian<br class="">
</font></span><div class="HOEnZb"><div class="h5"><br class="">
> On Nov 18, 2016, at 8:46 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:<br class="">
><br class="">
> (+Adrian who might have some more context here)<br class="">
><br class="">
> Generally I'd suggest looking at Clang's code to see how it's constructing the correct IR - I'm not aware of any particular changes in the timeline after we switched the subprogram edges (which it looks like we had already done in 3.7, judging by the IR  you quoted)... don't have great guesses here.<br class="">
><br class="">
> On Thu, Nov 17, 2016 at 6:46 PM David Jones via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
> I recently upgraded a codebase to use LLVM 3.9.0, up from 3.7.1.<br class="">
><br class="">
> All seems to work well, except that I am unable to generate debug information.<br class="">
><br class="">
> However, if I run objdump -g on the generated object file, it reports that the compile unit has no children:<br class="">
><br class="">
> Contents of the .debug_abbrev section:<br class="">
><br class="">
>   Number TAG (0x0)<br class="">
>    1      DW_TAG_compile_unit    [no children]<br class="">
>     DW_AT_producer     DW_FORM_strp<br class="">
>     DW_AT_language     DW_FORM_data2<br class="">
>     DW_AT_name         DW_FORM_strp<br class="">
>     DW_AT_stmt_list    DW_FORM_sec_offset<br class="">
>     DW_AT value: 0     DW_FORM value: 0<br class="">
><br class="">
> The IR generated for 3.9.0 passes the IR verifier without complaint (including the debug into verifier). I can run llc manually on my IR without complaint. However, I am not able to ascertain whether llc runs the debug info verifier by default.<br class="">
><br class="">
> One of the changes I had to make to get my code to compile was to remove the function argument (of Function* type) from the call to DIBuilder::createFunction(). This appears to be my problem, as my functions do not appear to have debug info:<br class="">
><br class="">
> From my 3.7.1 code:<br class="">
><br class="">
> define void @func(%artype*) #4 !dbg !5 {<br class="">
> !5 = distinct !DISubprogram(n...)<br class="">
><br class="">
> From 3.9.0:<br class="">
><br class="">
> define void @func(%artype*) #4 {<br class="">
><br class="">
> What must I do to attach the DISubprogram metadata node to my Function, assuming this is the problem?<br class="">
><br class="">
> ______________________________<wbr class="">_________________<br class="">
> LLVM Developers mailing list<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class="">
<br class="">
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>