[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Would you like to explain more why this fail previously in more detail? > > Original code in `ASTReader::finishPendingActions` looked like this: > > ``` > for (auto ID : PendingLambdas) > GetDecl(ID); > PendingLambdas.clear(); > ``` > > The issue here is tha

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

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

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/107194 >From f18b50fb6ae778ac9b4ddaee4029d54f859c50f9 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 4 Sep 2024 16:02:53 +0800 Subject: [PATCH 1/4] [C++20] [Modules] Offer -fmodules-embed-all-files option See

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/107194 >From f18b50fb6ae778ac9b4ddaee4029d54f859c50f9 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 4 Sep 2024 16:02:53 +0800 Subject: [PATCH 1/3] [C++20] [Modules] Offer -fmodules-embed-all-files option See

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/107194 >From f18b50fb6ae778ac9b4ddaee4029d54f859c50f9 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 4 Sep 2024 16:02:53 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Offer -fmodules-embed-all-files option See

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
@@ -462,6 +462,33 @@ Currently, Clang accepts the above example, though it may produce surprising results if the debugging code depends on consistent use of ``NDEBUG`` in other translation units. +Source Files Consistency + + +Clang may open the input

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,2 @@ +// RUN: %clang -std=c++20 %s -fmodules-embed-all-files -### 2>&1 | FileCheck %s ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/107194 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
@@ -462,6 +462,33 @@ Currently, Clang accepts the above example, though it may produce surprising results if the debugging code depends on consistent use of ``NDEBUG`` in other translation units. +Source Files Consistency + + +Clang may open the input

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
@@ -462,6 +462,33 @@ Currently, Clang accepts the above example, though it may produce surprising results if the debugging code depends on consistent use of ``NDEBUG`` in other translation units. +Source Files Consistency + + +Clang may open the input

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
@@ -462,6 +462,33 @@ Currently, Clang accepts the above example, though it may produce surprising results if the debugging code depends on consistent use of ``NDEBUG`` in other translation units. +Source Files Consistency + + +Clang may open the input

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-18 Thread Chuanqi Xu via cfe-commits
@@ -484,6 +511,13 @@ fragment is disabled by default. These checks can be enabled by specifying and you encounter incorrect or missing diagnostics, please report them via the `community issue tracker `_. +Privacy Issue +--

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Would you like to explain more why this fail previously in more detail? Also I am thinking if we can make the process more efficiently: (1) Can we avoid the visitor in the writing process? (2) Can we delay the loading of lambdas to the load of definitions of the functions? I

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-09-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @sam-mccall @kadircet @HighCommander4 ping https://github.com/llvm/llvm-project/pull/106683 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @AaronBallman @cor3ntin @erichkeane @zygoloid @iains ping https://github.com/llvm/llvm-project/pull/107194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7046a9f - [C++20] [Modules] Treat in class defined member functions in language linkage as implicitly inline

2024-09-17 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-09-18T10:13:06+08:00 New Revision: 7046a9fb05f65f4699a2e88abbcb7dad8a21db2d URL: https://github.com/llvm/llvm-project/commit/7046a9fb05f65f4699a2e88abbcb7dad8a21db2d DIFF: https://github.com/llvm/llvm-project/commit/7046a9fb05f65f4699a2e88abbcb7dad8a21db2d.diff LO

[clang] [Clang] Propagate elide safe context through [[clang::coro_await_elidable_argument]] (PR #108474)

2024-09-17 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

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

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-13 Thread Chuanqi Xu via cfe-commits
@@ -249,7 +249,10 @@ Attribute Changes in Clang (#GH106864) - Introduced a new attribute ``[[clang::coro_await_elidable]]`` on coroutine return types - to express elideability at call sites where the coroutine is co_awaited as a prvalue. + to express elideability at call

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-13 Thread Chuanqi Xu via cfe-commits
@@ -650,6 +650,14 @@ DeclResult Sema::ActOnModuleImport(SourceLocation StartLoc, else VisibleModules.setVisible(Mod, ImportLoc); + assert((!Mod->isModulePartitionImplementation() || getCurrentModule()) && + "We can only import a partition unit in a named module.

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-13 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > This should probably come with a release note so that users know about the > improved diagnostic behavior. Done https://github.com/llvm/llvm-project/pull/108493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-13 Thread Chuanqi Xu via cfe-commits
@@ -439,6 +439,10 @@ def warn_deprecated_literal_operator_id: Warning< "is deprecated">, InGroup, DefaultIgnore; def warn_reserved_module_name : Warning< "%0 is a reserved name for a module">, InGroup; +def warn_import_implementation_partition_unit_in_interface_unit : Warni

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/108493 >From 75c361b60d177093c43795ebae5f41dbc35ae769 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 13 Sep 2024 13:18:43 +0800 Subject: [PATCH] [C++20] [Modules] Warn for importing implementation partition u

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-13 Thread Chuanqi Xu via cfe-commits
@@ -249,7 +249,10 @@ Attribute Changes in Clang (#GH106864) - Introduced a new attribute ``[[clang::coro_await_elidable]]`` on coroutine return types - to express elideability at call sites where the coroutine is co_awaited as a prvalue. + to express elideability at call

[clang] [Clang] Propagate elide safe context through [[clang::coro_must_await]] (PR #108474)

2024-09-13 Thread Chuanqi Xu via cfe-commits
@@ -849,12 +849,30 @@ static bool isAttributedCoroAwaitElidable(const QualType &QT) { return Record && Record->hasAttr(); } -static bool isCoroAwaitElidableCall(Expr *Operand) { - if (!Operand->isPRValue()) { -return false; +static void applySafeElideContext(Expr *Oper

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-13 Thread Chuanqi Xu via cfe-commits
@@ -439,6 +439,9 @@ def warn_deprecated_literal_operator_id: Warning< "is deprecated">, InGroup, DefaultIgnore; def warn_reserved_module_name : Warning< "%0 is a reserved name for a module">, InGroup; +def warn_import_implementation_partition_unit_in_interface_unit : Warnin

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/108493 >From b109ea29ee6d1c290766e141ce75317fbf450767 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 13 Sep 2024 13:18:43 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Warn for importing implementation partiti

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/108493 >From b109ea29ee6d1c290766e141ce75317fbf450767 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 13 Sep 2024 13:18:43 +0800 Subject: [PATCH] [C++20] [Modules] Warn for importing implementation partition u

[clang] [C++20] [Modules] Warn for importing implementation partition unit in interface units (PR #108493)

2024-09-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/108493 Recently, there are multiple false positive issue reports about the reachability of implementation partition units: - https://github.com/llvm/llvm-project/issues/105882 - https://github.com/llvm/llvm-project/

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-12 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee ,Dmitry Polukhin ,Dmitry Polukhin Message-ID: In-Reply-To: @@ -1155,6 +1155,16 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { for (unsigned I = 0; I != NumParams; ++I) Params.push_back(readDeclAs

[clang] [clang-scan-deps] Infer the target from the executable name (PR #108189)

2024-09-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: LGTM but I'll leave this to @jansvoboda11 and @Bigcheese https://github.com/llvm/llvm-project/pull/108189 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-11 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee ,Dmitry Polukhin ,Dmitry Polukhin Message-ID: In-Reply-To: @@ -1155,6 +1155,16 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { for (unsigned I = 0; I != NumParams; ++I) Params.push_back(readDeclAs

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-09 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Kyungwoo Lee ,Dmitry Polukhin ,Dmitry Polukhin Message-ID: In-Reply-To: https://github.com/ChuanqiXu9 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/104512 ___ cfe-commits

[clang] 74ac96a - [C++20] [Modules] Treat constexpr/consteval member function as implicitly inline

2024-09-08 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-09-09T11:24:50+08:00 New Revision: 74ac96ae1a81c7ecc0e27ff6f45309cff1f2df97 URL: https://github.com/llvm/llvm-project/commit/74ac96ae1a81c7ecc0e27ff6f45309cff1f2df97 DIFF: https://github.com/llvm/llvm-project/commit/74ac96ae1a81c7ecc0e27ff6f45309cff1f2df97.diff LO

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-09-08 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Let's give it a try : ) https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-08 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw==?=,Kyungwoo Lee ,Dmitry Polukhin Message-ID: In-Reply-To: @@ -764,6 +792,15 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { Record.push_back(D->param_size()); for (auto *P : D->parameters()) Record.AddDeclRef(P

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-08 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee ,Dmitry Polukhin Message-ID: In-Reply-To: @@ -1155,6 +1155,16 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { for (unsigned I = 0; I != NumParams; ++I) Params.push_back(readDeclAs()); FD->setPar

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-08 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee ,Dmitry Polukhin Message-ID: In-Reply-To: @@ -1188,6 +1188,11 @@ class ASTReader /// once recursing loading has been completed. llvm::SmallVector PendingOdrMergeChecks; + /// Lambdas that need to be loaded rig

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-08 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee ,Dmitry Polukhin Message-ID: In-Reply-To: @@ -764,6 +792,15 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { Record.push_back(D->param_size()); for (auto *P : D->parameters()) Record.AddDeclRef(P)

[clang] [Modules] Add -cc1 -flate-module-map-file to load module maps after PCMs (PR #88893)

2024-09-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: (I just missed it initially.) I took a quick look and the change looks at least not bad to me. But I didn't have experience with clang modules and I don't have an idea for the concerns you list. I don't mind accepting this if you want to land this. I f

[clang] 62fec3d - [NFCI] [ClangScanDeps] [P1689] Use PreprocessorOnly Action for P1689

2024-09-06 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-09-06T15:20:59+08:00 New Revision: 62fec3d23d2325869e6eba0263b0b9f834c2067f URL: https://github.com/llvm/llvm-project/commit/62fec3d23d2325869e6eba0263b0b9f834c2067f DIFF: https://github.com/llvm/llvm-project/commit/62fec3d23d2325869e6eba0263b0b9f834c2067f.diff LO

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-09-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @sam-mccall @kadircet @HighCommander4 ping~ https://github.com/llvm/llvm-project/pull/106683 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-04 Thread Chuanqi Xu via cfe-commits
@@ -3162,6 +3162,12 @@ def modules_reduced_bmi : Flag<["-"], "fexperimental-modules-reduced-bmi">, HelpText<"Generate the reduced BMI">, MarshallingInfoFlag>; +def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">, ChuanqiXu9 wrote: I

[clang] [C++20] [Modules] Offer -fmodules-embed-all-files option (PR #107194)

2024-09-04 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/107194 See https://discourse.llvm.org/t/rfc-modules-should-we-embed-sources-to-the-bmi/81029 for details. Close https://github.com/llvm/llvm-project/issues/72383 >From 8d0f91815f21d2badc86945b4be19ef21ce76efc Mon

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-03 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee Message-ID: In-Reply-To: ChuanqiXu9 wrote: > > Got it. I am pretty interested use case for modules. And from your commit > > history, it looks like you prefer header units than named modules? > > Yes, we prefer header units for the ti

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-09-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @AaronBallman @iains I've sent the RFC here: https://discourse.llvm.org/t/rfc-modules-should-we-embed-sources-to-the-bmi/81029 https://github.com/llvm/llvm-project/pull/102444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-09-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thanks for the write-up. I've reverted and I'll try to open a RFC to get a wider discussion. https://github.com/llvm/llvm-project/pull/102444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] 2cbd1bc - Revert "[C++20] [Modules] Embed all source files for C++20 Modules (#102444)"

2024-09-02 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-09-03T10:54:20+08:00 New Revision: 2cbd1bc830861bc08f78fb6cc11747b82f66c4c6 URL: https://github.com/llvm/llvm-project/commit/2cbd1bc830861bc08f78fb6cc11747b82f66c4c6 DIFF: https://github.com/llvm/llvm-project/commit/2cbd1bc830861bc08f78fb6cc11747b82f66c4c6.diff LO

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-09-02 Thread Chuanqi Xu via cfe-commits
Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Kyungwoo Lee Message-ID: In-Reply-To: ChuanqiXu9 wrote: > > I am curious about your real project, is it open source? > > Unfortunately, it is not an open source project but we use bunch of OSS > libraries like Folly, Thrift and many other so I see

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-08-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/106683 >From facbe53b41f90d2b7c94d83aaaec03f83f355735 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 30 Aug 2024 15:11:07 +0800 Subject: [PATCH] [clangd] [Modules] Support Reusable Modules Builder --- clang-

[clang-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-08-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/106683 This is the following patch of https://github.com/llvm/llvm-project/pull/66462 to optimize its performance. # Motivation To avoid data races, we choose "per file owns its dependent modules" model. That sa

[clang-tools-extra] d68059b - [NFC] [clangd] [Modules] Change the argument type of IsModuleFileUpToDate to reference

2024-08-30 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-30T15:15:24+08:00 New Revision: d68059bcfd1cc27e378c43b1f16019c5baccb06d URL: https://github.com/llvm/llvm-project/commit/d68059bcfd1cc27e378c43b1f16019c5baccb06d DIFF: https://github.com/llvm/llvm-project/commit/d68059bcfd1cc27e378c43b1f16019c5baccb06d.diff LO

[clang-tools-extra] 448d8fa - [NFC] [clangd] [Modules] Extract ModuleFile class and IsModuleFileUpToDate function

2024-08-29 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-30T14:43:41+08:00 New Revision: 448d8fa880be5cae0f63c3b248f07f647013a5a4 URL: https://github.com/llvm/llvm-project/commit/448d8fa880be5cae0f63c3b248f07f647013a5a4 DIFF: https://github.com/llvm/llvm-project/commit/448d8fa880be5cae0f63c3b248f07f647013a5a4.diff LO

[clang] ca2351d - [C++20] [Modules] Skip checking ODR for merged context in GMF

2024-08-29 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-30T11:45:01+08:00 New Revision: ca2351dd142bac574021f48f135a9f9383c41128 URL: https://github.com/llvm/llvm-project/commit/ca2351dd142bac574021f48f135a9f9383c41128 DIFF: https://github.com/llvm/llvm-project/commit/ca2351dd142bac574021f48f135a9f9383c41128.diff LO

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-08-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > Was this discussed/reviewed/motivated? There are drawbacks to this > > > approach outlined in #72383 > > > @iains @jyknight @AaronBallman @Bigcheese > > > > > > The motivation is in #72383 and I comment in [#72383 > > (comment)](https://github.com/llvm/llvm-project/iss

[clang] [CodeGen] Apply 'readonly' to 'this' pointer argument. (PR #106499)

2024-08-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I'm very confused. `readonly` means that the memory behind `this` cannot be > changed, not that the pointer cannot be changed. Out of curiosity, it looks not same in https://llvm.org/docs/LangRef.html: > This attribute indicates that the function does not write through this

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-08-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Was this discussed/reviewed/motivated? There are drawbacks to this approach > outlined in #72383 > > @iains @jyknight @AaronBallman @Bigcheese The motivation is in https://github.com/llvm/llvm-project/issues/72383 and I comment in https://github.com/llvm/llvm-project/issu

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

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

[clang] [C++20] [Modules] Don't insert class not in named modules to PendingEmittingVTables (PR #106501)

2024-08-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: /cherry-pick 47615ff2347a8be429404285de3b1c03b411e7af https://github.com/llvm/llvm-project/pull/106501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Don't insert class not in named modules to PendingEmittingVTables (PR #106501)

2024-08-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 milestoned https://github.com/llvm/llvm-project/pull/106501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Don't insert class not in named modules to PendingEmittingVTables (PR #106501)

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

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-08-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/102444 >From 4777ed31ebf1d631c394cd8f13a9355d177536d0 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 8 Aug 2024 15:30:35 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Embed all source files for C++20 Modules

[clang] [C++20] [Modules] Don't insert class not in named modules to PendingEmittingVTables (PR #106501)

2024-08-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/106501 >From b5bb3c27c13f1d0f6af21e5f7d8fdad3727bf2d0 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 29 Aug 2024 14:40:50 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Don't insert class not in named modules t

[clang] [CodeGen] Apply 'readonly' to 'this' pointer argument. (PR #106499)

2024-08-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Sounds good to me and I add another few reviewers to take another look. https://github.com/llvm/llvm-project/pull/106499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [C++20] [Modules] Don't insert class not in named modules to PendingEmittingVTables (PR #106501)

2024-08-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/106501 Close https://github.com/llvm/llvm-project/issues/102933 The root cause of the issue is an oversight in https://github.com/llvm/llvm-project/pull/102287 that I didn't notice that PendingEmittingVTables shoul

[clang] [C++20] [Modules] Merge lambdas in source to imported lambdas (PR #106483)

2024-08-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I don't think this patch is related to `Posix/fork_threaded.c` in compiler-rt. https://github.com/llvm/llvm-project/pull/106483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [C++20] [Modules] Merge lambdas in source to imported lambdas (PR #106483)

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

[clang] [C++20] [Modules] Merge lambdas in source to imported lambdas (PR #106483)

2024-08-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/106483 Close https://github.com/llvm/llvm-project/issues/102721 Generally, the type of merged decls will be reused in ASTContext. But for lambda, in the import and then include case, we can't decide its previous

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: LGTM, except the CodeGen's change. I am still slightly concerned about the maintainability. Let's try to give @efriedma-quic another two weeks. https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits ma

[clang] 07514fa - [Coroutines] Salvage the debug information for coroutine frames within optimizations

2024-08-28 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-28T17:02:12+08:00 New Revision: 07514fa9b607fd80a72a80270d714e22d842fa39 URL: https://github.com/llvm/llvm-project/commit/07514fa9b607fd80a72a80270d714e22d842fa39 DIFF: https://github.com/llvm/llvm-project/commit/07514fa9b607fd80a72a80270d714e22d842fa39.diff LO

[clang] [llvm] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[clang::coro_await_elidable]] (PR #99282)

2024-08-28 Thread Chuanqi Xu via cfe-commits
@@ -523,6 +523,12 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { NormalCleanupDest = Address::invalid(); } + if (getLangOpts().Coroutines && isCoroutine()) { +auto *Record = FnRetTy->getAsCXXRecordDecl(); +if (Record && Record->hasAttr()) +

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-08-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Quick update, all clang/cxx-library tests pass with the change but when I > test it on my real project with modules I see crash or assert in > [ASTDeclMerger::MergeDefinitionData](https://github.com/llvm/llvm-project/blob/main/clang/lib/Serialization/ASTReaderDecl.cpp#L2081)

[clang] 88f9ac3 - [doc] [C++20] [Modules] Add docs and release notes for '-Wdecls-in-multiple-modules'

2024-08-25 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-26T10:52:05+08:00 New Revision: 88f9ac380d8b40742aea11c8278652711261abff URL: https://github.com/llvm/llvm-project/commit/88f9ac380d8b40742aea11c8278652711261abff DIFF: https://github.com/llvm/llvm-project/commit/88f9ac380d8b40742aea11c8278652711261abff.diff LO

[clang] [C++20] [Modules] Warn for duplicated decls in mutliple module units (PR #105799)

2024-08-25 Thread Chuanqi Xu via cfe-commits
@@ -9955,6 +9955,45 @@ void ASTReader::finishPendingActions() { } PendingDefinitions.clear(); + for (auto [D, Previous] : PendingWarningForDuplicatedDefsInModuleUnits) { +auto hasDefinitionImpl = [this](Decl *D, auto hasDefinitionImpl) { + if (auto *VD = dyn_cast

[clang] [clang][test] Rewrote test to work with lit internal shell syntax (PR #105902)

2024-08-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM on my side. Thanks. But I didn't take a detailed look into https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179/29. So it might be good to wait for people there to approve this https://github.com/llvm/

[clang] [C++20] [Modules] Warn for duplicated decls in mutliple module units (PR #105799)

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

[clang] [C++20] [Modules] Warn for duplicated decls in mutliple module units (PR #105799)

2024-08-23 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/105799 It is a long standing issue that the duplicated declarations in multiple module units would cause the compilation performance to get slowed down. And there are many questions or issue reports. So I think it

[clang] 39986f0 - [NFCI] [Serialization] Use demoteThisDefinitionToDeclaration instead of setCompleteDefinition(false) for CXXRecordDecl

2024-08-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-23T15:43:43+08:00 New Revision: 39986f0b4d797e4ad3c12607f2b4abe2322b82bb URL: https://github.com/llvm/llvm-project/commit/39986f0b4d797e4ad3c12607f2b4abe2322b82bb DIFF: https://github.com/llvm/llvm-project/commit/39986f0b4d797e4ad3c12607f2b4abe2322b82bb.diff LO

[clang] e5f196e - [NFCI] [C++20] [Modules] Relax the case for duplicated declaration in multiple module units for explicit specialization

2024-08-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-23T15:35:57+08:00 New Revision: e5f196e4e7e3aec5c19adeacb7191ed0a099ea9a URL: https://github.com/llvm/llvm-project/commit/e5f196e4e7e3aec5c19adeacb7191ed0a099ea9a DIFF: https://github.com/llvm/llvm-project/commit/e5f196e4e7e3aec5c19adeacb7191ed0a099ea9a.diff LO

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-08-22 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Yeah, while the implementation need to be polished, the shape is what I want. https://github.com/llvm/llvm-project/pull/104512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-21 Thread Chuanqi Xu via cfe-commits
Jan =?utf-8?q?Kokemüller?= , Jan =?utf-8?q?Kokemüller?= , Jan =?utf-8?q?Kokemüller?= Message-ID: In-Reply-To: @@ -6926,11 +6926,26 @@ void Sema::AddOverloadCandidate( /// have linkage. So that all entities of the same should share one /// linkage. But in clang, differ

[clang] [clang][NFC] remove resolved issue from StandardCPlusPlusModules.rst (PR #105610)

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

[clang] [clang][NFC] remove resolved issue from StandardCPlusPlusModules.rst (PR #105610)

2024-08-21 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Oh, I forgot it. Thanks~ https://github.com/llvm/llvm-project/pull/105610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-20 Thread Chuanqi Xu via cfe-commits
Jan =?utf-8?q?Kokemüller?= , Jan =?utf-8?q?Kokemüller?= , Jan =?utf-8?q?Kokemüller?= Message-ID: In-Reply-To: @@ -6926,11 +6926,26 @@ void Sema::AddOverloadCandidate( /// have linkage. So that all entities of the same should share one /// linkage. But in clang, differ

[clang] 522c253 - [Coroutines] Salvage the debug information for coroutine frames within optimizations

2024-08-20 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-08-20T17:21:43+08:00 New Revision: 522c253f47ea27d8eeb759e06f8749092b1de71e URL: https://github.com/llvm/llvm-project/commit/522c253f47ea27d8eeb759e06f8749092b1de71e DIFF: https://github.com/llvm/llvm-project/commit/522c253f47ea27d8eeb759e06f8749092b1de71e.diff LO

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-08-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Here is another example that merging lambdas are problematic: https://github.com/llvm/llvm-project/issues/102721. Although I think we need to solve the problems separately. They are different problems. > > I feel the change is somewhat odd to me. Since the description is abo

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-19 Thread Chuanqi Xu via cfe-commits
Jan =?utf-8?q?Kokemüller?= Message-ID: In-Reply-To: @@ -6926,11 +6926,26 @@ void Sema::AddOverloadCandidate( /// have linkage. So that all entities of the same should share one /// linkage. But in clang, different entities of the same could have /// different lin

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-19 Thread Chuanqi Xu via cfe-commits
Jan =?utf-8?q?Kokemüller?= Message-ID: In-Reply-To: @@ -6926,11 +6926,26 @@ void Sema::AddOverloadCandidate( /// have linkage. So that all entities of the same should share one /// linkage. But in clang, different entities of the same could have /// different lin

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-19 Thread Chuanqi Xu via cfe-commits
Jan =?utf-8?q?Kokemüller?= Message-ID: In-Reply-To: @@ -6926,11 +6926,26 @@ void Sema::AddOverloadCandidate( /// have linkage. So that all entities of the same should share one /// linkage. But in clang, different entities of the same could have /// different lin

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-19 Thread Chuanqi Xu via cfe-commits
Jan =?utf-8?q?Kokem=C3=BCller?= Message-ID: In-Reply-To: https://github.com/ChuanqiXu9 approved this pull request. LGTM except comments. https://github.com/llvm/llvm-project/pull/104701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [Clang][Sema] Expose static inline functions from GMF (PR #104701)

2024-08-19 Thread Chuanqi Xu via cfe-commits
Jan =?utf-8?q?Kokemüller?= Message-ID: In-Reply-To: https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/104701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [RFC][C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #104512)

2024-08-15 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: I feel the change is somewhat odd to me. Since the description is about the lambda but the change is about VarDecls. I feel there is a mismatch and I feel this may not solve the underlying problem fundamentally. I feel it'll be better to make it more st

[clang] [clang-repl] Fix PCH with delayed template parsing (PR #103028)

2024-08-14 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > BTW, the delayed template parsing is a deprecated technique. Both clang > > > and MSVC won't enable this after C++20 and we think it is the root of > > > many bugs. > > > > > > I agree. It was needed in the past to parse the MSVC stdlib, let's check if > > we still ne

[clang] [C++20] [Modules] Merge lambdas from Sema to imported one (PR #103036)

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

[clang] [C++20] [Modules] Merge lambdas from Sema to imported one (PR #103036)

2024-08-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/103036 Close https://github.com/llvm/llvm-project/issues/102721 Previously we tried to merge lambdas between TUs. But we may still meet problems if we import and then include the headers containing the same lambda.

[clang] [NFC] [Serialization] Extract the functionality of merging decls from ASTReaderDecl (PR #103022)

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

[clang] [clang-repl] Fix PCH with delayed template parsing (PR #103028)

2024-08-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Looks not bad. Let's land it after the CI gets green. BTW, the delayed template parsing is a deprecated technique. Both clang and MSVC won't enable this after C++20 and we think it is the root of many bugs. https://github.com/llvm/llvm-

[clang] [NFC] [Serialization] Extract the functionality of merging decls from ASTReaderDecl (PR #103022)

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

[clang] [Doc] [C++20] [Modules] Clarify the reachability of internal partition units (PR #102572)

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

[clang] [Doc] [C++20] [Modules] Clarify the reachability of internal partition units (PR #102572)

2024-08-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/102572 >From c5766b29042cd5109c22f7c399ebc33ffd0f6b3b Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 9 Aug 2024 13:48:35 +0800 Subject: [PATCH 1/3] [Doc] [C++20] [Modules] Clarify the reachability of internal

[clang] [C++20] [Modules] Embed all source files for C++20 Modules (PR #102444)

2024-08-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/102444 >From 71e93c68dd186d70f2c922963897ffb1dce70179 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 8 Aug 2024 15:30:35 +0800 Subject: [PATCH] [C++20] [Modules] Embed all source files for C++20 Modules ---

  1   2   3   4   5   6   7   8   9   10   >