-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[clang][driver][clang-cl] Support --precompile
and -fmodule-*
options in Clang-CL
#98761
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
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang Author: Sharadh Rajaraman (sharadhr) ChangesThis PR is the first step in improving the situation for This is a work-in-progress; the functionality has only been tested with the basic 'Hello World' example, and proper test cases need to be written. Additionally, the
I suspect the issue is somewhere around llvm-project/clang/lib/Driver/ToolChains/Clang.cpp Lines 6285 to 6300 in 8802c9f
I'd like some thoughts on this, thanks! Full diff: https://github.com/llvm/llvm-project/pull/98761.diff 1 Files Affected:
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 4ab8638175dd3..ca7cfef8453a0 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -3085,7 +3085,7 @@ def fmodules_user_build_path : Separate<["-"], "fmodules-user-build-path">, Grou
HelpText<"Specify the module user build path">,
MarshallingInfoString<HeaderSearchOpts<"ModuleUserBuildPath">>;
def fprebuilt_module_path : Joined<["-"], "fprebuilt-module-path=">, Group<i_Group>,
- Flags<[]>, Visibility<[ClangOption, CC1Option]>,
+ Flags<[]>, Visibility<[ClangOption, CLOption, CC1Option]>,
MetaVarName<"<directory>">,
HelpText<"Specify the prebuilt module path">;
defm prebuilt_implicit_modules : BoolFOption<"prebuilt-implicit-modules",
@@ -5874,6 +5874,7 @@ def _output : Separate<["--"], "output">, Alias<o>;
def _param : Separate<["--"], "param">, Group<CompileOnly_Group>;
def _param_EQ : Joined<["--"], "param=">, Alias<_param>;
def _precompile : Flag<["--"], "precompile">, Flags<[NoXarchOption]>,
+ Visibility<[ClangOption, CLOption]>,
Group<Action_Group>, HelpText<"Only precompile the input">;
def _prefix_EQ : Joined<["--"], "prefix=">, Alias<B>;
def _prefix : Separate<["--"], "prefix">, Alias<B>;
|
--precompile
and -fmodule-*
options in Clang-CL
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.
Thanks. Can you add a test for this under (clang/test/Driver) and add new subsection for it in StandardCPlusPlusModules.rst ?
✅ With the latest revision this PR passed the C/C++ code formatter. |
2d4067f
to
e6386de
Compare
--precompile
and -fmodule-*
options in Clang-CL--precompile
and -fmodule-*
options in Clang-CL
@ChuanqiXu9, do make a re-review when you can, thanks! |
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. I'll merge this after the CI finished.
It looks like the CI failure is not related. |
@sharadhr it looks like the commit author is not correct. By default it is |
…ly into CL driver without `/clang:` prefix
- Also add a note for build system authors to use `clang++` options
ef6a97d
to
4e8ca2a
Compare
I've done a git rebase with |
@sharadhr Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
I think this worth to be in 19.x and I don't it is a risk. |
/cherry-pick bd576fe |
…ions in Clang-CL (llvm#98761) This PR is the first step in improving the situation for `clang-cl` detailed in [this LLVM Discourse thread](https://discourse.llvm.org/t/clang-cl-exe-support-for-c-modules/72257/28). There has been some work done in llvm#89772. I believe this is somewhat orthogonal. This is a work-in-progress; the functionality has only been tested with the [basic 'Hello World' example](https://clang.llvm.org/docs/StandardCPlusPlusModules.html#quick-start), and proper test cases need to be written. I'd like some thoughts on this, thanks! Partially resolves llvm#64118. (cherry picked from commit bd576fe)
/pull-request #102159 |
…ions in Clang-CL (llvm#98761) This PR is the first step in improving the situation for `clang-cl` detailed in [this LLVM Discourse thread](https://discourse.llvm.org/t/clang-cl-exe-support-for-c-modules/72257/28). There has been some work done in llvm#89772. I believe this is somewhat orthogonal. This is a work-in-progress; the functionality has only been tested with the [basic 'Hello World' example](https://clang.llvm.org/docs/StandardCPlusPlusModules.html#quick-start), and proper test cases need to be written. I'd like some thoughts on this, thanks! Partially resolves llvm#64118. (cherry picked from commit bd576fe)
1. __cpp_lib_modules now is defined. llvm/llvm-project#90091 2. clang-cl supports -x option for all languages. llvm/llvm-project#89772 3. Header units allow non-inline external static members definitions. llvm/llvm-project#98309 4. winsysroot alias to the GNU driver: -Xmicrosoft-windows-sys-root. llvm/llvm-project#94731 5. clang-cl gained options for compiling C++ modules. llvm/llvm-project#98761 6. fix unused argument warning for /std:c++20 when compiling c++ modules. llvm/llvm-project#99300
This PR is the first step in improving the situation for
clang-cl
detailed in this LLVM Discourse thread. There has been some work done in #89772. I believe this is somewhat orthogonal.This is a work-in-progress; the functionality has only been tested with the basic 'Hello World' example, and proper test cases need to be written. I'd like some thoughts on this, thanks!
Partially resolves #64118.