-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ClangImporter] Add a mode to create the underlying Clang 'CompilerInvocation' directly from 'cc1' arguments, bypassing the Clang driver, only in the 'emit-pcm' compilation flow. #61303
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
Conversation
@swift-ci test |
This will be used by the driver for Explicit Module Builds once #60882 lands on top of this change. |
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.
Nice! Left some comments in-line.
297e4f9
to
6db8317
Compare
@swift-ci test |
6db8317
to
8d482cf
Compare
@swift-ci smoke 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.
LGTM if tests pass. Thank you!
As of swiftlang/swift#60882 and swiftlang/swift#61303, emit-pcm will accept clang frontend arguments with '-Xcc', instead of clang driver arguments.
As of swiftlang/swift#60882 and swiftlang/swift#61303, emit-pcm will accept clang frontend arguments with '-Xcc', instead of clang driver arguments.
…vocation' directly from 'cc1' arguments, bypassing the Clang driver, only in the 'emit-pcm' compilation flow. Controlled with a new flag '-direct-clang-cc1-module-build' This will allow clients to formulate 'swift-frontend' invocations with fully-specified set of cc1 arguments (using '-Xcc -Xclang -Xcc <FLAG>') required for the PCM build, without having to go through the driver.
8d482cf
to
bfa6375
Compare
@swift-ci smoke test |
Thanks @benlangmuir ! |
@swift-ci smoke test Linux platform |
@swift-ci smoke test macOS platform |
Controlled with a new flag
-direct-clang-cc1-module-build
This will allow clients to formulate 'swift-frontend' invocations with fully-specified set of cc1 arguments (using
-Xcc <FLAG>
) required for the PCM build, without having to go through the driver.When
-direct-clang-cc1-module-build
is specified,ClangImporter::createClangInvocation
will now use Clang'sclang::CompilerInvocation::CreateFromArgs
directly with the provided CC1 flags, instead of going through the driver via Clang'sclang::createInvocationFromCommandLine
.