<br><br><div class="gmail_quote">On Fri, Jan 1, 2010 at 5:45 AM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
On Dec 31, 2009, at 11:29 AM, Cristina Basescu wrote:<br>
<br>
> Hi all,<br>
><br>
> I'm trying to find out the file name where a clang::Decl comes from. More precisely, I'd like to see which library a certain function comes from e.g. be able to find out that the definition of printf used in the analyzed program is in stdio.h. I thought using 'const char *getMangledName(const GlobalDecl &D)' from CodeGenModule.h could provide some information, however it seems that CodeGenModule is just used internally and, besides that, one should not count on the mangled names format.<br>
<br>
</div>Try getting a source location from the decl. Given a source location, the SourceManager object can map the location back to a file/line/col for you.<br>
<font color="#888888"><br></font></blockquote><div><br>Thanks, this is indeed the solution.<br><br>Best regards,<br>Cristina <br></div></div><br>