<div dir="ltr">You'd have to get IR from somewhere that has attached debug info - such as clang -g</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 12, 2021 at 1:22 PM Bella V <<a href="mailto:bellavistaghome@gmail.com">bellavistaghome@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Do we have to initially attach some metadata to the Value? Because in function pass, when I do F.getAllMetadata(MDs), i do not see any metadata appending to MDS. <div>F.hasMetadata() also returns false. What would be the way to get debugLoc in these scenario?<div><br></div><div>Thanks and Regards.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 11, 2021 at 6:31 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 11, 2021 at 4:33 PM Ayush Mittal via cfe-users <<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello Cfe Users,<div><br><div>Could you please point to an effective way to get Source Location details from an IR code. </div><div>From the documentation, I think this could be a way:</div><div>Function Pass-> LLVM Value-> MDN-><span style="color:rgb(0,0,0);font-family:-apple-system,"Segoe UI","Segoe UI Emoji",sans-serif,Meiryo;font-size:14px">DILocation-> Source Location.</span></div></div></div></blockquote><div><br>Yep, that's about it (I mean, you can do it in a pass, or not - but  yes, find an llvm::Value and get the debugLoc from that)<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Please include any example if the above approach is correct too.</div><div><br></div><div>Thanks and Regards.</div></div></div>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@lists.llvm.org" target="_blank">cfe-users@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users</a><br>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>