[cfe-dev] Can Clang support multi PCH?

kaka aamen521 at 163.com
Tue Dec 9 01:58:51 PST 2014








在 2014-12-05 17:07:09,"Sebastian Redl [via Clang Developers]" <ml-node+s42468n4042742h66 at n3.nabble.com> 写道:

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



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Can-Clang-support-multi-PCH-tp4042740p4042818.html
Sent from the Clang Developers mailing list archive at Nabble.com.




More information about the cfe-dev mailing list