<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></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 3, 2015, at 8:26 AM, Hui Zhang via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:georgia,serif;font-size:large">Hello,</div><div class="gmail_default" style="font-family:georgia,serif;font-size:large"><br class=""></div><div class="gmail_default" style="font-family:georgia,serif;font-size:large">For some reason,  I have to stick on llvm 3.3 for a language compiler, I find that the location debug info is attached to each instruction using !dbg, however, I found some of that information is mis-attched and need to be changed, so I want to <b class="">know what functions(I checked all funcs in DIBuilder.h but didn't find a appropriate one) are used to attach those !dbg nodes to each instruction ?</b> It would be even better if you can points to the places that clang uses to create those nodes.</div><div class="gmail_default" style="font-family:georgia,serif;font-size:large"><br class=""></div></div></div></blockquote><div><br class=""></div><div>Have a look at IRBuilder instead:</div><div><br class=""></div><div><table class="memberdecls" style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 13px; line-height: 1.3; border-spacing: 0px; padding: 0px; color: rgb(0, 0, 0);"><tbody class=""><tr class=""><td class="memItemLeft" align="right" valign="top" style="background-color: rgb(249, 250, 252); border-style: solid none none; border-top-width: 1px; border-top-color: rgb(196, 207, 229); margin: 4px; padding: 1px 0px 0px 8px; white-space: nowrap;">void </td><td class="memItemRight" valign="bottom" style="background-color: rgb(249, 250, 252); border-style: solid none none; border-top-width: 1px; border-top-color: rgb(196, 207, 229); margin: 4px; padding: 1px 0px 0px 8px; width: 1286px;"><a class="el" href="http://llvm.org/doxygen/classllvm_1_1IRBuilderBase.html#a63fc74646456a3bed261512f21efe29c" style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: none;">SetCurrentDebugLocation</a> (<a class="el" href="http://llvm.org/doxygen/classllvm_1_1DebugLoc.html" style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: none;">DebugLoc</a> L)</td></tr><tr class=""><td class="mdescLeft" style="background-color: rgb(249, 250, 252); border: none; margin: 4px; padding: 0px 8px 4px; color: rgb(85, 85, 85);"> </td><td class="mdescRight" style="background-color: rgb(249, 250, 252); border: none; margin: 4px; padding: 0px 8px 4px; color: rgb(85, 85, 85);">Set location information used by debugging information.  <a href="http://llvm.org/doxygen/classllvm_1_1IRBuilderBase.html#a63fc74646456a3bed261512f21efe29c" style="color: rgb(70, 101, 162); text-decoration: none;" class=""></a><br class=""></td></tr><tr class=""><td class="memItemLeft" align="right" valign="top" style="background-color: rgb(249, 250, 252); border-style: solid none none; border-top-width: 1px; border-top-color: rgb(196, 207, 229); margin: 4px; padding: 1px 0px 0px 8px; white-space: nowrap;"><a class="el" href="http://llvm.org/doxygen/AArch64PromoteConstant_8cpp.html#a90f8350fecae261c25be85d38b451bff" style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: none;">const</a> <a class="el" href="http://llvm.org/doxygen/classllvm_1_1DebugLoc.html" style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: none;">DebugLoc</a> & </td><td class="memItemRight" valign="bottom" style="background-color: rgb(249, 250, 252); border-style: solid none none; border-top-width: 1px; border-top-color: rgb(196, 207, 229); margin: 4px; padding: 1px 0px 0px 8px; width: 1286px;"><a class="el" href="http://llvm.org/doxygen/classllvm_1_1IRBuilderBase.html#a2514366416ab188b68243c19a765603e" style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: none;">getCurrentDebugLocation</a> () <a class="el" href="http://llvm.org/doxygen/AArch64PromoteConstant_8cpp.html#a90f8350fecae261c25be85d38b451bff" style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: none;">const</a></td></tr><tr class=""><td class="mdescLeft" style="background-color: rgb(249, 250, 252); border: none; margin: 4px; padding: 0px 8px 4px; color: rgb(85, 85, 85);"> </td><td class="mdescRight" style="background-color: rgb(249, 250, 252); border: none; margin: 4px; padding: 0px 8px 4px; color: rgb(85, 85, 85);">Get location information used by debugging information. </td></tr></tbody></table><div class=""><br class=""></div><div class="">-- adrian</div><div class=""><br class=""></div><div class="">PS: Isn’t it nice how we consistently name accessor functions?</div></div></div><br class=""></body></html>