Can Clang support multi PCH?

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?

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

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

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