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

2024-12-14 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > I still feel it would be simpler to lookup the function for `await_suspend` > in the awaiter and look for its return type. Then we don't need to care about > the type of the expression. After reading a bit, I think it's possible to do this by duplicating a little bit o

[clang] Temporarily disable test `clang/Interpreter/crash.cpp` (PR #119978)

2024-12-14 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/119978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Temporarily disable test `clang/Interpreter/crash.cpp` (PR #119978)

2024-12-14 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: May I understand what's the intention of this? I would prefer that the original author figures out a solution that doesn't depend on system linker, which is what I would consider a proper fix. https://github.com/llvm/llvm-project/pull/119978 __

[clang] Temporarily disable test `clang/Interpreter/crash.cpp` (PR #119978)

2024-12-14 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/119978 See discussion on https://github.com/llvm/llvm-project/pull/117475#issuecomment-2543223954 This test currently invokes the system ld, which can cause issues on some CI systems where system ld only works

[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)

2024-12-14 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > @SahilPatidar, could you help us with this? Can we temporarily disable this test when @SahilPatidar is looking for a solution? https://github.com/llvm/llvm-project/pull/117475 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)

2024-12-13 Thread Yuxuan Chen via cfe-commits
@@ -0,0 +1,20 @@ +// REQUIRES: host-supports-jit, x86_64-linux + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// +// RUN: split-file %s %t +// +// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o +// RUN: %clang++ -shared %t/vec.o -o %t/vec.so yuxuanchen1997 w

[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)

2024-12-13 Thread Yuxuan Chen via cfe-commits
@@ -0,0 +1,20 @@ +// REQUIRES: host-supports-jit, x86_64-linux + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// +// RUN: split-file %s %t +// +// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o +// RUN: %clang++ -shared %t/vec.o -o %t/vec.so yuxuanchen1997 w

[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)

2024-12-13 Thread Yuxuan Chen via cfe-commits
@@ -0,0 +1,20 @@ +// REQUIRES: host-supports-jit, x86_64-linux + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// +// RUN: split-file %s %t +// +// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o +// RUN: %clang++ -shared %t/vec.o -o %t/vec.so yuxuanchen1997 w

[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)

2024-12-13 Thread Yuxuan Chen via cfe-commits
@@ -0,0 +1,20 @@ +// REQUIRES: host-supports-jit, x86_64-linux + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// +// RUN: split-file %s %t +// +// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o +// RUN: %clang++ -shared %t/vec.o -o %t/vec.so +// +// RUN: cat %t/Test.cpp | LD

[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)

2024-12-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/117475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (PR #117475)

2024-12-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 commented: I landed my previous fix but I found that this test to be more problematic than I originally anticipated. I left some comments. I may send more patches to fix it until I am satisfied. https://github.com/llvm/llvm-project/pull/117475 ___

[clang] [Clang] Interpreter test should not depend on system header (PR #119903)

2024-12-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/119903 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Interpreter test should not depend on system header (PR #119903)

2024-12-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/119903 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Interpreter test should not depend on system header (PR #119903)

2024-12-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/119903 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] test should not depend on system header (PR #119903)

2024-12-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/119903 >From 449459edf130c842d57b672799927f158f0b92cb Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Fri, 13 Dec 2024 09:09:14 -0800 Subject: [PATCH] [clang] test should not depend on system header --- clang

[clang] [clang] test should not depend on system header (PR #119903)

2024-12-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/119903 https://github.com/llvm/llvm-project/commit/30ad53b92cec0cff9679d559edcc5b933312ba0c introduced a new test that includes from the system include path without honoring environment variables that may prov

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

2024-12-10 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/85684 >From b843c2f71a1a43cb897b557f783d60c6bf26f687 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 18 Mar 2024 10:45:20 -0700 Subject: [PATCH] Check if Coroutine await_suspend type returns the right type

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

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

[clang] [Clang][NFC] Refactor suspend emit logic in coroutine codegen (PR #73564)

2024-12-10 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/73564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] C++ Templates: Refactor and fix `TransformLambdaExpr`'s mishandling of TypeLocs (PR #78801)

2024-12-10 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/78801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-10 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/118522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > > > so we don't need to carry around multiple implementations of > > > machine-readable diagnostic information. > > > > > > I just realized that we also have `-diagnostic-log-file` as a cc1 flag. > > This logs into an XML. Is this preferred to the binary format or no?

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > so we don't need to carry around multiple implementations of machine-readable > diagnostic information. I just realized that we also have `-diagnostic-log-file` as a cc1 flag. This logs into an XML. Is this preferred to the binary format or no? https://github.com/llvm

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-06 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > I'd like to understand the motivation for the tool a bit better. IMO, the > goal should be to deprecate serialized diagnostics because we are now able to > emit diagnostics to SARIF instead, and the whole point to SARIF is to be a > machine-readable interchange format f

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 01/12] start working on the new tool --- .../clang-read-dia

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > > Looking at the test failure, it appears that when only building > > `check-clang-tools`, no `clang` binary was built. So the test driver cannot > > find `clang`. Maybe this diagnostics binary file should be checked in for > > the test? That will not catch future error

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 01/11] start working on the new tool --- .../clang-read-dia

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 01/10] start working on the new tool --- .../clang-read-dia

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-04 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: Looking at the test failure, it appears that when only building `check-clang-tools`, no `clang` binary was built. So the test driver cannot find `clang`. Maybe this diagnostics binary file should be checked in for the test? That will not catch future errors if the diagnos

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 1/8] start working on the new tool --- .../clang-read-diagn

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 1/7] start working on the new tool --- .../clang-read-diagn

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
@@ -0,0 +1,10 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) yuxuanchen1997 wrote: Oops... Copied from a boilerplate. https://github.com/llvm/llvm-project/pull/118522 ___ cfe-commits mailing list cfe-commits@

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/118522 >From 5860f5f25e04930c72dcdb9f0ee4d7386cbcb3d3 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Mon, 2 Dec 2024 15:15:30 -0800 Subject: [PATCH 1/6] start working on the new tool --- .../clang-read-diagn

[clang-tools-extra] Add new tool: clang-read-diagnostics (PR #118522)

2024-12-03 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/118522 As of today, one can make clang serialize diagnostics to a file with the flag `-serialize-diagnostics`. For example: ``` // file errors_and_warning.c #include int forgot_return() {} int main() { pri

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

2024-09-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/108474 >From c32b36e249cb1062cc05618181bf4cb4fdcd2133 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Thu, 12 Sep 2024 17:13:57 -0700 Subject: [PATCH] [Clang] Propagate elide safe context through [[clang::coro

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

2024-09-16 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-16 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-16 Thread Yuxuan Chen via cfe-commits
@@ -84,4 +84,35 @@ Task nonelidable() { co_return 1; } +// CHECK-LABEL: define{{.*}} @_Z8addTasksO4TaskIiES1_{{.*}} { +Task addTasks([[clang::coro_must_await]] Task &&t1, Task &&t2) { + int i1 = co_await t1; + int i2 = co_await t2; + co_return i1 + i2; +} + +// CHECK-LABE

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

2024-09-16 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/108474 >From a1783d336a915c64af3533566b470ac3d55e4297 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Thu, 12 Sep 2024 17:13:57 -0700 Subject: [PATCH] [Clang] Propagate elide safe context through [[clang::coro

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

2024-09-16 Thread Yuxuan Chen via cfe-commits
@@ -880,14 +898,12 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - bool AwaitElidable = - isCoroAwaitElidableCall(Operand) && - isAttributedCoroAwaitElidable( -

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

2024-09-16 Thread Yuxuan Chen via cfe-commits
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation { The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied to a coroutine return type. -When a coroutine function that returns such a type calls another coroutine function, -the compiler

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

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

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

2024-09-15 Thread Yuxuan Chen via cfe-commits
@@ -880,14 +898,12 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - bool AwaitElidable = - isCoroAwaitElidableCall(Operand) && - isAttributedCoroAwaitElidable( -

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

2024-09-15 Thread Yuxuan Chen via cfe-commits
@@ -8261,12 +8261,19 @@ def CoroAwaitElidableDoc : Documentation { The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applied to a coroutine return type. -When a coroutine function that returns such a type calls another coroutine function, -the compiler

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

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

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

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

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

2024-09-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 ready_for_review https://github.com/llvm/llvm-project/pull/108474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/108474 >From dc6239934105cad1f90b7b6185e6bfa8f30d5544 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Thu, 12 Sep 2024 17:13:57 -0700 Subject: [PATCH] [Clang] Propagate elide safe context through [[clang::coro

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

2024-09-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/108474 >From 73e3d278eca1c9b47cb9c6aa436a82d495d03f83 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Thu, 12 Sep 2024 17:13:57 -0700 Subject: [PATCH] [Clang] Propagate elide safe context through [[clang::coro

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

2024-09-13 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/108474 >From b2cd6f3e0bd1b3aefa84c7d733d1119303551d42 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Thu, 12 Sep 2024 17:13:57 -0700 Subject: [PATCH] [Clang] Propagate elide safe context through [[clang::coro

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

2024-09-12 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/108474 None >From a4736c1effa479692157dbe735fa873b233f98bd Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Thu, 12 Sep 2024 17:13:57 -0700 Subject: [PATCH] [Clang] Propagate elide safe context through [[clang

[clang] [llvm] [LLVM][Coroutines] Transform "coro_elide_safe" calls to switch ABI coroutines to the `noalloc` variant (PR #99285)

2024-09-09 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: Fix-forward for this patch: https://github.com/llvm/llvm-project/pull/107897 https://github.com/llvm/llvm-project/pull/99285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [llvm] [LLVM][Coroutines] Transform "coro_elide_safe" calls to switch ABI coroutines to the `noalloc` variant (PR #99285)

2024-09-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/99285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Coroutines] Transform "coro_elide_safe" calls to switch ABI coroutines to the `noalloc` variant (PR #99285)

2024-09-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/99285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Coroutines] Create `.noalloc` variant of switch ABI coroutine ramp functions during CoroSplit (PR #99283)

2024-09-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/99283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][Coroutines] Create `.noalloc` variant of switch ABI coroutine ramp functions during CoroSplit (PR #99283)

2024-09-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/99283 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From c47f9218c5672f6cb38492b692114da2976b Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[cla

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

2024-08-28 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From ef2b868666579df534d63daeebd2b201600ce292 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[cla

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

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

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

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

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

2024-08-27 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From 7c350747d4481e0d95c51ac2a157809fa630d188 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] C++20 Coroutines: Introduce Frontend Attribute [[cla

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

2024-08-26 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: Hello! Requesting upstream to take a look again as I believe all feedback at the moment has been addressed. Please let me know if I still miss anything. https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing lis

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

2024-08-22 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From 9c8163db0df6f3d89f32239fbbd6dd47f5eec1a6 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-08-20 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From 92966fb0939574c78ccfd6b9a7b38035dae9d2e7 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

[clang] [Clang] Fix ICE in SemaOpenMP with structured binding (PR #104822)

2024-08-19 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/104822 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix ICE in SemaOpenMP with structured binding (PR #104822)

2024-08-19 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/104822 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix ICE in SemaOpenMP with structured binding (PR #104822)

2024-08-19 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/104822 Fixes https://github.com/llvm/llvm-project/issues/104810. Clang currently crashes on the following program: ``` struct S { int i; }; auto [a] = S{1}; void foo() { a; } ``` when `-fopenmp` is enabl

[clang] [libcxx] [Clang] Implement CWG2137 (list-initialization from objects of the same type) (PR #94355)

2024-08-09 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: A noob question but I wanted to make sure that this patch actually intended to reject program like this one? ``` #include #include class K { public: template K(const std::vector& v) { static_assert(!std::is_same::value, "Error!"); } }; void foo(std::vector&

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

2024-08-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 reopened https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-08 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From 5578fde5d3225b24d5e8b140f2654ed8075eec92 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 deleted https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -848,7 +862,21 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - auto *Transformed = Operand; + bool InplaceCall = + isCoroInplaceCall(Operand) && + isAttributedCoroInp

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -1217,6 +1217,14 @@ def CoroDisableLifetimeBound : InheritableAttr { let SimpleHandler = 1; } +def CoroAwaitElidable : InheritableAttr { yuxuanchen1997 wrote: I am adding this ``` - Introduced a new attribute ``[[clang::coro_await_elidable]]`` on corout

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -8119,6 +8119,35 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -5443,24 +5444,38 @@ RValue CodeGenFunction::EmitRValueForField(LValue LV, //======// RValue CodeGenFunction::EmitCallExpr(const CallExpr *E, - ReturnValueSlot ReturnValu

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -848,7 +862,21 @@ ExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, } auto *RD = Promise->getType()->getAsCXXRecordDecl(); - auto *Transformed = Operand; + bool InplaceCall = + isCoroInplaceCall(Operand) && + isAttributedCoroInp

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -1217,6 +1217,14 @@ def CoroDisableLifetimeBound : InheritableAttr { let SimpleHandler = 1; } +def CoroAwaitElidable : InheritableAttr { yuxuanchen1997 wrote: Will do. https://github.com/llvm/llvm-project/pull/99282

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

2024-08-07 Thread Yuxuan Chen via cfe-commits
@@ -15,6 +15,7 @@ #include "CoroutineStmtBuilder.h" #include "clang/AST/ASTLambda.h" +#include "clang/AST/ComputeDependence.h" yuxuanchen1997 wrote: Sorry. Seems like an IDE auto include. https://github.com/llvm/llvm-project/pull/99282 _

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

2024-07-31 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From 55e27fdace4dabc0748c20ae5271b735dcc22e3e Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-07-30 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From 8d9c2cc4313a36058ef2ac29bd9e3cd33603da10 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-07-30 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From c6e8d1f1a98174b8ca7d2f94a51d9a245eae58eb Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-07-30 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From eb1b3560a0ed3ab14f07997cbc37158496a03343 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-07-30 Thread Yuxuan Chen via cfe-commits
@@ -8108,6 +8108,24 @@ but do not pass them to the underlying coroutine or pass them by value. }]; } +def CoroAwaitElidableDoc : Documentation { + let Category = DocCatDecl; + let Content = [{ +The ``[[clang::coro_await_elidable]]`` is a class attribute which can be applie

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

2024-07-25 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From 5aa5ba4d768c09663acdb394b9485bc2362a217a Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-07-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 edited https://github.com/llvm/llvm-project/pull/99282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 updated https://github.com/llvm/llvm-project/pull/99282 >From dfb903c47573a01c25a67ea1025fdc3c268673c8 Mon Sep 17 00:00:00 2001 From: Yuxuan Chen Date: Tue, 4 Jun 2024 23:22:00 -0700 Subject: [PATCH] [Clang] Introduce [[clang::coro_await_elidable]] --- clang/

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

2024-07-17 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: Deprecated in favor of https://github.com/llvm/llvm-project/pull/99282 https://github.com/llvm/llvm-project/pull/98971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

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

2024-07-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 closed https://github.com/llvm/llvm-project/pull/98971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-07-17 Thread Yuxuan Chen via cfe-commits
https://github.com/yuxuanchen1997 created https://github.com/llvm/llvm-project/pull/99282 This patch is the frontend implementation of the coroutine elide improvement project detailed in this discourse post: https://discourse.llvm.org/t/language-extension-for-better-more-deterministic-halo-for

[clang] [llvm] [LLVM][Coroutines] Perform HALO on "coro_must_elide" coroutines (PR #98974)

2024-07-16 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > how do you think about the suggestion to split the middle end patch? Can do that sure. I will send out new stacked PRs. https://github.com/llvm/llvm-project/pull/98974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

  1   2   3   4   >