Douglas, <div><br></div><div>I am exploring one more possibility. Is it possible for clang to just use precompile header file (without corresponding source header files available) to do its work? </div><div>I don't want clang to check for any changes source headers file but simply use precompile header file. </div>
<div><br></div><div>If this is possible, I can create a single pch file for the source file and can quickly move setup across machines. This would be similar to .jars in java world.</div><div><br><div class="gmail_quote">
On Tue, Apr 3, 2012 at 8:50 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"><div class="im"><br><div><div>On Apr 3, 2012, at 8:18 AM, Abhanshu Sharma wrote:</div><br><blockquote type="cite"><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" 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">
<div style="word-wrap:break-word"><br><div><div><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>
<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></blockquote><br>
</div></div><div>Set the environment variable LIBCLANG_TIMING to get some timing data, which will say when (but not why) the precompiled preamble is (re)built. For any more information than that, you'll have to modify Clang itself.</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>- Doug</div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Warm Regards,<br>Abhanshu<br>
</div>