<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 23, 2014 at 2:49 PM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com" target="_blank">doob@me.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 2014-01-23 20:19, Sean Silva wrote:<br>

<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
By what file it is declared in? How else would you determine this? You<br>
can get the complete file path of the containing file with<br>
<<a href="http://clang.llvm.org/doxygen/classclang_1_1SourceManager.html#a1b7402699ef496ecc9b2db28a83f0c1b" target="_blank">http://clang.llvm.org/<u></u>doxygen/classclang_1_<u></u>1SourceManager.html#<u></u>a1b7402699ef496ecc9b2db28a83f0<u></u>c1b</a>>.<br>

</blockquote>
<br></div>
Say I have these four files, in three different libraries:<br>
<br>
// /home/foo/libcollection/<u></u>include/collection/list/list.h<br>
struct List;<br>
<br>
// /home/foo/libnet/include/net/<u></u>socket.h<br>
struct Socket;<br>
<br>
// /home/foo/libmain/include/<u></u>util/sub.h<br>
struct Sub;<br>
<br>
// /home/foo/libmain/include/<u></u>umbrella.h<br>
#include "collection/list/list.h"<br>
#include "net/socket.h"<br>
#include "util/sub.h"<br>
<br>
Here I'm interested in translating the file "umbrella.h". The preprocessor will concatenate all files to something like this:<br>
<br>
// main_prepocessed.h<br>
struct List;<br>
struct Socket;<br>
struct Sub;<br>
<br>
I assume I will get back the full path to where these declarations originates from. How do I then know that Sub is part of libmain and is a sub header. And how do I know that List and Socket is not part of libmain?</blockquote>
<div><br></div><div>There is no main_preprocessed.h as far as clang is concerned (unless you manually create it, but then clang leaves #line's to keep track of where things are from).</div><div><br></div><div>If you look at the SourceLocation for `struct List`, it will tell you that the declaration is in `/home/foo/libcollection/<u></u>include/collection/list/list.h`.</div>
<div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">
<div class="h5"><br>
<br>
-- <br>
/Jacob Carlborg<br>
<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>