[clang-tools-extra] aa99026 - [NFC] [clangd] [Modules] Logging more if compilation failed

2025-07-10 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-07-11T11:18:21+08:00 New Revision: aa9902691db5cbb9db77270902f615f3c0877deb URL: https://github.com/llvm/llvm-project/commit/aa9902691db5cbb9db77270902f615f3c0877deb DIFF: https://github.com/llvm/llvm-project/commit/aa9902691db5cbb9db77270902f615f3c0877deb.diff LO

[clang] [NFC][C++][Modules] Refine basic.link.p3 and add test for P2788R0 (PR #147945)

2025-07-10 Thread Chuanqi Xu via cfe-commits
@@ -51,4 +39,71 @@ template module module_var_template; // This is a variable named 'import' that shadows the type 'import' above. struct X {} import; -#endif + +//--- ImportError1.cppm +module; + +struct import { struct inner {}; }; +struct module { struct inner {}; }; + +con

[clang] [NFC][C++][Modules] Refine basic.link.p3 and add test for P2788R0 (PR #147945)

2025-07-10 Thread Chuanqi Xu via cfe-commits
@@ -51,4 +39,71 @@ template module module_var_template; // This is a variable named 'import' that shadows the type 'import' above. struct X {} import; -#endif + +//--- ImportError1.cppm +module; + +struct import { struct inner {}; }; +struct module { struct inner {}; }; + +con

[clang] [NFC][C++][Modules] Refine basic.link.p3 and add test for P2788R0 (PR #147945)

2025-07-10 Thread Chuanqi Xu via cfe-commits
@@ -51,4 +39,71 @@ template module module_var_template; // This is a variable named 'import' that shadows the type 'import' above. struct X {} import; -#endif + +//--- ImportError1.cppm +module; + +struct import { struct inner {}; }; +struct module { struct inner {}; }; + +con

[clang] [NFC][C++][Modules] Refine basic.link.p3 and add test for P2788R0 (PR #147945)

2025-07-10 Thread Chuanqi Xu via cfe-commits
@@ -51,4 +39,71 @@ template module module_var_template; // This is a variable named 'import' that shadows the type 'import' above. struct X {} import; -#endif + +//--- ImportError1.cppm +module; + +struct import { struct inner {}; }; +struct module { struct inner {}; }; + +con

[clang] [NFC][C++][Modules] Refine basic.link.p3 and add test for P2788R0 (PR #147945)

2025-07-10 Thread Chuanqi Xu via cfe-commits
@@ -51,4 +39,71 @@ template module module_var_template; // This is a variable named 'import' that shadows the type 'import' above. struct X {} import; -#endif + +//--- ImportError1.cppm +module; + +struct import { struct inner {}; }; +struct module { struct inner {}; }; + +con

[clang] [NFC][C++][Modules] Refine basic.link.p3 and add test for P2788R0 (PR #147945)

2025-07-10 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/147945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Added partial support for compiling C++20 modules and header-units without scanning. (PR #147682)

2025-07-09 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: The size of the patch is too big to review. And personally I don't have such a time to review it recently. Also from the community's perspective, the maintainablity of large patches is questionable. I think, you can achieve it with another direction. Instead of adding these

[clang] [NFC] [C++] [Modules] Mark P2115 as implemented and add test (PR #147489)

2025-07-08 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/147489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++] [Modules] Mark P2115 as implemented and add test (PR #147489)

2025-07-08 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/147489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Extend SourceLocation to 64 bits. (PR #147292)

2025-07-07 Thread Chuanqi Xu via cfe-commits
@@ -43,17 +46,24 @@ namespace clang { // Macro locations have the top bit set, we rotate by one so it is the low bit. class SourceLocationEncoding { using UIntTy = SourceLocation::UIntTy; - constexpr static unsigned UIntBits = CHAR_BIT * sizeof(UIntTy); static UIntTy en

[clang] [NFC] [C++] [Modules] Mark P2788 as implemented and add test (PR #147138)

2025-07-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/147138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++] [Modules] Mark P2615 as implemented and add test (PR #147135)

2025-07-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/147135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++] [Modules] Mark P1811 as implemented and add test (PR #146993)

2025-07-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/146993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Extend SourceLocation to 64 bits. (PR #147292)

2025-07-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/147292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Extend SourceLocation to 64 bits. (PR #147292)

2025-07-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Have you tested this with google's internal modules test? If yes, then LG. https://github.com/llvm/llvm-project/pull/147292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [clang-tools-extra] [clang] Extend SourceLocation to 64 bits. (PR #147292)

2025-07-07 Thread Chuanqi Xu via cfe-commits
@@ -43,17 +46,24 @@ namespace clang { // Macro locations have the top bit set, we rotate by one so it is the low bit. class SourceLocationEncoding { using UIntTy = SourceLocation::UIntTy; - constexpr static unsigned UIntBits = CHAR_BIT * sizeof(UIntTy); static UIntTy en

[clang] [Serialization] Remove an unnecessarycast (NFC) (PR #147204)

2025-07-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/147204 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++] [Modules] Mark P2788 as implemented and add test (PR #147138)

2025-07-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/147138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++] [Modules] Mark P2615 as implemented and add test (PR #147135)

2025-07-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Thanks. A small suggestion is, it is better to paste the link of the paper. So that I don't have to find it my self. https://github.com/llvm/llvm-project/pull/147135 ___ cfe-commits mail

[clang] [NFC] [C++] [Modules] Mark P1811 as implemented and add test (PR #146993)

2025-07-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/146993 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/145220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for `--precompile` (PR #121046)

2025-07-04 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: CC @mathstuf @bradking https://github.com/llvm/llvm-project/pull/121046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Refactor `CodeGenOptions` to specify AST effect as X macro arg (PR #146910)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/146910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Refactor `LangOptions` to specify AST effect as X macro arg (PR #146766)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/146766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for `--precompile` (PR #121046)

2025-07-03 Thread Chuanqi Xu via cfe-commits
@@ -14,3 +14,11 @@ //--- test.pcm // CPP20WARNING-NOT: clang-cl: warning: argument unused during compilation: '/std:c++20' [-Wunused-command-line-argument] + +// test whether the following outputs %Hello.bmi ChuanqiXu9 wrote: ```suggestion // test whether th

[clang] [clang-cl] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for `--precompile` (PR #121046)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/121046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Accept `cl`-style output arguments (`/Fo`, `-Fo`) for `--precompile` (PR #121046)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Given the problem is important (I've heard the problem for clang-cl with modules several times) and the author have been active on this direction for years, I think I can trust him even if I can't test it actually. So LGTM. I'll land th

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Chuanqi Xu via cfe-commits
@@ -577,6 +577,16 @@ def err_drv_reduced_module_output_overrided : Warning< "please consider use '-fmodule-output=' to specify the output file for reduced BMI explicitly">, InGroup>; +def remark_found_cxx20_module_usage : Remark< + "found C++20 module usage in file '%0'"

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Chuanqi Xu via cfe-commits
@@ -790,6 +792,35 @@ class Driver { /// compilation based on which -f(no-)?lto(=.*)? option occurs last. void setLTOMode(const llvm::opt::ArgList &Args); + /// BuildDefaultActions - Constructs the list of actions to perform + /// for the provided arguments, which are onl

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/145220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 requested changes to this pull request. I still hope we can get a new name. It is important for me to understand if some code may affect C++20 module or not by its name. I feel this can be helpful for other developers too. https://github.com/llvm/llvm-project/pull

[clang] [Serialization] Fix lazy template loading (PR #133057)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. BTW, I've landed the 3 patches (excluding the problematic reported by Google) internally and we've used it for months. It looks good. https://github.com/llvm/llvm-project/pull/133057 ___ cfe-co

[clang] 5f62c79 - [C++20] [Modules] Use current named module to do module local lookup

2025-07-03 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-07-03T19:03:52+08:00 New Revision: 5f62c791061d5fb39e3686126042e4a090132efc URL: https://github.com/llvm/llvm-project/commit/5f62c791061d5fb39e3686126042e4a090132efc DIFF: https://github.com/llvm/llvm-project/commit/5f62c791061d5fb39e3686126042e4a090132efc.diff LO

[clang] [NFC] [C++] [Modules] Mark P1979 as implemented and add test (PR #146841)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/146841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [C++] [Modules] Mark P1979 as implemented and add test (PR #146841)

2025-07-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/146841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-07-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I'm not suggesting to treat CodeGenOptions as incompatible by default. For > now I'm just trying to remove the duplication and improve the > infrastructure.CodeGenOptions are still benign by default, and can only be > marked as compatible, which doesn't have any impact on e

[clang] [clang] [modules] Add err_main_in_named_module (PR #146635)

2025-07-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Please make sure the libc++ tests won't get affected. I am not sure if the modules related tests in libc++ run by default. https://github.com/llvm/llvm-project/pull/146635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang] [modules] Add err_main_in_named_module (PR #146635)

2025-07-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/146635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146635)

2025-07-02 Thread Chuanqi Xu via cfe-commits
@@ -12486,6 +12486,14 @@ void Sema::CheckMain(FunctionDecl *FD, const DeclSpec &DS) { : FixItHint()); FD->setInvalidDecl(true); } + +// In C++ [basic.start.main]p3, it is said a program attaching main to a +// named module is i

[clang] [clang] [modules] Add err_main_in_named_module (PR #146635)

2025-07-02 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/146635 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-07-01 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > How does this patch handle consistency issue? e.g., What if `a.pcm` is > > compiled with `-O0` but the consumer is compiled with `-O1`? I hope we > > won't break such things. > > All `Optimize`, `OptimizeSize` and `NoInlineDefine` were `COMPATIBLE_LANGOPT` > in `LangOpti

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-07-01 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: I prefer to change the term "explicit module" in the code to something like `CXX20 module` or `named module` or whatever. Since when I read the term `explicit module` I assumed it is a style to build clang header modules. https://github.com/llvm/llvm-p

[clang] [libcxx] [clang] [modules] Implement P3618R0: Allow attaching main to the global module (PR #146461)

2025-07-01 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/146461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [clang] [modules] Implement P3618R0: Allow attaching main to the global module (PR #146461)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Sounds good. I'll merge this after the CI gets green. https://github.com/llvm/llvm-project/pull/146461 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] WIP: fix assert in hasInitWithSideEffects (PR #146468)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: The change LGTM but I want a test to avoid further regression. https://github.com/llvm/llvm-project/pull/146468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [libcxx] [clang] [modules] Implement P3618R0: Allow attaching main to the global module (PR #146461)

2025-06-30 Thread Chuanqi Xu via cfe-commits
@@ -12400,12 +12400,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, void Sema::CheckMain(FunctionDecl *FD, const DeclSpec &DS) { // [basic.start.main]p3 - //The main function shall not be declared with a linkage-specification. - if (FD->isExter

[clang] [clang][modules-driver] Add scanner to detect C++20 module presence (PR #145220)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > This PR is part of a series aimed at implementing native support for explicit > module builds from the Clang driver. This is confusing. Since explicit modules is an unrelated term with C++20 modules. https://github.com/llvm/llvm-project/pull/145220

[clang] [clang-tools-extra] [clang][modules] Serialize `CodeGenOptions` (PR #146422)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: This has a stronger impact on C++20 modules since C++20 modules need to generate codes. How does this patch handle consistency issue? e.g., What if `a.pcm` is compiled with `-O0` but the consumer is compiled with `-O1`? I hope we won't break such thin

[clang] 8a5b97a - Revert "[clang] [modules] Add err_main_in_named_module (#146247)"

2025-06-30 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-30T23:22:31+08:00 New Revision: 8a5b97a7205db189ca82f44dec7a399c2b5da546 URL: https://github.com/llvm/llvm-project/commit/8a5b97a7205db189ca82f44dec7a399c2b5da546 DIFF: https://github.com/llvm/llvm-project/commit/8a5b97a7205db189ca82f44dec7a399c2b5da546.diff LO

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Didn't know it. I'll revert this. @ashwinbanwari it looks like you need to remove the diagnostics with `extern "C++" main` and apply it with libc++ and land this finally. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-com

[clang] [clang] Fix broken autocomplete test (PR #146326)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/146326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix broken autocomplete test (PR #146326)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I landed it in https://github.com/llvm/llvm-project/commit/5186d4aeeeca56a77404c2842e494524b7cdd4ba https://github.com/llvm/llvm-project/pull/146326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: FWIW, I fixed it in https://github.com/llvm/llvm-project/commit/5186d4aeeeca56a77404c2842e494524b7cdd4ba to avoid affecting more people longer. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commit

[clang] 5186d4a - [NFC] [clang] Fix a test regression

2025-06-30 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-30T18:56:29+08:00 New Revision: 5186d4aeeeca56a77404c2842e494524b7cdd4ba URL: https://github.com/llvm/llvm-project/commit/5186d4aeeeca56a77404c2842e494524b7cdd4ba DIFF: https://github.com/llvm/llvm-project/commit/5186d4aeeeca56a77404c2842e494524b7cdd4ba.diff LO

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Please use a new email name. We don't accept github.noreply mail. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
@@ -650,6 +650,9 @@ Improvements to Clang's diagnostics #GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490, #GH36703, #GH32903, #GH23312, #GH69874. +- A warning is now emitted when ``main`` is attached to a named module, + which can be turned off with ``

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
@@ -1062,6 +1062,8 @@ def err_constexpr_main : Error< "'main' is not allowed to be declared %select{constexpr|consteval}0">; def err_deleted_main : Error<"'main' is not allowed to be deleted">; def err_mainlike_template_decl : Error<"%0 cannot be a template">; +def warn_main_

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
@@ -1062,6 +1062,8 @@ def err_constexpr_main : Error< "'main' is not allowed to be declared %select{constexpr|consteval}0">; def err_deleted_main : Error<"'main' is not allowed to be deleted">; def err_mainlike_template_decl : Error<"%0 cannot be a template">; +def warn_main_

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] odr-checker fix for conversion operators (PR #146153)

2025-06-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. SGTM https://github.com/llvm/llvm-project/pull/146153 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] [modules] Add err_main_in_named_module (PR #146247)

2025-06-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I prefer a warning instead of hard error. There are already users who uses this. https://github.com/llvm/llvm-project/pull/146247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [llvm] [mlir] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-27 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. I don't feel there are coroutine specific things, but if you want, I can accept this. https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > @ChuanqiXu9 @dwblaikie please let me know if you feel comfortable reviewing > this change or if we also need input from others 🙂 I like the work but my knowledge to dwarf is limited. But I'd like to approve this if no one gives feedbacks. I do think it is better to move on.

[clang] d829636 - [C++20] [Modules] Don't mark namespace decl as module local declaration

2025-06-26 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-27T13:35:09+08:00 New Revision: d829636f5d71d8a3771d9f96f22f1fe7507a32ec URL: https://github.com/llvm/llvm-project/commit/d829636f5d71d8a3771d9f96f22f1fe7507a32ec DIFF: https://github.com/llvm/llvm-project/commit/d829636f5d71d8a3771d9f96f22f1fe7507a32ec.diff LO

[clang] [llvm] [debuginfo][coro] Emit debug info labels for coroutine resume points (PR #141937)

2025-06-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: I love this really. https://github.com/llvm/llvm-project/pull/141937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] NFC: Add alias for std::pair used in SourceLocation (PR #145711)

2025-06-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/145711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang-tidy] [Modules] Skip checking decls in clang-tidy (PR #145630)

2025-06-25 Thread Chuanqi Xu via cfe-commits
@@ -1469,6 +1470,12 @@ bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) { return true; } + if (Options.SkipDeclsInModules && DeclNode->isFromASTFile()) { +auto *M = DeclNode->getOwningModule(); +if (M && (M->isInterfaceOrPartition() || M->isGlobalModule())) +

[clang] [clang-tools-extra] [clang-tidy] [Modules] Skip checking decls in clang-tidy (PR #145630)

2025-06-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/145630 >From 3e526e9a666dcc2ea0e6bdcb666dca43ab6ba740 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 17 Jan 2024 13:22:10 +0800 Subject: [PATCH 1/2] [clang-tidy] [Modules] Skip checking decls in clang-tidy --

[clang] [clang-tools-extra] [clang-tidy] [Modules] Skip checking decls in clang-tidy (PR #145630)

2025-06-25 Thread Chuanqi Xu via cfe-commits
@@ -1469,6 +1470,12 @@ bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) { return true; } + if (Options.SkipDeclsInModules && DeclNode->isFromASTFile()) { +auto *M = DeclNode->getOwningModule(); +if (M && (M->isInterfaceOrPartition() || M->isGlobalModule())) +

[clang] [clang-tools-extra] [clang-tidy] [Modules] Skip checking decls in clang-tidy (PR #145630)

2025-06-25 Thread Chuanqi Xu via cfe-commits
@@ -139,6 +139,11 @@ class MatchFinder { /// /// It prints a report after match. std::optional CheckProfiling; + +bool SkipDeclsInModules = false; + +MatchFinderOptions() +: CheckProfiling(std::nullopt), SkipDeclsInModules(false) {}

[clang] a6e5242 - [Modules] Add merged Files to UsedModuleFiles

2025-06-25 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-26T13:39:45+08:00 New Revision: a6e524276e2c0596162a9635e0aa87a5ba145409 URL: https://github.com/llvm/llvm-project/commit/a6e524276e2c0596162a9635e0aa87a5ba145409 DIFF: https://github.com/llvm/llvm-project/commit/a6e524276e2c0596162a9635e0aa87a5ba145409.diff LO

[clang] [Serialization] Fix source location data loss during decoding. (PR #145529)

2025-06-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/145529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Fix source location data loss during decoding. (PR #145529)

2025-06-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > If the module file index is 0, we use delta encoding (see [this code > path](https://github.com/llvm/llvm-project/blob/01b288fe6a1e627954329198ed5641f2bf55ee8d/clang/include/clang/Serialization/SourceLocationEncoding.h#L165-L168)). > However, the 1) case can produce a 33-bit

[clang] Reland "[Modules] Record whether VarDecl initializers contain side effects" (PR #145447)

2025-06-25 Thread Chuanqi Xu via cfe-commits
@@ -16719,6 +16719,9 @@ static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, const LValue &This, const Expr *E, bool AllowNonLiteralTypes) { assert(!E->isValueDependent()); + if (E->getType().isNull()) ChuanqiXu9 wrote:

[clang] [Serialization] Remove delta encoding optimization (PR #145670)

2025-06-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Maintainability is important given the limited dev resources right now. https://github.com/llvm/llvm-project/pull/145670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [Serialization] Fix source location data loss during decoding. (PR #145529)

2025-06-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Yeah, and for what it worth, maybe you want to take a look at: https://discourse.llvm.org/t/rfc-c-modules-stop-using-abbrev-and-drop-the-maintainance/87063/2 https://github.com/llvm/llvm-project/pull/145529 ___ cfe-commits mailing li

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-25 Thread Chuanqi Xu via cfe-commits
@@ -8,470 +8,966 @@ Debugging C++ Coroutines Introduction -For performance and other architectural reasons, the C++ Coroutines feature in -the Clang compiler is implemented in two parts of the compiler. Semantic -analysis is performed in Clang, and Coroutine cons

[clang] 4efb618 - [C++20] [Modules] Handling template declare with debug info

2025-06-25 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-25T17:51:50+08:00 New Revision: 4efb61850b590941a8da51057d3a63782864f44c URL: https://github.com/llvm/llvm-project/commit/4efb61850b590941a8da51057d3a63782864f44c DIFF: https://github.com/llvm/llvm-project/commit/4efb61850b590941a8da51057d3a63782864f44c.diff LO

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM generally. https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-25 Thread Chuanqi Xu via cfe-commits
@@ -8,470 +8,966 @@ Debugging C++ Coroutines Introduction -For performance and other architectural reasons, the C++ Coroutines feature in -the Clang compiler is implemented in two parts of the compiler. Semantic -analysis is performed in Clang, and Coroutine cons

[clang] [Serialization] Fix source location data loss during decoding. (PR #145529)

2025-06-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > The design is, the higher 32 bits are used for module file index and the > > lower bits are used for offsets. Could you give a concrete example why the > > current implementation is problematic? > > I don’t have a concrete failure case, but I noticed this while working on

[clang] [clang-tools-extra] [clang-tidy] [Modules] Skip checking decls in clang-tidy (PR #145630)

2025-06-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > If modules are considered as system headers in clang-tidy, there was work in > #128150 to reduce scope of traversal to match only in user code (I suppose it > would affect modules too). But that PR had to be reverted due to appeared > issues with downstream users. Hopefully

[clang] [Serialization] Fix source location data loss during decoding. (PR #145529)

2025-06-24 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: The design is, the higher 32 bits are used for module file index and the lower bits are used for offsets. Could you give a concrete example why the current implementation is problematic? https://github.com/llvm/llvm-project/pull/145529 ___

[clang] a0ce3e6 - [C++20] [Modules] Avoid crash with calls to (this auto) syntax

2025-06-24 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-25T14:12:32+08:00 New Revision: a0ce3e691c199145b55b6a7f86468b438eb14264 URL: https://github.com/llvm/llvm-project/commit/a0ce3e691c199145b55b6a7f86468b438eb14264 DIFF: https://github.com/llvm/llvm-project/commit/a0ce3e691c199145b55b6a7f86468b438eb14264.diff LO

[clang] [Serialization] Fix source location data loss during decoding. (PR #145529)

2025-06-24 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Sorry. I failed to understand the problem. In what case, may the encoder produce up to 33 bits? https://github.com/llvm/llvm-project/pull/145529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [docs][coroutines] Revamp "Debugging C++ coroutines" (PR #142651)

2025-06-24 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/142651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[Modules] Record whether VarDecl initializers contain side effects" (PR #145447)

2025-06-23 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/145447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[Modules] Record whether VarDecl initializers contain side effects" (PR #145447)

2025-06-23 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: What is the difference between this one and the previous PR? https://github.com/llvm/llvm-project/pull/145447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] fccc6ee - [C++20] [Modules] Don't make enum constant members always visible

2025-06-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-23T14:39:08+08:00 New Revision: fccc6ee7021811a27ab1303d19407f703853ab92 URL: https://github.com/llvm/llvm-project/commit/fccc6ee7021811a27ab1303d19407f703853ab92 DIFF: https://github.com/llvm/llvm-project/commit/fccc6ee7021811a27ab1303d19407f703853ab92.diff LO

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-23 Thread Chuanqi Xu via cfe-commits
@@ -2434,6 +2434,31 @@ VarDecl *VarDecl::getInitializingDeclaration() { return Def; } +bool VarDecl::hasInitWithSideEffects() const { + if (!hasInit()) +return false; + + // Check if we can get the initializer without deserializing + const Expr *E = nullptr; + if (au

[clang] [clang][clang-scan-deps] Add named modules to format 'experimental-full' (PR #145221)

2025-06-22 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: I don't feel bad but I'd like to leave the formal approvals to @jansvoboda11 and @Bigcheese here. https://github.com/llvm/llvm-project/pull/145221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-22 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/143739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 14e89b0 - [C++20] [Modules] Add exported modules as transitive imported modules

2025-06-20 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-20T17:03:29+08:00 New Revision: 14e89b061fdecedcec4bb035060a56588610cb5c URL: https://github.com/llvm/llvm-project/commit/14e89b061fdecedcec4bb035060a56588610cb5c DIFF: https://github.com/llvm/llvm-project/commit/14e89b061fdecedcec4bb035060a56588610cb5c.diff LO

[clang] 50c5ecd - [NFC] [Serialization] Remove a useless comment

2025-06-19 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-20T10:33:35+08:00 New Revision: 50c5ecd35402dc734f2a462df5532e77a5ce12b2 URL: https://github.com/llvm/llvm-project/commit/50c5ecd35402dc734f2a462df5532e77a5ce12b2 DIFF: https://github.com/llvm/llvm-project/commit/50c5ecd35402dc734f2a462df5532e77a5ce12b2.diff LO

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-19 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/143739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] Record whether VarDecl initializers contain side effects (PR #143739)

2025-06-19 Thread Chuanqi Xu via cfe-commits
@@ -195,6 +196,10 @@ class ExternalASTSource : public RefCountedBase { /// module. virtual bool wasThisDeclarationADefinition(const FunctionDecl *FD); + virtual bool hasInitializerWithSideEffects(const VarDecl *VD) const { ChuanqiXu9 wrote: Generally, e

  1   2   3   4   5   6   7   8   9   10   >