[cfe-dev] Precompiled headers with libclang
Abhanshu Sharma
abhanshu1 at gmail.com
Tue Apr 3 23:57:47 PDT 2012
Douglas,
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?
I don't want clang to check for any changes source headers file but simply
use precompile header file.
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.
On Tue, Apr 3, 2012 at 8:50 PM, Douglas Gregor <dgregor at apple.com> wrote:
>
> On Apr 3, 2012, at 8:18 AM, Abhanshu Sharma wrote:
>
>
>
> On Tue, Apr 3, 2012 at 7:59 PM, Douglas Gregor <dgregor at apple.com> wrote:
>
>>
>> On Apr 3, 2012, at 6:25 AM, Abhanshu Sharma wrote:
>>
>> 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).
>> Is this expected?
>>
>>
>> You'll see libclang stat'ing all of the headers in the precompiled
>> preamble, because it needs to determine whether they have changed.
>>
>> Or libclang is just expected to access preamble file? Is there any case
>> where it can discard contents of preamble file.
>>
>>
>> If the underlying headers change, or the #includes of the source file
>> change, the precompiled preamble will be thrown out and regenerated.
>>
>
> Douglas, is there any debugging information I can generate like - Knowing
> when precompiled preamble is discarded, or what was file which caused it.
>
>
> 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.
>
> - Doug
>
>
--
Warm Regards,
Abhanshu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120404/b73523cd/attachment.html>
More information about the cfe-dev
mailing list