Can Clang support multi PCH?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can Clang support multi PCH?

kaka
Can Clang support multi PCH?

I find that PreprocessorOption .ImplicitPCHInclude is a String (which store PCH name).
If I change it to vector or something .
store multi PCH    Can Clang support Read and Use these PCH?
Reply | Threaded
Open this post in threaded view
|

Re: Can Clang support multi PCH?

Sebastian Redl

On 05.12.2014 09:21, kaka wrote:
> Can Clang support multi PCH?
That's what the Modules effort is all about.
> I find that PreprocessorOption .ImplicitPCHInclude is a String (which store
> PCH name).
> If I change it to vector or something .
> store multi PCH    Can Clang support Read and Use these PCH?
No, you cannot have multiple PCHs, because PCHs are order-dependent by
definition. Clang supports "chained" PCH files, where one file refers to
another to be used as a prefix, but you still only specify one implicit
PCH include there.

This is not a limitation of Clang's PCHs, it's a fundamental property of
what a PCH is, and how the compilation model of C works.

See the Modules effort for an attempt to introduce something new that
has a different compilation model and thus supports multiple PCH-like files.

http://clang.llvm.org/docs/Modules.html

Sebastian
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re:Re: Can Clang support multi PCH?

kaka






在 2014-12-05 17:07:09,"Sebastian Redl [via Clang Developers]" <[hidden email]> 写道:

On 05.12.2014 09:21, kaka wrote:
> Can Clang support multi PCH?
That's what the Modules effort is all about.
> I find that PreprocessorOption .ImplicitPCHInclude is a String (which store
> PCH name).
> If I change it to vector or something .
> store multi PCH    Can Clang support Read and Use these PCH?
No, you cannot have multiple PCHs, because PCHs are order-dependent by
definition. Clang supports "chained" PCH files, where one file refers to
another to be used as a prefix, but you still only specify one implicit
PCH include there.

This is not a limitation of Clang's PCHs, it's a fundamental property of
what a PCH is, and how the compilation model of C works.

See the Modules effort for an attempt to introduce something new that
has a different compilation model and thus supports multiple PCH-like files.

http://clang.llvm.org/docs/Modules.html

Sebastian
_______________________________________________
Thanks for your reply.
I learned about modules these days.  
I still not sure about the useage of Modules on multi PCHs.
Here is what I thought:
 write the modulemap with all My headers to a .pcm file
 when use the headers in modulemap. .pcm  file will offer the standalone data,
 and will not offer other headers write in modulemap. 
 thus supports multiple PCH-like files?


btw 
 how to use clang dirve  to emit .pcm file      ?  drive do not support -emit-module..
 
 
 






If you reply to this email, your message will be added to the discussion below:
http://clang-developers.42468.n3.nabble.com/Can-Clang-support-multi-PCH-tp4042740p4042742.html
To unsubscribe from Can Clang support multi PCH?, click here.
NAML