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

2024-09-29 Thread Chuanqi Xu via cfe-commits
@@ -2122,7 +2125,10 @@ clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts() const { // When an is used, Sema is responsible for completing the main file, // the index can provide results from the preamble. // Tell Sema not to deserialize the preamble to

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

2024-09-29 Thread Chuanqi Xu via cfe-commits
@@ -52,6 +52,9 @@ struct CodeCompleteOptions { /// For example, private members are usually inaccessible. bool IncludeIneligibleResults = false; + /// Whether the experimental modules support are enabled. + bool ExperimentalModulesSupport = false; Chuanq

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

2024-09-29 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/6] [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-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/110083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

2024-09-29 Thread Chuanqi Xu via cfe-commits
@@ -1631,9 +1631,32 @@ static bool allLookupResultsAreTheSame(const DeclContext::lookup_result &R) { static NamedDecl* getLambdaCallOperatorHelper(const CXXRecordDecl &RD) { if (!RD.isLambda()) return nullptr; DeclarationName Name = -RD.getASTContext().DeclarationNames

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

2024-09-29 Thread Chuanqi Xu via cfe-commits
@@ -1631,9 +1631,32 @@ static bool allLookupResultsAreTheSame(const DeclContext::lookup_result &R) { static NamedDecl* getLambdaCallOperatorHelper(const CXXRecordDecl &RD) { if (!RD.isLambda()) return nullptr; DeclarationName Name = -RD.getASTContext().DeclarationNames

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

2024-09-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Thanks for the analysis! Further more, if we want to fix such issue better, may be we need to refactor the current `lookup` method into a version that understands modules, then we can do better lookup with modules. This is helpful for https://github.co

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

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

[clang] [RFC][C++20][Modules] Relax ODR check in unnamed modules (PR #111160)

2024-10-07 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: rm -fR %t +// RUN: split-file %s %t +// RUN: cd %t +// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -emit-header-unit -xc++-user-header bz0.h +// RUN: %clang_cc1 -verify -std=c++20 -fskip-odr-check-in-gmf -emit-header-unit -xc++-user-heade

[clang] [RFC][C++20][Modules] Relax ODR check in unnamed modules (PR #111160)

2024-10-07 Thread Chuanqi Xu via cfe-commits
@@ -2527,7 +2527,7 @@ class BitsUnpacker { inline bool shouldSkipCheckingODR(const Decl *D) { return D->getASTContext().getLangOpts().SkipODRCheckInGMF && - D->isFromGlobalModule(); + (D->isFromGlobalModule() || !D->isInNamedModule()); Chuanq

[clang] [modules][test] Bump maximum size for embed-files-compressed.cpp for the sake of RISC-V (PR #111360)

2024-10-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Thanks. The underlying issue worths more investigating. But giving we don't have enough developers on modules and RV, maybe this is the best thing we can do now. https://github.com/llvm/llvm-project/pull/111360 _

[clang] [Serialization] Handle uninitialized type constraints (PR #110496)

2024-10-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: I'll leave this to @cor3ntin https://github.com/llvm/llvm-project/pull/110496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

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

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

2024-10-07 Thread Chuanqi Xu via cfe-commits
@@ -1631,13 +1631,39 @@ static bool allLookupResultsAreTheSame(const DeclContext::lookup_result &R) { static NamedDecl* getLambdaCallOperatorHelper(const CXXRecordDecl &RD) { if (!RD.isLambda()) return nullptr; DeclarationName Name = -RD.getASTContext().DeclarationName

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

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

[clang] [Clang] Instantiate the correct lambda call operator (PR #110446)

2024-10-07 Thread Chuanqi Xu via cfe-commits
@@ -1631,13 +1631,39 @@ static bool allLookupResultsAreTheSame(const DeclContext::lookup_result &R) { static NamedDecl* getLambdaCallOperatorHelper(const CXXRecordDecl &RD) { if (!RD.isLambda()) return nullptr; DeclarationName Name = -RD.getASTContext().DeclarationName

[clang] [clang] Deduplicate the logic that only warns once when stack is almost full (PR #112371)

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

[clang] [clang] Deduplicate the logic that only warns once when stack is almost full (PR #112371)

2024-10-16 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Took a pretty quick scanning and this looks good to me. https://github.com/llvm/llvm-project/pull/112371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang] Deduplicate the logic that only warns once when stack is almost full (PR #112371)

2024-10-16 Thread Chuanqi Xu via cfe-commits
@@ -1183,7 +1181,7 @@ class Sema final : public SemaBase { std::optional> CachedDarwinSDKInfo; bool WarnedDarwinSDKInfoMissing = false; - bool WarnedStackExhausted = false; + SingleWarningStackAwareExecutor StackAwareExecutor; ChuanqiXu9 wrote: Abstract

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

2024-10-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'd like to land this in 2 weeks if no more comments came in. Given: - In our downstream, we've landed this patch for more than a year and it seems running well. And also in the open source world, I tried to send it to https://github.com/ChuanqiXu9/clangd-for-modules . Everyon

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

2024-10-20 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] D41416: [modules] [pch] Do not deserialize all lazy template specializations when looking for one. (PR #83108)

2024-10-16 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/83108 >From a2cac54ad725c18827226f74675312ace0239fa3 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] [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] [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] [clang] LazyOffsetPtr: Use native pointer width (PR #111995)

2024-10-16 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > Can we remove `getAddressOfPointer` instead?. Where is it being used? > > > > > > It is used in `VarDecl::getInitAddress()` in Decl.cpp. It looks like it is > > used indirectly by the StmtIterator > > And that in turn is used in `StmtIterator`, and indeed we can end up

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

2024-10-16 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.

[clang] [clang] Deduplicate the logic that only warns once when stack is almost full (PR #112552)

2024-10-17 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. https://github.com/llvm/llvm-project/pull/112552 ___ 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-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Thanks for the analysis. I feel (2) is easier to me IIUC. I feel it is a > > natural extension of your previous work. WDYT? > > I implemented this approach and it works. I tried to limit eager > deserialization to the minimal set of functions (at the moment it is friend

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

2024-10-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > #112806 should address this without narrowing the field to 32 bits. > > As does [#111995 > (comment)](https://github.com/llvm/llvm-project/pull/111995#discussion_r1805329590), > with less code and more generality I prefer this solution too. https://github.com/llvm/llvm-

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

2024-10-17 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] [clang] Allocate `Module` instances in `BumpPtrAllocator` (PR #112795)

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

[clang] [C++20][Modules] Allow import for a header unit after #pragma (PR #111662)

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

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -127,50 +128,64 @@ struct ModuleFile { std::string ModuleFilePath; }; -bool IsModuleFileUpToDate( -PathRef ModuleFilePath, -const PrerequisiteModules &RequisiteModules) { -IntrusiveRefCntPtr Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions(

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/113879 >From 99e1989c3b2fad7702795a707d130fe96a93f42f Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 28 Oct 2024 15:54:37 +0800 Subject: [PATCH 1/2] [clangd] [Modules] Use ASTReader directly in IsModuleFileUp

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-29 Thread Chuanqi Xu via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. Looks better than https://github.com/llvm/llvm-project/pull/113984 ___ 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-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/113879 >From 99e1989c3b2fad7702795a707d130fe96a93f42f Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 28 Oct 2024 15:54:37 +0800 Subject: [PATCH 1/4] [clangd] [Modules] Use ASTReader directly in IsModuleFileUp

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -127,33 +127,39 @@ struct ModuleFile { std::string ModuleFilePath; }; -bool IsModuleFileUpToDate(PathRef ModuleFilePath, - const PrerequisiteModules &RequisiteModules, - llvm::IntrusiveRefCntPtr VFS) { +bool IsModuleFileU

[clang] [C++20] [Modules] Fix the duplicated static initializer problem (PR #114193)

2024-10-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/114193 Reproducer: ``` //--- a.cppm export module a; int func(); static int a = func(); //--- a.cpp import a; ``` The `func()` should only execute once. However, before this patch we will somehow import `static i

[clang] [C++20] [Modules] Fix the duplicated static initializer problem (PR #114193)

2024-10-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Given the problem is very serious and the solution is pretty simple, I'd like to backport this to 19.x. https://github.com/llvm/llvm-project/pull/114193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [C++20] [Modules] Fix the duplicated static initializer problem (PR #114193)

2024-10-30 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: /cherry-pick 259eaa6878ead1e2e7ef572a874dc3d885c1899b https://github.com/llvm/llvm-project/pull/114193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20] [Modules] Fix the duplicated static initializer problem (PR #114193)

2024-10-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 closed https://github.com/llvm/llvm-project/pull/114193 ___ 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-29 Thread Chuanqi Xu via cfe-commits
@@ -127,50 +128,65 @@ struct ModuleFile { std::string ModuleFilePath; }; -bool IsModuleFileUpToDate( -PathRef ModuleFilePath, -const PrerequisiteModules &RequisiteModules) { -IntrusiveRefCntPtr Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions(

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -127,50 +128,64 @@ struct ModuleFile { std::string ModuleFilePath; }; -bool IsModuleFileUpToDate( -PathRef ModuleFilePath, -const PrerequisiteModules &RequisiteModules) { -IntrusiveRefCntPtr Diags = - CompilerInstance::createDiagnostics(new DiagnosticOptions(

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [clang][NFC] Add test for CWG issues about linkage in cross-TU context (PR #113736)

2024-10-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: LGTM. Thanks https://github.com/llvm/llvm-project/pull/113736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Avoid allocations when reading blob paths (PR #113984)

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -1341,9 +1341,22 @@ class ASTReader serialization::InputFile getInputFile(ModuleFile &F, unsigned ID, bool Complain = true); + /// Buffer we use as temporary storage backing resolved paths. + SmallString<256> PathBuf;

[clang] [C++20] [Modules] Fix the duplicated static initializer problem (PR #114193)

2024-10-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 milestoned https://github.com/llvm/llvm-project/pull/114193 ___ 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-03 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-03 Thread Chuanqi Xu via cfe-commits
@@ -482,6 +482,42 @@ void func() { EXPECT_EQ(Result.signatures[0].parameters[0].labelString, "int a"); } +TEST_F(PrerequisiteModulesTests, ReusablePrerequisiteModulesTest) { ChuanqiXu9 wrote: Done by appending a new test. https://github.com/llvm/llvm-proje

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

2024-11-03 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > thanks I think this LG in terms of module-builder interfaces, but I think we > can make some more changes to implementation to ensure it's easier to > maintain going forward. > > speaking of maintenance, @HighCommander4 is definitely doing more of that > than me recently.

[clang] [RFC] [clang] [CodeGen] Avoid creating global variable repeatedly when type are not specified (PR #114948)

2024-11-05 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/114948 This comes from an internal crash. I know generally it is better to reproduce it first but I do feel the pattern is pretty risky. So I am wondering if we can discuss it first. So maybe this is more of a disc

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

2024-11-03 Thread Chuanqi Xu via cfe-commits
@@ -691,7 +691,7 @@ ensure it is reachable, e.g. ``using N::g;``. Support for Reduced BMIs is still experimental, but it may become the default in the future. The expected roadmap for Reduced BMIs as of Clang 19.x is: ChuanqiXu9 wrote: I looked up the dictionar

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

2024-11-03 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/3] [clangd] [Modules] Support Reusable Modules Builder --- cl

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

2024-11-03 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-03 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-03 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-03 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] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-11-03 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/114382 >From f33e3bcd7d31742a37059a9d75fa58aa4d9ff36d 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] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-11-03 Thread Chuanqi Xu via cfe-commits
@@ -556,6 +556,14 @@ def err_test_module_file_extension_format : Error< def err_drv_module_output_with_multiple_arch : Error< "option '-fmodule-output' can't be used with multiple arch options">; +def warn_drv_module_reduced_bmi_not_enabled : Warning< + "reduced BMI is expe

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

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

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

2024-11-05 Thread Chuanqi Xu via cfe-commits
@@ -691,7 +691,7 @@ ensure it is reachable, e.g. ``using N::g;``. Support for Reduced BMIs is still experimental, but it may become the default in the future. The expected roadmap for Reduced BMIs as of Clang 19.x is: ChuanqiXu9 wrote: Done as suggested. https

[clang] [RFC] [clang] [CodeGen] Avoid creating global variable repeatedly when type are not specified (PR #114948)

2024-11-05 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I think it's reasonable to do something similar here, but I believe the > change for that should be inside GetOrCreateLLVMGlobal, not in > GetAddrOfGlobalVar. The problem to make it in `GetOrCreateLLVMGlobal` is that the argument of `Ty` is not skippable. So the semantics

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

2024-10-30 Thread Chuanqi Xu via cfe-commits
@@ -85,19 +85,20 @@ class PrerequisiteModules { /// different versions and different source files. class ModulesBuilder { ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/106683 ___ cfe-commits mailin

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

2024-10-30 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] [clangd] [Modules] Support Reusable Modules Builder --- clang-

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

2024-10-30 Thread Chuanqi Xu via cfe-commits
@@ -85,19 +85,20 @@ class PrerequisiteModules { /// different versions and different source files. class ModulesBuilder { public: - ModulesBuilder(const GlobalCompilationDatabase &CDB) : CDB(CDB) {} + ModulesBuilder() = default; + virtual ~ModulesBuilder() = default; Mo

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

2024-10-30 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/2] [clangd] [Modules] Support Reusable Modules Builder --- cl

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

2024-10-30 Thread Chuanqi Xu via cfe-commits
@@ -338,17 +460,129 @@ ModulesBuilder::buildPrerequisiteModulesFor(PathRef File, return std::move(RequiredModules); } -bool StandalonePrerequisiteModules::canReuse( +ReusableModulesBuilder::ModuleBuildingSharedOwner +ReusableModulesBuilder::getOrCreateModuleBuildingOwner(Str

[clang-tools-extra] [clangd] [modules] Avoid building duplicated modules at the same time (PR #114365)

2024-10-30 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/114365 Following of https://github.com/llvm/llvm-project/pull/106683 In that, if we open multiple tabs importing the same module, we're going to build the same in the corresponding threads. This is not good. This p

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

2024-10-30 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] Add VFS to ASTUnit::LoadFromASTFile (PR #113879)

2024-10-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/113879 @kadircet mentioned in https://github.com/llvm/llvm-project/commit/448d8fa880be5cae0f63c3b248f07f647013a5a4#diff-fb3ba8a781117ff04736f951a274812cb7ad1678f9d71d4d91870b711ab45da0L285 that: > this is definite

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -338,17 +460,129 @@ ModulesBuilder::buildPrerequisiteModulesFor(PathRef File, return std::move(RequiredModules); } -bool StandalonePrerequisiteModules::canReuse( +ReusableModulesBuilder::ModuleBuildingSharedOwner +ReusableModulesBuilder::getOrCreateModuleBuildingOwner(Str

[clang-tools-extra] [clangd] [Modules] Add VFS to ASTUnit::LoadFromASTFile (PR #113879)

2024-10-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/113879 >From 3df5e9275a63ee9c51c4e9e9a77383a93be020a4 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 28 Oct 2024 15:54:37 +0800 Subject: [PATCH 1/2] [clangd] [Modules] Add VFS to ASTUnit::LoadFromASTFile ---

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -85,19 +85,20 @@ class PrerequisiteModules { /// different versions and different source files. class ModulesBuilder { public: - ModulesBuilder(const GlobalCompilationDatabase &CDB) : CDB(CDB) {} + ModulesBuilder() = default; + virtual ~ModulesBuilder() = default; Mo

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
@@ -85,19 +85,20 @@ class PrerequisiteModules { /// different versions and different source files. class ModulesBuilder { ChuanqiXu9 wrote: I didn't do it since in the last review, I was told we don't like forward declaration in clangd. And if we can do that,

[clang-tools-extra] [clangd] [Modules] Add VFS to ASTUnit::LoadFromASTFile (PR #113879)

2024-10-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: (Update too quickly) 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] Add VFS to ASTUnit::LoadFromASTFile (PR #113879)

2024-10-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/113879 >From 99e1989c3b2fad7702795a707d130fe96a93f42f Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 28 Oct 2024 15:54:37 +0800 Subject: [PATCH] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDa

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited 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-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > if you think that's fine, i think we can always create that astreader > directly here, without a compilerinstance as well. I like the idea more. (so I typed 'updated too quickly') The most important reason I did the previous change is, I think the compiler invocation and

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

2024-10-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited 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] [C++20] [Modules] Convert '-fexperimental-modules-reduced-bmi' to '-fmodules-reduced-bmi' (PR #114382)

2024-11-10 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I think the overall plan is fine, thanks for working on it! > > I think the idea of issuing a warning in order to get users to opt-in to a > flag is somewhat novel. Have I missed discussion about this approach, versus > simply changing the default? I originally mentioned i

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

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

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

2024-11-11 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +309,221 @@ 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-11 Thread Chuanqi Xu via cfe-commits
@@ -124,10 +164,34 @@ struct ModuleFile { llvm::sys::fs::remove(ModuleFilePath); } + StringRef getModuleName() const { return ModuleName; } + + StringRef getModuleFilePath() const { return ModuleFilePath; } + +private: std::string ModuleName; std::string Module

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

2024-11-11 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-11 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-11 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-11 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/5] [clangd] [Modules] Support Reusable Modules Builder --- cl

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

2024-11-11 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/5] [clangd] [Modules] Support Reusable Modules Builder --- cl

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

2024-11-11 Thread Chuanqi Xu via cfe-commits
@@ -316,36 +309,221 @@ 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-12 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/6] [clangd] [Modules] Support Reusable Modules Builder --- cl

[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-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-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-tools-extra] [clangd] [Modules] Support Reusable Modules Builder (PR #106683)

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

2024-11-12 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/7] [clangd] [Modules] Support Reusable Modules Builder --- cl

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

2024-11-12 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

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