[clang-tools-extra] [clangd] [C++20 Modules] Try to use prebuilt modules (PR #155360)

2025-08-29 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Given its simplicity and usefulness, I'd like to land this in late of the next week if no more comments come in. https://github.com/llvm/llvm-project/pull/155360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [C++20][Modules] Add a test for field info assertion failure. (PR #155948)

2025-08-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 requested changes to this pull request. I think we need to merge it. Why do you think we don't need to merge it? https://github.com/llvm/llvm-project/pull/155948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang-tools-extra] f0dc266 - [NFC] [clangd] [C++20] [Modules] Improve logging message

2025-08-27 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-08-28T10:55:37+08:00 New Revision: f0dc2660997e9dc1dfb017951a1124c5db2e4c23 URL: https://github.com/llvm/llvm-project/commit/f0dc2660997e9dc1dfb017951a1124c5db2e4c23 DIFF: https://github.com/llvm/llvm-project/commit/f0dc2660997e9dc1dfb017951a1124c5db2e4c23.diff LO

[clang] 53d73c0 - [NFC] Remove out dated comment for clear-ast-before-backend

2025-08-26 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-08-26T16:15:18+08:00 New Revision: 53d73c0aa909e434b8572e3144f3ff5c8774ccf4 URL: https://github.com/llvm/llvm-project/commit/53d73c0aa909e434b8572e3144f3ff5c8774ccf4 DIFF: https://github.com/llvm/llvm-project/commit/53d73c0aa909e434b8572e3144f3ff5c8774ccf4.diff LO

[clang] [C++20][Modules] Use `MultiOnDiskHashTable` to improve the performance of header search algorithm. (PR #155350)

2025-08-25 Thread Chuanqi Xu via cfe-commits
@@ -157,15 +163,34 @@ template class MultiOnDiskHashTable { // FIXME: Don't rely on the OnDiskHashTable format here. auto L = InfoObj.ReadKeyDataLength(LocalPtr); const internal_key_type &Key = InfoObj.ReadKey(LocalPtr, L.first); -data_type_build

[clang] [C++20][Modules] Use `MultiOnDiskHashTable` to improve the performance of header search algorithm. (PR #155350)

2025-08-25 Thread Chuanqi Xu via cfe-commits
@@ -157,15 +163,34 @@ template class MultiOnDiskHashTable { // FIXME: Don't rely on the OnDiskHashTable format here. auto L = InfoObj.ReadKeyDataLength(LocalPtr); const internal_key_type &Key = InfoObj.ReadKey(LocalPtr, L.first); -data_type_build

[clang] [C++20][Modules] Use `MultiOnDiskHashTable` to improve the performance of header search algorithm. (PR #155350)

2025-08-25 Thread Chuanqi Xu via cfe-commits
@@ -373,6 +373,9 @@ class HeaderFileInfoTrait { ModuleFile &M; public: + // Maximum number of lookup tables we allow before condensing the tables. + static const int MaxTables = 64; ChuanqiXu9 wrote: Out of curiosity, is this tuned? Or is it set randomly?

[clang-tools-extra] d8709ae - [clangd] [C++20 Modules] Add --debug-modules-builder to not remove built module files on exit

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

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.is_in_ramp and drop return value of llvm.coro.end (PR #153404)

2025-08-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I reverted it as the failure seems relevent. https://github.com/llvm/llvm-project/pull/153404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.is_in_ramp and drop return value of llvm.coro.end (PR #153404)

2025-08-25 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I think you can apply for write access now. https://github.com/llvm/llvm-project/pull/153404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.is_in_ramp and drop return value of llvm.coro.end (PR #153404)

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

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-25 Thread Chuanqi Xu via cfe-commits
@@ -401,36 +432,85 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); + Calls.UseAwaitSuspendDestroy = false; CallExpr *AwaitSuspend = cast_or_null( BuildSubExpr(ACT::AC

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-24 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Hey folks, Thanks for the work. > > Please note that adding a new attribute should go through an RFC. I know > @yuxuanchen1997 proposed something in the same design space a while ago - but > we never seem to have reached consensus > https://discourse.llvm.org/t/language-ex

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-24 Thread Chuanqi Xu via cfe-commits
@@ -401,36 +432,85 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); + Calls.UseAwaitSuspendDestroy = false; CallExpr *AwaitSuspend = cast_or_null( BuildSubExpr(ACT::AC

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.is_in_ramp and drop return value of llvm.coro.end (PR #153404)

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

[clang] [llvm] Proofread DebuggingCoroutines.rst (PR #154681)

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

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-19 Thread Chuanqi Xu via cfe-commits
@@ -401,36 +432,85 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); + Calls.UseAwaitSuspendDestroy = false; CallExpr *AwaitSuspend = cast_or_null( BuildSubExpr(ACT::AC

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-19 Thread Chuanqi Xu via cfe-commits
@@ -401,36 +432,85 @@ static ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, return Calls; } Expr *CoroHandle = CoroHandleRes.get(); + Calls.UseAwaitSuspendDestroy = false; CallExpr *AwaitSuspend = cast_or_null( BuildSubExpr(ACT::AC

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-19 Thread Chuanqi Xu via cfe-commits
@@ -284,11 +284,41 @@ static ExprResult buildCoroutineHandle(Sema &S, QualType PromiseType, return S.BuildCallExpr(nullptr, FromAddr.get(), Loc, FramePtr, Loc); } +// To support [[clang::coro_await_suspend_destroy]], this builds +// *static_cast( +// __builtin_coro_

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-19 Thread Chuanqi Xu via cfe-commits
@@ -9363,6 +9363,126 @@ Example: }]; } +def CoroAwaitSuspendDestroyDoc : Documentation { + let Category = DocCatFunction; + let Content = [{ + +The ``[[clang::coro_await_suspend_destroy]]`` attribute applies to an +``await_suspend(std::coroutine_handle)`` member function of

[clang] [clang] Proofread StandardCPlusPlusModules.rst (PR #154474)

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

[clang] 2db239a - [C++20] [Modules] Improve the import-and-include pattern

2025-08-19 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-08-20T11:47:00+08:00 New Revision: 2db239acd1e4cb61e8c5c55dcc4b08c7d64919b6 URL: https://github.com/llvm/llvm-project/commit/2db239acd1e4cb61e8c5c55dcc4b08c7d64919b6 DIFF: https://github.com/llvm/llvm-project/commit/2db239acd1e4cb61e8c5c55dcc4b08c7d64919b6.diff LO

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-19 Thread Chuanqi Xu via cfe-commits
@@ -9363,6 +9363,126 @@ Example: }]; } +def CoroAwaitSuspendDestroyDoc : Documentation { + let Category = DocCatFunction; + let Content = [{ + +The ``[[clang::coro_await_suspend_destroy]]`` attribute applies to an +``await_suspend(std::coroutine_handle)`` member function of

[clang] [clang] fix redecl chain assumption when checking linkage consistency (PR #153996)

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

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > With lazy template loading, it is possible to find non-canonical > > > FunctionDecls > > > > > > But this may be concerning. Do you feel this may cause more problem? > > Of course this can result in more problems like the one fixed here. That is > the box we opened wi

[clang] [Sema] Compare canonical conversion function (PR #154158)

2025-08-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I don't feel bad for the patch itself. > With lazy template loading, it is possible to find non-canonical FunctionDecls But this may be concerning. Do you feel this may cause more problem? https://github.com/llvm/llvm-project/pull/154158 __

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-19 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Regarding the "no intrinsics" attribute discussion -- Let's discuss this later in other thread. It may be confusing to discuss two things in one thread especially for other readers. https://github.com/llvm/llvm-project/pull/152623 ___

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-18 Thread Chuanqi Xu via cfe-commits
@@ -9363,6 +9363,119 @@ Example: }]; } +def CoroAwaitSuspendDestroyDoc : Documentation { + let Category = DocCatFunction; + let Content = [{ + +The ``[[clang::coro_await_suspend_destroy]]`` attribute applies to an +``await_suspend(std::coroutine_handle)`` member function of

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-18 Thread Chuanqi Xu via cfe-commits
@@ -9363,6 +9363,119 @@ Example: }]; } +def CoroAwaitSuspendDestroyDoc : Documentation { + let Category = DocCatFunction; + let Content = [{ + +The ``[[clang::coro_await_suspend_destroy]]`` attribute applies to an +``await_suspend(std::coroutine_handle)`` member function of

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-18 Thread Chuanqi Xu via cfe-commits
@@ -5288,13 +5290,22 @@ class CoroutineSuspendExpr : public Expr { } CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty) : Expr(SC, Empty) { +CoroutineSuspendExprBits.UseAwaitSuspendDestroy = false; SubExprs[SubExpr::Operand] = nullptr; SubExprs[SubExpr::Com

[clang] [Coroutines] Allow [[clang::coro_wrapper]] for class (PR #93268)

2025-08-18 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Sorry for not responding earlier. This makes sense to me. Never mind. And also @snarkmaster , if you're interested, given now I don't work on the safety checks for coroutines, feel free to take this if you want. https://github.com/llvm/llvm-project/pull/93268 _

[clang-tools-extra] [clangd] Clangd running with `--experimental-modules-support` crashes when the compilation database is unavailable (PR #153802)

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

[clang] [clang] Allow trivial pp-directives before C++ module directive (PR #153641)

2025-08-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Thanks for fixing this. Will the fix end up in version 21? I think we need to backport this. https://github.com/llvm/llvm-project/pull/153641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] Allow trivial pp-directives before C++ module directive (PR #153641)

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

[clang] [Coroutines] Allow [[clang::coro_wrapper]] for class (PR #93268)

2025-08-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > @ChuanqiXu9, I just ran across this PR -- and I immediately wondered if it > could be used to improve stack-use-after-free checks for `folly::result` (the > short-circuiting coro you saw on my recent PR). > > Like the classes you mention in the PR description here, `folly::

[clang] [clang] fix redecl chain assumption when checking linkage consistency (PR #153996)

2025-08-17 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,22 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t +// +// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-module-interface -o %t/B.pcm +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -fprebuilt-module-path=%t %t/C.cpp + +//--- A.hpp +template struct A {};

[clang-tools-extra] [clangd] Clangd running with `--experimental-modules-support` crashes when the compilation database is unavailable (PR #153802)

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

[clang-tools-extra] [clangd] Clangd running with `--experimental-modules-support` crashes when the compilation database is unavailable (PR #153802)

2025-08-15 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: It will be better to have a test either in unittest like `clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp` or lit test like `clang-tools-extra/clangd/test/modules.test` https://github.com/llvm/llvm-project/pull/153802

[clang-tools-extra] [clangd] Clangd running with `--experimental-modules-support` crashes when the compilation database is unavailable (PR #153802)

2025-08-15 Thread Chuanqi Xu via cfe-commits
@@ -833,6 +833,8 @@ bool OverlayCDB::setCompileCommand(PathRef File, std::unique_ptr OverlayCDB::getProjectModules(PathRef File) const { auto MDB = DelegatingCDB::getProjectModules(File); + if (!MDB) +return {}; ChuanqiXu9 wrote: ```suggestion if (!MD

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.where and drop return value of llvm.coro.end (PR #153404)

2025-08-15 Thread Chuanqi Xu via cfe-commits
@@ -2117,6 +2118,30 @@ Example: %hdl.result = ... ; get address of returned coroutine handle ret ptr %hdl.result +'llvm.coro.is_in_resume' Intrinsic +^^ +:: + + declare i1 @llvm.coro.is_in_resume() + +Overview: +" +

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.where and drop return value of llvm.coro.end (PR #153404)

2025-08-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: Did a quick scanning. It looks good generally. https://github.com/llvm/llvm-project/pull/153404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.where and drop return value of llvm.coro.end (PR #153404)

2025-08-14 Thread Chuanqi Xu via cfe-commits
@@ -2117,6 +2118,30 @@ Example: %hdl.result = ... ; get address of returned coroutine handle ret ptr %hdl.result +'llvm.coro.where' Intrinsic +^^ +:: + + declare i1 @llvm.coro.where() + +Overview: +" + +The '``llvm.c

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.where and drop return value of llvm.coro.end (PR #153404)

2025-08-14 Thread Chuanqi Xu via cfe-commits
@@ -2117,6 +2118,30 @@ Example: %hdl.result = ... ; get address of returned coroutine handle ret ptr %hdl.result +'llvm.coro.where' Intrinsic +^^ +:: + + declare i1 @llvm.coro.where() ChuanqiXu9 wrote: I pr

[clang] [llvm] [mlir] [Coroutines] Add llvm.coro.where and drop return value of llvm.coro.end (PR #153404)

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

[clang] ab5a5a9 - [C++20] [Modules] Fix incorrect diagnostic for using befriend target

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

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Thanks! One more question @ChuanqiXu9 -- I now have a [pile of smallish > fixes](https://github.com/llvm/llvm-project/pull/152623#issuecomment-3177095986) > to make. Are you still thinking about the overall design of this PR, or > should I go ahead and polish it up for merg

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > My current IR test verifies that there's no heap alloc across a few examples. > Were you thinking of a different kind of test? Can you be very specific since > I'm totally new to LLVM? I mean to add a test for https://github.com/llvm/llvm-project/issues/148380 to show we c

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-11 Thread Chuanqi Xu via cfe-commits
@@ -174,6 +174,66 @@ static bool StmtCanThrow(const Stmt *S) { return false; } +// Check if this suspend should be calling `await_suspend_destroy` +static bool useCoroAwaitSuspendDestroy(const CoroutineSuspendExpr &S) { + // This can only be an `await_suspend_destroy` suspe

[clang] [libcxx] Elide suspension points via [[clang::coro_await_suspend_destroy]] (PR #152623)

2025-08-08 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > @ChuanqiXu9, > > (1) I'm not actually changing `libc++`. I just added an end-to-end test for > this compiler feature. It's backwards- and forwards-compatible, so I don't > think there's any risk to bundling it with this PR. This is not about risks. It is simply about devel

[clang] [llvm] [clang][CodeGen] Extends lifetime of coroutine promise(CWG2563) (PR #151067)

2025-08-06 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Could elaborate it? Especially why it is safe to not lower coro.end to ret > > void? > > The idea is: if we lower `coro.end` to `ret void`, users of `coro.end` will > become unreachable. Thus, I assume that if the frontend uses the return value > of `coro.end`, the inten

[clang] ee6afeb - [NFC] [C++20] [Modules] Lookup in cache before checking if the primary template is an exposure

2025-08-05 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-08-06T10:00:03+08:00 New Revision: ee6afeb72ef2cee918c1338c926c481ad36aa915 URL: https://github.com/llvm/llvm-project/commit/ee6afeb72ef2cee918c1338c926c481ad36aa915 DIFF: https://github.com/llvm/llvm-project/commit/ee6afeb72ef2cee918c1338c926c481ad36aa915.diff LO

[clang-tools-extra] [clang-tidy][docs][NFC] Add limitation of variable lifetimes in performance-unnecessary-copy-initialization (PR #151862)

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

[clang] [llvm] [clang][CodeGen] Extends lifetime of coroutine promise(CWG2563) (PR #151067)

2025-07-31 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I don't understand this: > Do not lower coro.end to ret void if its return value will be used. This > allows front end separate coro start section and resume section without early > return from resume function. Could elaborate it? Especially why it is safe to not lower `co

[clang] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce generted code size (PR #151074)

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

[clang] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce generted code size (PR #151074)

2025-07-29 Thread Chuanqi Xu via cfe-commits
@@ -13,11 +13,12 @@ #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTMutationListener.h" -#include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/DynamicRecursiveASTVisitor.h" #include "clang/Lex/HeaderSearch.h" #include "clang/Lex/Preprocessor.h" #include

[clang] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce generted code size (PR #151074)

2025-07-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/151074 >From 86b334ad710dcb622f63d4040096416ef10022b6 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 29 Jul 2025 10:23:33 +0800 Subject: [PATCH 1/2] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to re

[clang] [clang][test] Require staticanalyzer for Modules/specializations-lazy-load-parentmap-crash.cpp (PR #151259)

2025-07-29 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. It will be better if you can split it. It can be achieved by copying the test and remove the corresponding `RUN` lines. But I don't feel bad if you want to commit it as is since I believe the test may still be covered in a lot of

[clang] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce generted code size (PR #151074)

2025-07-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/151074 >From 86b334ad710dcb622f63d4040096416ef10022b6 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Tue, 29 Jul 2025 10:23:33 +0800 Subject: [PATCH] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce

[clang] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce generted code size (PR #151074)

2025-07-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: I didn't use `function_ref` as it seems not safe to store functions. https://github.com/llvm/llvm-project/pull/151074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [Sema] [Modules] Use DynamicRecursiveASTVisitor to reduce generted code size (PR #151074)

2025-07-28 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 created https://github.com/llvm/llvm-project/pull/151074 It is better to use DynamicRecursiveASTVisitor than RecursiveASTVisitor as it can reduce the generated size. And also avoid using a template type to present callbacks to avoid generating more code too. >Fro

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Thank you @hahnjo very much for the hint. I had wrongly assumed this is > coming from the commit metadata. > > I just changed the setting. Let me know if it still doesn't work. > > Thanks again to you all... Thank you for looking into this : ) https://github.com/llvm/llvm

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

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

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > I am a bit confused where this comes from. The correct email address is also > shown on the commit: > https://api.github.com/repos/llvm/llvm-project/commits/c3cf089fb721a52993c42d0fe18547685d8badb6 I don't know either. But I feel you can search it. I feel the github is tryi

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > > Hi @ChuanqiXu9, could you please clarify the request to "update the > > > mail"? I've double-checked that the commit author is currently set to my > > > email, and I can't see any github autogenerated email addresses on the > > > commit metdata. > > > I want to make sur

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-28 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Hi @ChuanqiXu9, could you please clarify the request to "update the mail"? > I've double-checked that the commit author is currently set to my email, and > I can't see any github autogenerated email addresses on the commit metdata. > > I want to make sure I understand what

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

2025-07-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > Would you like to give a brief introduction for your design. I didn't > > figure it out. > > * The function signature of `__builtin_lambda_this()` is `void*()`. > * Sema part: if it is a non-staic lambda expression (similar with this PR), > create an expression `static_ca

[clang] 1b4db78 - [C++20] [Modules] Implement diagnose for exposured partially

2025-07-27 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-07-28T09:58:38+08:00 New Revision: 1b4db78d2eaa070b3f364a2d2b2b826a5439b892 URL: https://github.com/llvm/llvm-project/commit/1b4db78d2eaa070b3f364a2d2b2b826a5439b892 DIFF: https://github.com/llvm/llvm-project/commit/1b4db78d2eaa070b3f364a2d2b2b826a5439b892.diff LO

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

2025-07-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Hi. I tried to fix this issue locally by adding a function > `__builtin_lambda_this()` and it seems to work. I can create PR if you think > this is a good approach. And I have some questions: > > 1. Should this builtin function handle lambda expression only? What about > `

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-27 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > Thank you all for the reviews. I don’t have commit access, so I’ll need > someone to merge this for me eventually. I’ll be away for the next week and > won’t be able to respond to any regressions or follow-ups during that time. > > If you’re comfortable merging it as is, pl

[clang] [Serialization] Fix crash while lazy-loading template specializations (PR #150430)

2025-07-24 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Thanks for looking into this. https://github.com/llvm/llvm-project/pull/150430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] 255a163 - [C++20] [Modules] Enable reduced BMI by default

2025-07-21 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-07-21T18:57:38+08:00 New Revision: 255a163e5183082016402ac51db83e10c1f5a731 URL: https://github.com/llvm/llvm-project/commit/255a163e5183082016402ac51db83e10c1f5a731 DIFF: https://github.com/llvm/llvm-project/commit/255a163e5183082016402ac51db83e10c1f5a731.diff LO

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   3   4   5   6   7   8   9   10   >