-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Explicit Module Builds] Add 'ClangImporter' setting for explicitly-built modules #65869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Explicit Module Builds] Add 'ClangImporter' setting for explicitly-built modules #65869
Conversation
We do not really want to support Swift explicit modules combined with Clang implicit modules, so these things should always be in-tandem. This will then allow us to no longer require compiler clients to specify clang flags explicitly: |
@swift-ci test |
7dfe832
to
0b54845
Compare
@swift-ci test |
@@ -1460,6 +1460,9 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts, | |||
Opts.PCHDisableValidation |= Args.hasArg(OPT_pch_disable_validation); | |||
} | |||
|
|||
if (FrontendOpts.DisableImplicitModules) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an important change, it essentially prohibits implicit loading of Clang modules when Swift explicit module loading is enabled. It is not clear why such a combination would be useful, and it is not something we intend to validate, so may as well make it not possible.
@swift-ci test Windows platform |
…uilt modules This will mean that '-disable-implicit-swift-modules' also automatically implies two things: 1. Clang modules must also be explicit, and the importer's clang instance will get '-fno-implicit-modules' and '-fno-implicit-module-maps' 2. The importer's clang instance will no longer get a '-fmodules-cache-path=', since it is not needed in explicit builds
0b54845
to
e2ea6cb
Compare
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool!
This will mean that
-disable-implicit-swift-modules
when specified toswift-frontend
also automatically implies two things:-fno-implicit-modules
and-fno-implicit-module-maps
.-fmodules-cache-path=
, since it is not needed in explicit builds.