<div dir="ltr"><div><div><div><div><div><div><div><div><div>I recently upgraded a codebase to use LLVM 3.9.0, up from 3.7.1.<br><br></div>All seems to work well, except that I am unable to generate debug information.<br></div><br></div>However, if I run objdump -g on the generated object file, it reports that the compile unit has no children:<br><br>Contents of the .debug_abbrev section:<br><br>  Number TAG (0x0)<br>   1      DW_TAG_compile_unit    [no children]<br>    DW_AT_producer     DW_FORM_strp<br>    DW_AT_language     DW_FORM_data2<br>    DW_AT_name         DW_FORM_strp<br>    DW_AT_stmt_list    DW_FORM_sec_offset<br>    DW_AT value: 0     DW_FORM value: 0<br><br></div>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><br></div><div>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><br></div><div>From my 3.7.1 code:<br><br>define void @func(%artype*) #4 !dbg !5 {<br>!5 = distinct !DISubprogram(n...)<br><br></div><div>From 3.9.0:<br><br>define void @func(%artype*) #4 {<br><br></div><div>What must I do to attach the DISubprogram metadata node to my Function, assuming this is the problem?<br><br></div></div></div></div></div></div>