<div dir="ltr"><div dir="ltr">Hello, <br><br>I am compiling a program with debugging information, and am attempting to extract !dbg numbers from function calls in LLVM IR. However, I've found a few inconsistencies. For example, this call exists in my module: <br><font face="monospace"><br>%1 = tail call i1 @llvm.type.test(i8* bitcast (i32 (i32)* @_Z5otheri to i8*), metadata !"_ZTSFiiE") #5, <b>!dbg !69</b>, !nosanitize !2</font><br><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">I would like to extract the 69 from this line in my LLVM pass, but when I </font><font face="monospace">dump()</font><font face="arial, sans-serif"> the corresponding </font><font face="monospace">CallInst</font><font face="arial, sans-serif">, I see the following: <br><br></font><font face="monospace">%1 = tail call i1 @llvm.type.test(i8* bitcast (i32 (i32)* @_Z5otheri to i8*), metadata !"_ZTSFiiE") #5, <b>!dbg !29</b>, !nosanitize !2<br></font><br>And finally, the line <b>CallInst -> getDebugLoc() -> getLine()</b> returns <b>61</b> for this call, not 69 or 29.<div></div></div><div><br></div><div>Am I misunderstanding the purpose of getDebugLoc() for a CallInst? Is there any way I can extract the correct !dbg for a given line? Thanks for your help!<br><br>Best, <br>Shishir Jessu</div></div>
</div><img src="https://my-email-signature.link/signature.gif?u=452460&e=103509545&v=2963818b9a200211bcb9915dd11393987de0aebacda89486f056a807146e3f39" style="width:2px;max-height:0;overflow:hidden">