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

2024-11-12 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +295,187 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[clang] Initial implementation of P2719 (PR #113510)

2024-10-24 Thread Chuanqi Xu via cfe-commits
@@ -1,6 +1,9 @@ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -O2 \ // RUN:-Wno-coroutine-missing-unhandled-exception -emit-llvm %s -o - -disable-llvm-passes \ // RUN: | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -O2 \ +

[clang] [C++20][Modules] Quote header unit name in preprocessor output (-E) (PR #112883)

2024-10-23 Thread Chuanqi Xu via cfe-commits
@@ -952,13 +952,15 @@ static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok, continue; } else if (Tok.is(tok::annot_header_unit)) { // This is a header-name that has been (effectively) converted into a - // module-name. + // module-name, pr

[clang] [C++20][Modules] Quote header unit name in preprocessor output (-E) (PR #112883)

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

[clang] [C++20][Modules] Quote header unit name in preprocessor output (-E) (PR #112883)

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

[clang-tools-extra] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (PR #113879)

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

[clang-tools-extra] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (PR #113879)

2024-10-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thanks : ) https://github.com/llvm/llvm-project/pull/113879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] d5cdc26 - [Clang] Mark RetainCommentsFromSystemHeaders as compatible language options

2024-10-31 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-10-31T15:52:18+08:00 New Revision: d5cdc26f555918e6f292f16ac3800afc97093aac URL: https://github.com/llvm/llvm-project/commit/d5cdc26f555918e6f292f16ac3800afc97093aac DIFF: https://github.com/llvm/llvm-project/commit/d5cdc26f555918e6f292f16ac3800afc97093aac.diff LO

[clang] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-10-31 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/114382 According to our previous consensus in https://clang.llvm.org/docs/StandardCPlusPlusModules.html#reduced-bmi, the reduced BMI will be the default and recommend users to use the new option. The `-fexperiment

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

2024-11-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed 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-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-12 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thank you very much ! 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-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-12 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +295,187 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

[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] [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
@@ -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] 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
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
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/4] [C++20] [Modules] Offer -fmodules-embed-all-files option See

[clang] [Frontend] Teach LoadFromASTFile to take FileName by StringRef (NFC) (PR #109583)

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

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/110083 According to https://github.com/ChuanqiXu9/clangd-for-modules/issues/9, I surprisingly found the support for C++20 modules doesn't support code completion well. After debugging, I found there are problems:

[clang] e7569b3 - [clang] [Modules] Don't assume an overriden module file can not be out-of-date

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

[clang] [clang] fix assert in ADL finding entity in the implicit global module (PR #109882)

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

[clang] [clang] fix assert in ADL finding entity in the implicit global module (PR #109882)

2024-09-24 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t +// +// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm +// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fprebuilt-module-path=%t -emit-module-interface -o %t/B.pcm +// RUN: %clang

[clang] [clang] fix assert in ADL finding entity in the implicit global module (PR #109882)

2024-09-24 Thread Chuanqi Xu via cfe-commits
@@ -115,7 +115,7 @@ C++ Language Changes - Allow single element access of GCC vector/ext_vector_type object to be constant expression. Supports the `V.xyzw` syntax and other tidbits as seen in OpenCL. Selecting multiple elements is left as a future work. -- Implement `CWG18

[clang] [clang] fix assert in ADL finding entity in the implicit global module (PR #109882)

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

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

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

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

2024-09-23 Thread Chuanqi Xu via cfe-commits
@@ -724,6 +724,9 @@ enum ASTRecordTypes { /// Record code for vtables to emit. VTABLES_TO_EMIT = 70, + + /// Record code for the FunctionDecl to lambdas mapping. ChuanqiXu9 wrote: Let's add some simple comments here to explain why we want to do this. ht

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

2024-09-23 Thread Chuanqi Xu via cfe-commits
@@ -233,6 +233,10 @@ class ASTWriter : public ASTDeserializationListener, /// instead of comparing the result of `getDeclID()` or `GetDeclRef()`. llvm::SmallPtrSet PredefinedDecls; + /// Map that provides the ID of function to the vector of lambdas inside it.

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

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

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

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

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

2024-09-23 Thread Chuanqi Xu via cfe-commits
@@ -532,6 +532,10 @@ class ASTReader /// namespace as if it is not delayed. DelayedNamespaceOffsetMapTy DelayedNamespaceOffsetMap; + /// Mapping from FunctionDecl IDs to the corresponding lambda IDs. ChuanqiXu9 wrote: Same here. Let's explain our intenti

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

2024-09-23 Thread Chuanqi Xu via cfe-commits
@@ -4351,6 +4351,15 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) { reader::ASTDeclContextNameLookupTrait(*this, *Update.Mod)); DC->setHasExternalVisibleStorage(true); } + + // Load any pending lambdas for the function. + if (auto *FD

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-26 Thread Chuanqi Xu via cfe-commits
@@ -2108,7 +2116,7 @@ class CodeCompleteFlow { } // namespace -clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts() const { +clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts(bool ForceLoadExternal) const { ChuanqiXu9 wro

[clang] [C++20][Modules] Fix non-determinism in serialized AST (PR #110131)

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

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/110083 >From e35e600159c99736de7d2bc735c738002f592988 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 26 Sep 2024 13:43:51 +0800 Subject: [PATCH 1/2] [clangd] [C++20] [Modules] Support code complete for C++20

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-26 Thread Chuanqi Xu via cfe-commits
@@ -402,6 +402,46 @@ import A; EXPECT_TRUE(D.isFromASTFile()); } +// An end to end test for code complete in modules +TEST_F(PrerequisiteModulesTests, CodeCompleteTest) { ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/110083 _

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-26 Thread Chuanqi Xu via cfe-commits
@@ -2108,7 +2116,7 @@ class CodeCompleteFlow { } // namespace -clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts() const { +clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts(bool ForceLoadExternal) const { ChuanqiXu9 wro

[clang] bf9ab0b - [C++20] [Modules] Emit implicit Deduction Guide for implicit class specialization

2024-09-28 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-09-29T10:38:05+08:00 New Revision: bf9ab0b7c3ba1d4a89a3dd9b00909ad3cfab3d48 URL: https://github.com/llvm/llvm-project/commit/bf9ab0b7c3ba1d4a89a3dd9b00909ad3cfab3d48 DIFF: https://github.com/llvm/llvm-project/commit/bf9ab0b7c3ba1d4a89a3dd9b00909ad3cfab3d48.diff LO

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/110083 >From e35e600159c99736de7d2bc735c738002f592988 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 26 Sep 2024 13:43:51 +0800 Subject: [PATCH 1/3] [clangd] [C++20] [Modules] Support code complete for C++20

[clang-tools-extra] [clangd] [C++20] [Modules] Support code complete for C++20 modules (PR #110083)

2024-09-28 Thread Chuanqi Xu via cfe-commits
@@ -2108,7 +2116,7 @@ class CodeCompleteFlow { } // namespace -clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts() const { +clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts(bool ForceLoadExternal) const { ChuanqiXu9 wro

[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] [clang][modules] Timestamp PCM files when writing (PR #112452)

2024-10-15 Thread Chuanqi Xu via cfe-commits
@@ -4905,6 +4905,10 @@ ASTFileSignature ASTWriter::WriteAST(Sema &SemaRef, StringRef OutputFile, this->BaseDirectory.clear(); WritingAST = false; + + if (WritingModule) +updateModuleTimestamp(OutputFile); ChuanqiXu9 wrote: Yeah, I'd like to make suc

[clang] [Modules][NFC] Rewrite friend-definition-2.cpp with split-file (PR #112380)

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

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-10-15 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @dmpolukhin I am still confusing about the problem. I mean, why your previous patch will break the reproducer and why this patch can "fix" it? I feel the current patch is somewhat workaround. It's not your fault. The original codes are somewhat tricky already. But let's try t

[clang] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Chuanqi Xu via cfe-commits
@@ -326,25 +326,25 @@ struct LazyOffsetPtr { /// /// If the low bit is clear, a pointer to the AST node. If the low /// bit is set, the upper 63 bits are the offset. - mutable uint64_t Ptr = 0; + mutable uintptr_t Ptr = 0; public: LazyOffsetPtr() = default; - exp

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

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

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +287,169 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -228,54 +223,30 @@ class StandalonePrerequisiteModules : public PrerequisiteModules { return BuiltModuleNames.contains(ModuleName); } - void addModuleFile(llvm::StringRef ModuleName, - llvm::StringRef ModuleFilePath) { -RequiredModules.emplac

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited 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-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +287,169 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +294,205 @@ llvm::Error buildModuleFile(llvm::StringRef ModuleName, if (Clang->getDiagnostics().hasErrorOccurred()) return llvm::createStringError("Compilation failed"); - BuiltModuleFiles.addModuleFile(ModuleName, Inputs.CompileCommand.Output); - return llv

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

2024-11-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited 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] [clang] Fix ASTWriter crash after merging named enums (PR #114240)

2024-11-07 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @jansvoboda11 for OC related things https://github.com/llvm/llvm-project/pull/114240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Downgrade inconsistent flags from erros to warnings (PR #115416)

2024-11-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/115416 There were many many "voices" about the too strict flags checking in modules. Although they rarely challenge this, maybe due to they respect to the compiler implementation details. But from my point of view,

[clang] [Serialization] Downgrade inconsistent flags from erros to warnings (PR #115416)

2024-11-07 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > This is the C++'s ecosystem in the open ended world. Image a situation that > > we're using a third party module and we add a new option to our library, > > then the build bails out! > > I think this is the correct behavior if the incompatibility caused by said > option

[clang] [Serialization] Downgrade error to warning for inconsistent language flags (PR #117840)

2024-11-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > I don't think the discussion here has run its course > > #115416 > > Yeah, I had explicitly asked for a review from @Bigcheese before that landed, > so I was surprised to see that get merged. I misread it. I thought it wasn't message to me. It would be clear if you ask m

[clang] [libcxx] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-11-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Oh, I didn't notice libcxx will test with clang17 and clang18 too. Where we didn't introduce reduced bmi. We can't use `-Wno-missing-reduced-bmi` since it won't be recognized by clang17 and clang18. @ldionne @mordante do you think how can we proceed on this? https://github.

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-11-08 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/83108 >From 0d8de5186b065a256f9afbc08faf775916591403 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 7 Jan 2018 15:16:11 +0200 Subject: [PATCH] D41416: [modules] [pch] Do not deserialize all lazy template

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-11-08 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/83108 >From 6e0716367fc369f6e57ffd2b20b7a4c49230bac2 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 8 Nov 2024 10:56:44 +0800 Subject: [PATCH 1/2] [Serialization] Downgrade inconsistent flags from erros to wa

[clang] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-11-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'd like to land this in the next week if no objection comes in. https://github.com/llvm/llvm-project/pull/114382 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Downgrade inconsistent flags from erros to warnings (PR #115416)

2024-11-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'd like to land this in next week if no objection comes in. https://github.com/llvm/llvm-project/pull/115416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Downgrade error to warning (PR #117840)

2024-11-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/117840 >From 1f9c2a9c32f3f3883478d96c716a58c8d6e8e27a Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 27 Nov 2024 10:53:03 +0800 Subject: [PATCH] [Serialization] Downgrade inconsistent flags from erros to warn

[clang] Downgrade error to warning (PR #117840)

2024-11-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/117840 >From 8b1794945e984b8527d234b13796ecf3e94ded77 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Wed, 27 Nov 2024 10:53:03 +0800 Subject: [PATCH] [Serialization] Downgrade inconsistent flags from erros to warn

[clang] [Serialization] Downgrade error to warning for inconsistent language flags (PR #117840)

2024-11-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: CC @mathstuf @mizvekov https://github.com/llvm/llvm-project/pull/117840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Downgrade inconsistent flags from erros to warnings (PR #115416)

2024-11-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Let's continue the discussion in post commit review if any. https://github.com/llvm/llvm-project/pull/115416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Serialization] Downgrade inconsistent flags from erros to warnings (PR #115416)

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

[clang] [libcxx] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-11-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: It looks the CI will compile libc++ with "old" clang19 and the just built clang. So it might not be able to recognize the new flag. Tried to use `-fexperimental-modules-reduced-bmi` for libc++. We can replace it with `-fmodules-reduced-bmi` someday after we don't compile it w

[clang] [Serialization] Downgrade inconsistent flags from erros to warnings (PR #115416)

2024-11-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/115416 >From 168d155cf6662b5db8cd4f84a51633581d8a545e Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 8 Nov 2024 10:56:44 +0800 Subject: [PATCH] [Serialization] Downgrade inconsistent flags from erros to warni

[clang] [libcxx] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-11-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/114382 >From 8a90969b9b669fa2925cea2b60622c19406243d1 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 31 Oct 2024 17:27:00 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Convert '-fexperimental-modules-reduced-b

[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] 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] [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-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] [Serialization] Downgrade error to warning for inconsistent language flags (PR #117840)

2024-12-03 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I see, so because we no longer allow inconsistent options when importing, we > now issue a lot of error diagnostics. But for many of the options, > differences between TUs should have no impact on modules anyway, and so those > errors are false positives. Is that about corr

[clang] [Serialization] Downgrade error to warning for inconsistent language flags (PR #117840)

2024-12-03 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I think going down this path is going to cause real issues for users. There's > a reason this behavior was added in the first place for Clang modules, as > Clang makes assumptions about the shape of the AST which can lead to crashes > in some cases. For example, in real wor

[clang] b5bd192 - [Serialization] Support load lazy specialization lazily

2024-12-05 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-12-06T10:52:35+08:00 New Revision: b5bd1928c6d43bc525a4e3fb65d2c750d61e URL: https://github.com/llvm/llvm-project/commit/b5bd1928c6d43bc525a4e3fb65d2c750d61e DIFF: https://github.com/llvm/llvm-project/commit/b5bd1928c6d43bc525a4e3fb65d2c750d61e.diff LO

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Chuanqi Xu via cfe-commits
@@ -10057,15 +10057,18 @@ void ASTReader::finishPendingActions() { // For a function defined inline within a class template, force the // canonical definition to be the one inside the canonical definition of // the template. This ensures that we instantiate fr

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Chuanqi Xu via cfe-commits
@@ -10057,15 +10057,18 @@ void ASTReader::finishPendingActions() { // For a function defined inline within a class template, force the // canonical definition to be the one inside the canonical definition of // the template. This ensures that we instantiate fr

[clang] [C++20][Modules] Load function body from the module that gives canonical decl (PR #111992)

2024-12-05 Thread Chuanqi Xu via cfe-commits
@@ -1976,14 +1976,16 @@ TemplateDeclInstantiator::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { if (!InstParams) return nullptr; + // Use canonical templated decl because only canonical decl has body + // if declarations were merged during loading from modules.

[clang] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-12-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Sent https://github.com/llvm/llvm-project/commit/b5bd1928c6d43bc525a4e3fb65d2c750d61e and see https://github.com/llvm/llvm-project/pull/83237#issuecomment-2521945547 https://github.com/llvm/llvm-project/pull/83108 ___ cfe-commit

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

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

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-05 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Oh, previously we didn't allow `-fallow-pcm-with-compiler-errors` so we didn't meet such problems. Out of curiosity (not a blocking issue), why do you want this feature for C++20 modules? https://github.com/llvm/llvm-project/pull/121550

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-05 Thread Chuanqi Xu via cfe-commits
@@ -6227,8 +6227,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext &Context, // Add a trailing update record, if any. These must go last because we // lazily load their attached statement. if (!GeneratingReducedBMI || !CanElideDeclDef(D)) { - if (HasUpda

[clang] [C++20][modules] Fix std::initializer_list recognition if it's exported out of a module (PR #118537)

2025-01-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: It looks nice to backport this if we're still in the release circle for 19.x https://github.com/llvm/llvm-project/pull/118537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [C++20][modules] Fix std::initializer_list recognition if it's exported out of a module (PR #118537)

2025-01-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: /cherry-pick 9f1e9f682d0a85ea013ccbce6a3ec4ac1be8335 https://github.com/llvm/llvm-project/pull/118537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][modules] Fix std::initializer_list recognition if it's exported out of a module (PR #118537)

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

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

2025-01-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Why is this submitted against the release/19.x branch? Is this a backport? > > If so, please indicate which commit it backports. > > Not a backport but a new commit. I have now re-submitted it against `main`, > but I'd like it back-ported to `19.x` if possible. It is bet

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Chuanqi Xu via cfe-commits
Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?=, Alejandro =?utf-8?q?Álvarez_Ayllón?Message-ID: In-Reply-To: @@ -6092,12 +6092,14 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext &Context, // An updated body is emitted last, so that the r

[clang] [clang] Allow generating module interfaces with parsing errors (PR #121485)

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

[clang] [clang] Allow generating module interfaces with parsing errors (PR #121485)

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

<    15   16   17   18   19   20   21   22   23   24   >