[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-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] [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] [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] 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] 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-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] 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] 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 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] 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-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] 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-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-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
@@ -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
@@ -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] 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-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] 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 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] [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-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-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-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: > 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-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] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-28 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > The anticipated implementation from the discussion is beyond my capabilities. Hey, chiming in here since I've been silently following this thread and I think you've been doing great. The conversation might seem intimidating but once we converge on an approach, the code

[clang] [Clang] Diagnose invalid function types in dependent contexts (PR #138731)

2025-05-08 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: Hi @cor3ntin, This patch seems to have made expression SFINAEs in variable template partial specialization an hard error: https://godbolt.org/z/3K6sh1cWM Upstream clang rejects the program while clang-20, gcc, msvc accepted it. https://github.com/llvm/llvm-project/pull

<    1   2   3   4