<br><br><div class="gmail_quote">On Tue, Apr 3, 2012 at 7:59 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On Apr 3, 2012, at 6:25 AM, Abhanshu Sharma wrote:</div><br><blockquote type="cite">I have actually set it 'on' already. But by running strace, I found that libclang is still accessing quite a few headers (Although Number of headers accessed reduced a bit). <div>
Is this expected? </div></blockquote><div><br></div></div><div>You'll see libclang stat'ing all of the headers in the precompiled preamble, because it needs to determine whether they have changed.</div><div class="im">
<br><blockquote type="cite">
<div>Or libclang is just expected to access preamble file? Is there any case where it can discard contents of preamble file.</div></blockquote><div><br></div></div><div>If the underlying headers change, or the #includes of the source file change, the precompiled preamble will be thrown out and regenerated.</div>
</div></div></blockquote><div><br></div><div>Douglas, is there any debugging information I can generate like - Knowing when precompiled preamble is discarded, or what was file which caused it. </div><div><br></div><div>[Apart from using strace to figure out by looking at calls ] </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div><span style="white-space:pre-wrap">    </span>- Doug</div><div class="im">
<br><blockquote type="cite"><div><div class="gmail_quote">On Tue, Apr 3, 2012 at 6:49 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Sent from my iPhone<br>
<div><div><br>
On Apr 3, 2012, at 4:00 AM, Abhanshu Sharma <<a href="mailto:abhanshu1@gmail.com" target="_blank">abhanshu1@gmail.com</a>> wrote:<br>
<br>
> Hi cfe-devs,<br>
><br>
> I have a particular scenario where there is a single changing source C++ file which depends on large number of header files (which are constant). What I want libclang to do is to just reparse this source file and extract rest of information from a single precompiled header file in lieu of those header files.<br>


><br>
> I am able to serialize and deserialize a Translation unit. But I am not able to serialize a TU and use it as a library.  Does .pch files work with libclang?<br>
><br>
> For our needs, we have 1 changing C++ source file and rest everything is constant in very large codebase. And we want to repeatedly invoke code complete or error checks on these. Is this setup possible with libclang?<br>


<br>
</div></div>Just turn on precompiled preambles in libclang. After the first reparse, libclang will automatically create a PCH file for the headers at the top of your source file and use it for subsequent reparses and code completions.<br>


<span><font color="#888888"><br>
> --<br>
> Regards,<br>
> Abhanshu<br>
> _______________________________________________<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/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Warm Regards,<br>Abhanshu<br>
</div>
</blockquote></div></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Warm Regards,<br>Abhanshu<br>