mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:54:41 +01:00
Create a Clang module per Carbon file. (#7594)
This isolates the C++ imports in different Carbon files from each other in `--share-cpp-ast` mode, so that a Carbon file can only see the portions of the shared Clang `ASTContext` that it actually imported. Assisted-by: Gemini via Antigravity
This commit is contained in:
@@ -100,6 +100,10 @@ auto BuildClangInvocation(Diagnostics::Consumer& consumer,
|
||||
}
|
||||
|
||||
if (invocation) {
|
||||
// Track submodule visibility in the preprocessor and Sema.
|
||||
invocation->getLangOpts().Modules = true;
|
||||
invocation->getLangOpts().ModulesLocalVisibility = true;
|
||||
|
||||
// Do not emit Clang's name and version as the creator of the output file.
|
||||
invocation->getCodeGenOpts().EmitVersionIdentMetadata = false;
|
||||
invocation->getCodeGenOpts().DiscardValueNames = false;
|
||||
|
||||
Reference in New Issue
Block a user