[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-04-01 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Got it. I've renamed the flag as `-fexperimental-modules-reduced-bmi`. > > Thanks. > > > I feel the suggestion like let users to use `-Xclang` options look odd.. > > I think the point here is that we want **expert** users to try this out (with > understanding that it

[clang] [Modules] No transitive source location change (PR #86912)

2024-03-31 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > If Clang is configured with 64 bit `SourceLocation`, we can't use 96 bits > > for serialization. We can at most use 64 bits for a slot. In that case, we > > can only assume the offset of source location **in its own module** (not > > the global offset!) is not large than

[clang] [coroutine] Fix type of an ImplicitParamDecl used in generateAwaitSuspendWrapper (PR #87134)

2024-03-31 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: The change itself looks good to me. It will be better if we can have a reduced test case. https://github.com/llvm/llvm-project/pull/87134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-31 Thread Chuanqi Xu via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [C++20] [Modules] Implementing Eliding Unreachable Decls of GMF in ASTWriter (PR #76930)

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

[clang] [C++20] [Modules] Implementing Eliding Unreachable Decls of GMF in ASTWriter (PR #76930)

2024-03-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I took another review on this patch and it shows the patch itself is not so correct. The idea of the patch is to skip GMF at first and start to write the module from the module purview directly. Then everything unused in GMF is not used. This seems fine. However, in the

[clang] abfc5ef - [NFC] [Decl] Introduce Decl::isFromExplicitGlobalModule

2024-03-29 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-29T16:21:02+08:00 New Revision: abfc5efb55267689f1852fd7ce3e0a38876aa259 URL: https://github.com/llvm/llvm-project/commit/abfc5efb55267689f1852fd7ce3e0a38876aa259 DIFF: https://github.com/llvm/llvm-project/commit/abfc5efb55267689f1852fd7ce3e0a38876aa259.diff

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-29 Thread Chuanqi Xu via cfe-commits
@@ -338,6 +409,69 @@ static QualType getCoroutineSuspendExprReturnType(const ASTContext , } #endif +llvm::Function * +CodeGenFunction::generateAwaitSuspendWrapper(Twine const , + Twine const , +

[clang] 235d684 - [C++20] [Modules] [Reduced BMI] Don't record declarations in functions

2024-03-29 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-29T14:21:45+08:00 New Revision: 235d6841601a9dbea293b8e82b0c994f91f42d76 URL: https://github.com/llvm/llvm-project/commit/235d6841601a9dbea293b8e82b0c994f91f42d76 DIFF: https://github.com/llvm/llvm-project/commit/235d6841601a9dbea293b8e82b0c994f91f42d76.diff

[clang] [Modules] No transitive source location change (PR #86912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Yes, I explained this in Some low level details section. The size of source > > location won't be affected. Since the size of source location is unsigned > > (practically, it is 32 bits in most platforms). And we use uint64_t as a > > unit in the serializer. So there are

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
@@ -60,11 +63,11 @@ int use() { // CHECK-NOT: @_ZTSW3Mod4Base = constant // CHECK-NOT: @_ZTIW3Mod4Base = constant -// CHECK: @_ZTVW3Mod4Base = external unnamed_addr +// CHECK: @_ZTVW3Mod4Base = external -// CHECK-INLINE: @_ZTVW3Mod4Base = linkonce_odr {{.*}}unnamed_addr

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
@@ -1483,10 +1483,15 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) { if (D->isThisDeclarationADefinition()) Record.AddCXXDefinitionData(D); - // Store (what we currently believe to be) the key function to avoid - // deserializing every method so we can

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
@@ -41,9 +43,10 @@ Base::~Base() {} // CHECK: @_ZTSW3Mod4Base = constant // CHECK: @_ZTIW3Mod4Base = constant -// CHECK-INLINE: @_ZTVW3Mod4Base = linkonce_odr {{.*}}unnamed_addr constant -// CHECK-INLINE: @_ZTSW3Mod4Base = linkonce_odr {{.*}}constant -// CHECK-INLINE:

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/75912 >From 7399d2417a4b758fa0a98da1f99f3b4ec0eb1046 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 19 Dec 2023 17:00:59 +0800 Subject: [PATCH 1/2] [C++20] [Modules] [Itanium ABI] Generate the vtable in the

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-03-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/85050 >From b46c8fa030deb980c1550edc0ff8510d4e3c4e17 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 12 Mar 2024 17:26:49 +0800 Subject: [PATCH 1/3] [C++20] [Modules] Introduce -fgen-reduced-bmi ---

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

2024-03-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Got it. I've renamed the flag as `-fexperimental-modules-reduced-bmi`. I feel the suggestion like let users to use `-Xclang` options look odd.. --- > What do you mean by "symmetric"? I mean, we always want the users to do something explicitly to enable the feature. But

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fmodules-reduced-bmi (PR #85050)

2024-03-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/85050 >From b46c8fa030deb980c1550edc0ff8510d4e3c4e17 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 12 Mar 2024 17:26:49 +0800 Subject: [PATCH 1/3] [C++20] [Modules] Introduce -fgen-reduced-bmi ---

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > By default, `SourceLocation` is 32 bits. One bit is used to distinguish macro > expansions. Looking at libc++'s module map, it contains 999 top-level modules > at this moment. That's 10 bits just to be able to import the (entire) > standard library. That leaves 21 bits,

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: BTW, after this patch, with reduced BMI (https://github.com/llvm/llvm-project/pull/85050), we can already do something more interesting than reformating: ``` //--- A.cppm export module A; int funcA0(); int funcA1(); export int funcA() { return funcA0(); } //---

[clang] [C++20] [Modules] [Itanium ABI] Generate the vtable in the module unit of dynamic classes (PR #75912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @rjmccall @dwblaikie ping https://github.com/llvm/llvm-project/pull/75912 ___ 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] Introduce initial support for C++20 Modules (PR #66462)

2024-03-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @sam-mccall any updates? https://github.com/llvm/llvm-project/pull/66462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

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

[clang] [Modules] No transitive source location change (PR #86912)

2024-03-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/86912 >From 8d4e349710f4ca84a7ad2dd8aa71afa50b730dbb Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 18 Mar 2024 08:36:55 +0800 Subject: [PATCH] [Modules] No transitive source location change ---

[clang] [llvm] [Modules] No transitive source location change (PR #86912)

2024-03-27 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/86912 None >From 9046d2156cb8641cccf76c643b6f88994105f452 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Mon, 18 Mar 2024 08:36:55 +0800 Subject: [PATCH] [Modules] No transitive source location change ---

[clang] [C++20] [Modules] Introduce -fmodules-reduced-bmi (PR #85050)

2024-03-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > @iains @dwblaikie Understood. And I thought the major problem is that > > > > there are a lot flags from clang modules. And it is indeed confusing. > > > > But given we have to introduce new flags in this case, probably we can > > > > only try to make it more clear

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-26 Thread Chuanqi Xu via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [C++20] [Modules] Introduce -fmodules-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fmodules-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Do I miss something? The performance and file size is similar with and > without `-fgen-reduced-bmi`. To reproduce clone > https://github.com/koplas/clang-modules-test and run `build.sh` and > `build_thin_bmi.sh`. Currently, the Reduced BMI will only remove function

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Using `-fgen-reduced-bmi` currently fails for me with a case that looks like > this: > > ```c++ > // a.hpp > template > void ignore(T const &) noexcept {} > > inline void resultCheck(char const *message) { > ignore(message); > } > > // b.cppm >

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: @iains @dwblaikie Understood. And I thought the major problem is that there are a lot flags from clang modules. And it is indeed confusing. But given we have to introduce new flags in this case, probably we can only try to make it more clear by better documents.

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-25 Thread Chuanqi Xu via cfe-commits
@@ -3031,6 +3032,11 @@ defm skip_odr_check_in_gmf : BoolOption<"f", "skip-odr-check-in-gmf", "Perform ODR checks for decls in the global module fragment.">>, Group; +def gen_reduced_bmi : Flag<["-"], "fgen-reduced-bmi">, ChuanqiXu9 wrote: Done

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-25 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,53 @@ +// It is annoying to handle different slash direction +// in Windows and Linux. So we disable the test on Windows +// here. +// REQUIRES: !system-windows ChuanqiXu9 wrote: Done https://github.com/llvm/llvm-project/pull/85050

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-25 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/85050 >From 5fcccd75d0823ff11a4e385565cad65034d0def7 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 12 Mar 2024 17:26:49 +0800 Subject: [PATCH 1/2] [C++20] [Modules] Introduce -fgen-reduced-bmi ---

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-25 Thread Chuanqi Xu via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-03-25 Thread Chuanqi Xu via cfe-commits
@@ -761,6 +761,13 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { } } + // FIXME: Hack: We're out of bits in FunctionDeclBits, so always + // add this even though it's 0 in the vast majority of cases. We + // might really want to consider storing this in

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-22 Thread Chuanqi Xu via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-22 Thread Chuanqi Xu via cfe-commits
@@ -418,39 +448,60 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema , VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); - CallExpr *AwaitSuspend = cast_or_null( - BuildSubExpr(ACT::ACT_Suspend, "await_suspend", CoroHandle));

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-22 Thread Chuanqi Xu via cfe-commits
@@ -339,6 +339,9 @@ Bug Fixes in This Version - Fixes an assertion failure on invalid code when trying to define member functions in lambdas. +- Clang now emits errors for coroutine `await_suspend` functions whose return type is not + one of `void`, `bool`, or

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type is a `std::coroutine_handle` (PR #85684)

2024-03-22 Thread Chuanqi Xu via cfe-commits
@@ -358,6 +364,30 @@ static Expr *maybeTailCall(Sema , QualType RetType, Expr *E, return S.MaybeCreateExprWithCleanups(JustAddress); } +static bool isSpecializationOfCoroutineHandle(Sema , QualType Ty, + SourceLocation Loc) { +

[clang] [clang] Improves -print-library-module-manifest-path. (PR #85943)

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

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > I am confused. If we don't need to check whether a type can be converted to > > std::coroutine_handle, why do we still need EvaluateBinaryTypeTraits or > > similar things. > > I thought your previous comment was to show concern about exposing >

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-20 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > In SemaExprCXX.cpp there's EvaluateBinaryTypeTraits that I needed to expose > as suggested by the comment in SemaCoroutine. Is there an alternative way to > do type coercion/equivalence checks? I am confused. If we don't need to check whether a type can be converted to

[clang] [clang][frontend] Make DumpModuleInfoAction emit the full macro (PR #85745)

2024-03-20 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Dumping things from the source location makes me nervous... And giving this is not related to named modules, I'd like to leave this for @Bigcheese https://github.com/llvm/llvm-project/pull/85745 ___

[clang] [llvm] [Coroutines] Drop dead instructions more aggressively in addMustTailToCoroResumes() (PR #85271)

2024-03-20 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,65 @@ +// This tests that the symmetric transfer at the final suspend point could happen successfully. ChuanqiXu9 wrote: nit: I feel slightly better to add a link to the github page. https://github.com/llvm/llvm-project/pull/85271

[clang] [llvm] [Coroutines] Drop dead instructions more aggressively in addMustTailToCoroResumes() (PR #85271)

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

[clang] [llvm] [Coroutines] Drop dead instructions more aggressively in addMustTailToCoroResumes() (PR #85271)

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

[clang] Reland Print library module manifest path again (PR #84881)

2024-03-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > > > The file we're looking for is `modules.json`; Renaming it > > > > > `libc++.modules.json` like `.so` / `.a` file might be a better idea > > > > > which could avoid name clashes when installed in `/usr/lib`. > > > > > > > > > > > > but i didn't rename it, it was

[clang] [Clang] Coroutines: Properly Check if `await_suspend` return type convertible to `std::coroutine_handle<>` (PR #85684)

2024-03-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I am also ok with changing the patch to reject programs whose await_suspend > doesn't strictly return std::coroutine_handle if upstream prefers. It should be good to do that since it makes the behavior more conforming. And maybe it is better to do this a seperate patch.

[clang] Reland Print library module manifest path again (PR #84881)

2024-03-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > The file we're looking for is `modules.json`; Renaming it > > > `libc++.modules.json` like `.so` / `.a` file might be a better idea which > > > could avoid name clashes when installed in `/usr/lib`. > > > > > > but i didn't rename it, it was with the libc++ prefix

[clang] Reland Print library module manifest path again (PR #84881)

2024-03-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: /cherry-pick 0e1e1fc8f0e https://github.com/llvm/llvm-project/pull/84881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland Print library module manifest path again (PR #84881)

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

[clang] Reland Print library module manifest path again (PR #84881)

2024-03-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > The file we're looking for is `modules.json`; Renaming it > `libc++.modules.json` like `.so` / `.a` file might be a better idea which > could avoid name clashes when installed in `/usr/lib`. BTW, how do you feel about the paragraph. I thought it as a defect in some level.

[clang] Reland Print library module manifest path again (PR #84881)

2024-03-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'll backport this tomorrow if no revert request shows up. https://github.com/llvm/llvm-project/pull/84881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland Print library module manifest path again (PR #84881)

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

[clang] 2582965 - [C++20] [Modules] [Reduced BMI] Generate the function body from implicitly instantiated class and constant variables

2024-03-14 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-14T15:07:08+08:00 New Revision: 2582965c160486f9e3b0680f1cebc5ffdef9620c URL: https://github.com/llvm/llvm-project/commit/2582965c160486f9e3b0680f1cebc5ffdef9620c DIFF: https://github.com/llvm/llvm-project/commit/2582965c160486f9e3b0680f1cebc5ffdef9620c.diff

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/85050 >From e5114cdc6a77711dda6a13cbee9cd5cc42be48c6 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 12 Mar 2024 17:26:49 +0800 Subject: [PATCH] [C++20] [Modules] Introduce -fgen-reduced-bmi ---

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

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

[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

2024-03-13 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/85050 This is the driver part of https://github.com/llvm/llvm-project/pull/75894. This patch introduces '-fgen-reduced-bmi' to enable generating the reduced BMI. This patch did: - When `-fgen-reduced-bmi` is

[clang] 4d62929 - [C++20] [Modules] Disambuguous Clang module and C++20 Named module further

2024-03-12 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-13T13:57:52+08:00 New Revision: 4d62929852849f768d7397f634cfdebc85de96a4 URL: https://github.com/llvm/llvm-project/commit/4d62929852849f768d7397f634cfdebc85de96a4 DIFF: https://github.com/llvm/llvm-project/commit/4d62929852849f768d7397f634cfdebc85de96a4.diff

[clang] 5d7796e - [NFC] [C++20] [Modules] Refactor ReducedBMIGenerator

2024-03-12 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-13T11:22:32+08:00 New Revision: 5d7796e674224be54c48a8db981f4134845bcc7c URL: https://github.com/llvm/llvm-project/commit/5d7796e674224be54c48a8db981f4134845bcc7c DIFF: https://github.com/llvm/llvm-project/commit/5d7796e674224be54c48a8db981f4134845bcc7c.diff

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

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

[clang] Reland "[clang][modules] Print library module manifest path." (PR #82160)

2024-03-12 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I sent the new PR in https://github.com/llvm/llvm-project/pull/84881. See the comments there for details. https://github.com/llvm/llvm-project/pull/82160 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Reland Print library module manifest path again (PR #84881)

2024-03-12 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/84881 Following of https://github.com/llvm/llvm-project/pull/82160 The reason why the above PR fails is that the `--sysroot` has lower priority than the libc++ built from the same source. On the one hand, it

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-11 Thread Chuanqi Xu via cfe-commits
@@ -893,102 +889,118 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { if (Format == ScanningOutputFormat::Full) FD.emplace(ModuleName.empty() ? Inputs.size() : 0); - if (Verbose) { -llvm::outs() << "Running clang-scan-deps on " <<

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From 48b3261e1d217b7ce78180314a222dca4d6aba18 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/5] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From 48b3261e1d217b7ce78180314a222dca4d6aba18 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/4] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-11 Thread Chuanqi Xu via cfe-commits
@@ -744,6 +744,9 @@ getCompilationDataBase(int argc, char **argv, std::string ) { return nullptr; } + // Only 1 threads is required if P1689 per file mode. + NumThreads = 1; ChuanqiXu9 wrote: Oh, sorry. I don't know why I missed this somehow. This

[clang] [C++20] [Modules] Introduce a tool 'clang-named-modules-querier' and two plugins 'ClangGetUsedFilesFromModulesPlugin' and 'ClangGetDeclsInModulesPlugin' (PR #72956)

2024-03-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > ClangGetUsedFilesFromModulesPlugin > > This has a hole where if a currently-unused file is not listed, but it is > changed in such a way that it now matters (e.g., it changes include order, > adds/removes includes, etc.), we need to recompile consumers. > > > what

[clang] Reland "[clang][modules] Print library module manifest path." (PR #82160)

2024-03-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > @ChuanqiXu9 since you suggested this test approach It looks like that I failed to understand VE is under X86 also... > do you know whether this is the expected behavior of -sysroot ? I am not sure. This is surprising to me too. > The point is to build libraries and test

[clang] 0f501c3 - Revert "[C++20][Coroutines] Lambda-coroutine with operator new in promise_type (#84193)"

2024-03-11 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-11T17:02:43+08:00 New Revision: 0f501c30b9601627c236f9abca8a3befba5dc161 URL: https://github.com/llvm/llvm-project/commit/0f501c30b9601627c236f9abca8a3befba5dc161 DIFF: https://github.com/llvm/llvm-project/commit/0f501c30b9601627c236f9abca8a3befba5dc161.diff

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: This commit breaks our coroutines library async_simple `https://github.com/alibaba/async_simple` and here is a (relative) minimal reproducer: https://godbolt.org/z/sG5jzcGEz The reproducer comes from an implementation for async_simple::Generator

[clang] 3f6bc1a - [C++20] [Moduls] Avoid computing odr hash for functions from comparing constraint expression

2024-03-10 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-03-11T11:39:21+08:00 New Revision: 3f6bc1adf805681293c2ef0b93b708ff52244c00 URL: https://github.com/llvm/llvm-project/commit/3f6bc1adf805681293c2ef0b93b708ff52244c00 DIFF: https://github.com/llvm/llvm-project/commit/3f6bc1adf805681293c2ef0b93b708ff52244c00.diff

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

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

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

2024-03-10 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I'll merge this since I find you may not have commit access. https://github.com/llvm/llvm-project/pull/79712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Coroutines] lambda-coroutine with promise_type ctor. (PR #84519)

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

[clang] [llvm] [coroutine] Implement llvm.coro.await.suspend intrinsic (PR #79712)

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

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From dd9711be2368a299b408d0ff06ec9c1c0540083b Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/3] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
@@ -893,102 +889,118 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { if (Format == ScanningOutputFormat::Full) FD.emplace(ModuleName.empty() ? Inputs.size() : 0); - if (Verbose) { -llvm::outs() << "Running clang-scan-deps on " <<

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
@@ -893,102 +889,118 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { if (Format == ScanningOutputFormat::Full) FD.emplace(ModuleName.empty() ? Inputs.size() : 0); - if (Verbose) { -llvm::outs() << "Running clang-scan-deps on " <<

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
@@ -744,6 +744,9 @@ getCompilationDataBase(int argc, char **argv, std::string ) { return nullptr; } + // Only 1 threads is required if P1689 per file mode. + NumThreads = 1; ChuanqiXu9 wrote: Makes sense. Done.

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/84285 >From dd9711be2368a299b408d0ff06ec9c1c0540083b Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Thu, 7 Mar 2024 15:19:28 +0800 Subject: [PATCH 1/2] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread

[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

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

[clang] [NFC] [C++20] [Modules] [P1689] [Scanner] Don't use thread pool in P1689 per file mode (PR #84285)

2024-03-07 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/84285 I suddenly found that the clang scan deps may use all concurrent threads to scan the files. It makes sense in the batch mode. But in P1689 per file mode, it simply wastes times and resources. This patch

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM with the adding the comments. https://github.com/llvm/llvm-project/pull/84193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Chuanqi Xu via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this'

<    1   2   3   4   5   6   7   8   9   10   >