[clang] [Analyzer][CFG] Correctly handle rebuilt default arg and default init expression (PR #91879)

2024-05-28 Thread Alan Zhao via cfe-commits
alanzhao1 wrote: FYI this patch messes up some diagnostics with `-Wunreachable-code`: https://godbolt.org/z/6TEdrx55d If the unreachable code is a constructor with a default parameter that is a builtin function, clang incorrectly highlights the call to the builtin instead of the call to the

[clang] [nfc][clang] Fix test in new-array-init.cpp (PR #79225)

2024-01-23 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 closed https://github.com/llvm/llvm-project/pull/79225 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [nfc][clang] Fix test in new-array-init.cpp (PR #79225)

2024-01-23 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 created https://github.com/llvm/llvm-project/pull/79225 This test was originally introduced in https://github.com/llvm/llvm-project/pull/76976, but it incorrectly tests braced-list initialization instead of parenthesized initialization. >From

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-18 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 closed https://github.com/llvm/llvm-project/pull/76976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-18 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From 1ac47a1548f0dbd21747ef05c64fc2f08668e0e1 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang][Darwin] Remove legacy framework search path logic in the frontend (PR #75841)

2024-01-17 Thread Alan Zhao via cfe-commits
alanzhao1 wrote: If we pass `-v` to Clang, we get the following include directories: without this patch: ``` clang -cc1 version 18.0.0git based upon LLVM 18.0.0git default target arm64-apple-darwin23.3.0 ignoring nonexistent directory

[clang] [clang][Darwin] Remove legacy framework search path logic in the frontend (PR #75841)

2024-01-17 Thread Alan Zhao via cfe-commits
alanzhao1 wrote: Here's what I did to repro: `include.cc`: ```cpp #include ``` Build clang: ``` $ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_LLD=False -DLLVM_CCACHE_BUILD=True -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" ../llvm $ ninja clang ``` I

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-17 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/9] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-17 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/8] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-16 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/7] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-16 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 edited https://github.com/llvm/llvm-project/pull/76976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-16 Thread Alan Zhao via cfe-commits
@@ -1038,11 +1038,14 @@ void CodeGenFunction::EmitNewArrayInitializer( return true; }; + const InitListExpr *ILE = dyn_cast(Init); + const CXXParenListInitExpr *CPLIE = dyn_cast(Init); + const StringLiteral *SL = dyn_cast(Init); // If the initializer is an

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-16 Thread Alan Zhao via cfe-commits
@@ -1038,11 +1038,14 @@ void CodeGenFunction::EmitNewArrayInitializer( return true; }; + const InitListExpr *ILE = dyn_cast(Init); + const CXXParenListInitExpr *CPLIE = dyn_cast(Init); + const StringLiteral *SL = dyn_cast(Init); // If the initializer is an

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-16 Thread Alan Zhao via cfe-commits
alanzhao1 wrote: Ping. Any more comments? https://github.com/llvm/llvm-project/pull/76976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix direct-initialization with new expressions for arrays (PR #78201)

2024-01-15 Thread Alan Zhao via cfe-commits
alanzhao1 wrote: > I believe the approach here is not sufficient and we have a current PR in > progress: #76976 > > we also need codegen work to implement this. Correct - here are some examples that will cause this to fail: ```cpp void foo(int n) { new int[n](1, 2); } ``` ```cpp void

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-09 Thread Alan Zhao via cfe-commits
@@ -1038,11 +1038,14 @@ void CodeGenFunction::EmitNewArrayInitializer( return true; }; + const InitListExpr *ILE = dyn_cast(Init); + const CXXParenListInitExpr *CPLIE = dyn_cast(Init); + const StringLiteral *SL = dyn_cast(Init); // If the initializer is an

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-09 Thread Alan Zhao via cfe-commits
@@ -5495,14 +5495,12 @@ static void TryOrBuildParenListInitialization( return; } // ...and value-initialized for each k < i <= n; -if (ArrayLength > Args.size()) { alanzhao1 wrote: > What is this change supposed to do?

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-09 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/6] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-09 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/5] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-05 Thread Alan Zhao via cfe-commits
alanzhao1 wrote: > Have you considered the following case? > > ``` > void foo() { > char* arr = new char[]("asdf"); > } > ``` Thanks for catching this - this causes this patch to crash. Working on this right now. https://github.com/llvm/llvm-project/pull/76976

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-04 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/4] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-04 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/3] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-04 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 updated https://github.com/llvm/llvm-project/pull/76976 >From ee4e3c8634bb876166ee753a4ebcbf3c1699a175 Mon Sep 17 00:00:00 2001 From: Alan Zhao Date: Wed, 3 Jan 2024 12:29:21 -0800 Subject: [PATCH 1/2] [clang] Fix parenthesized list initialization of arrays not

[clang] [clang] Fix parenthesized list initialization of arrays not working with `new` (PR #76976)

2024-01-04 Thread Alan Zhao via cfe-commits
https://github.com/alanzhao1 created https://github.com/llvm/llvm-project/pull/76976 This bug is caused by parenthesized list initialization not being implemented in `CodeGenFunction::EmitNewArrayInitializer(...)`. Parenthesized list initialization of `struct`s with `operator new` already

[clang] fe0116a - [clang] Fix a crash when casting to an array type

2023-07-18 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-07-18T09:48:17-07:00 New Revision: fe0116aba833ee8597e2155d1e555c326acfaafc URL: https://github.com/llvm/llvm-project/commit/fe0116aba833ee8597e2155d1e555c326acfaafc DIFF: https://github.com/llvm/llvm-project/commit/fe0116aba833ee8597e2155d1e555c326acfaafc.diff

[clang] 1cf5188 - [clang] Fix crash when passing a braced-init list to a parentehsized aggregate init expression

2023-05-31 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-05-31T13:52:45-07:00 New Revision: 1cf5188c72902e85e85095d788f5dfa138c320f8 URL: https://github.com/llvm/llvm-project/commit/1cf5188c72902e85e85095d788f5dfa138c320f8 DIFF: https://github.com/llvm/llvm-project/commit/1cf5188c72902e85e85095d788f5dfa138c320f8.diff

[clang] d1d35f0 - [clang] Fix initializer_list matching failures with modules

2023-05-09 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-05-09T10:31:43-07:00 New Revision: d1d35f04c6cb2e3d5b0fbc6101d5425a33f8fc63 URL: https://github.com/llvm/llvm-project/commit/d1d35f04c6cb2e3d5b0fbc6101d5425a33f8fc63 DIFF: https://github.com/llvm/llvm-project/commit/d1d35f04c6cb2e3d5b0fbc6101d5425a33f8fc63.diff

[clang] f762798 - Fix ReleaseNotes.rst unresolved merge conflict

2023-05-01 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-05-01T10:26:15-07:00 New Revision: f762798599171efca03964f4371cc8104d2392f9 URL: https://github.com/llvm/llvm-project/commit/f762798599171efca03964f4371cc8104d2392f9 DIFF: https://github.com/llvm/llvm-project/commit/f762798599171efca03964f4371cc8104d2392f9.diff

[clang] 9b4faa1 - [clang] Fix overly aggressive lifetime checks for parenthesized aggregate initialization

2023-05-01 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-05-01T10:02:15-07:00 New Revision: 9b4faa11c68be4b45ddf29acd575bb52a3c2fad7 URL: https://github.com/llvm/llvm-project/commit/9b4faa11c68be4b45ddf29acd575bb52a3c2fad7 DIFF: https://github.com/llvm/llvm-project/commit/9b4faa11c68be4b45ddf29acd575bb52a3c2fad7.diff

[clang] da0089c - [clang] Fix default initializers being ignored when initializing templated aggregate types

2023-05-01 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-05-01T09:27:52-07:00 New Revision: da0089c99ba1507b876cf3d2a205ba108aad65ff URL: https://github.com/llvm/llvm-project/commit/da0089c99ba1507b876cf3d2a205ba108aad65ff DIFF: https://github.com/llvm/llvm-project/commit/da0089c99ba1507b876cf3d2a205ba108aad65ff.diff

[clang] 3e22eb3 - Fix spacing in ReleaseNotes.rst link

2023-04-27 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-04-27T11:41:21-07:00 New Revision: 3e22eb36b6ffd60608a0e70401b021738c1c4fe8 URL: https://github.com/llvm/llvm-project/commit/3e22eb36b6ffd60608a0e70401b021738c1c4fe8 DIFF: https://github.com/llvm/llvm-project/commit/3e22eb36b6ffd60608a0e70401b021738c1c4fe8.diff

[clang] 7417e9d - [clang] Fix a crash with parenthesized aggregate initialization and base classes

2023-04-27 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-04-27T10:43:16-07:00 New Revision: 7417e9d75c9af7dd0d3dad12eebdee84b10b56d7 URL: https://github.com/llvm/llvm-project/commit/7417e9d75c9af7dd0d3dad12eebdee84b10b56d7 DIFF: https://github.com/llvm/llvm-project/commit/7417e9d75c9af7dd0d3dad12eebdee84b10b56d7.diff

[clang] 7df3c71 - [clang] Fix 2 bugs with parenthesized aggregate initialization

2023-03-30 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-03-30T15:06:37-07:00 New Revision: 7df3c71b508b65284483225685f1ba19777f2bbb URL: https://github.com/llvm/llvm-project/commit/7df3c71b508b65284483225685f1ba19777f2bbb DIFF: https://github.com/llvm/llvm-project/commit/7df3c71b508b65284483225685f1ba19777f2bbb.diff

[clang] 95a4c0c - [clang] Reland parenthesized aggregate init patches

2023-01-12 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-01-12T09:58:15-08:00 New Revision: 95a4c0c83554c025ef709a6805e67233d0dedba0 URL: https://github.com/llvm/llvm-project/commit/95a4c0c83554c025ef709a6805e67233d0dedba0 DIFF: https://github.com/llvm/llvm-project/commit/95a4c0c83554c025ef709a6805e67233d0dedba0.diff

[clang] 4e02ff2 - [clang] Revert parentesized aggregate initalization patches

2023-01-04 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2023-01-04T15:09:36-08:00 New Revision: 4e02ff2303f8a69cc2459b77bbb879b248df6ca9 URL: https://github.com/llvm/llvm-project/commit/4e02ff2303f8a69cc2459b77bbb879b248df6ca9 DIFF: https://github.com/llvm/llvm-project/commit/4e02ff2303f8a69cc2459b77bbb879b248df6ca9.diff

[clang] c77a91b - [clang] Remove overly restrictive aggregate paren init logic

2022-12-21 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2022-12-21T08:21:05-08:00 New Revision: c77a91bb7ba793ec3a6a5da3743ed55056291658 URL: https://github.com/llvm/llvm-project/commit/c77a91bb7ba793ec3a6a5da3743ed55056291658 DIFF: https://github.com/llvm/llvm-project/commit/c77a91bb7ba793ec3a6a5da3743ed55056291658.diff

[clang] 40c5215 - [clang][C++20] P0960R3 and P1975R0: Allow initializing aggregates from a parenthesized list of values

2022-12-14 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2022-12-14T07:54:15-08:00 New Revision: 40c52159d3ee337dbed14e4c73b5616ea354c337 URL: https://github.com/llvm/llvm-project/commit/40c52159d3ee337dbed14e4c73b5616ea354c337 DIFF: https://github.com/llvm/llvm-project/commit/40c52159d3ee337dbed14e4c73b5616ea354c337.diff

[clang] 4848f3b - [C++2a] P0634r3: Down with typename!

2022-09-28 Thread Alan Zhao via cfe-commits
Author: Nicolas Lesser Date: 2022-09-28T09:50:19-07:00 New Revision: 4848f3bf2ff5ec57a8e2b8d3676c947dcf0fd735 URL: https://github.com/llvm/llvm-project/commit/4848f3bf2ff5ec57a8e2b8d3676c947dcf0fd735 DIFF:

[clang] 6f2b347 - Add missing `struct` keyword to the test p2-2.cpp

2022-09-28 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2022-09-28T09:48:00-07:00 New Revision: 6f2b34789541ff95d7f339eac5dc031d29655a58 URL: https://github.com/llvm/llvm-project/commit/6f2b34789541ff95d7f339eac5dc031d29655a58 DIFF: https://github.com/llvm/llvm-project/commit/6f2b34789541ff95d7f339eac5dc031d29655a58.diff

[clang] ff8aadf - [clang][diagnostics] Don't warn about unreachable code in constexpr if

2022-08-15 Thread Alan Zhao via cfe-commits
Author: Alan Zhao Date: 2022-08-15T15:24:39-04:00 New Revision: ff8aadf58d1a0ea7d8fa2b9a7a17ff0c6059baa5 URL: https://github.com/llvm/llvm-project/commit/ff8aadf58d1a0ea7d8fa2b9a7a17ff0c6059baa5 DIFF: https://github.com/llvm/llvm-project/commit/ff8aadf58d1a0ea7d8fa2b9a7a17ff0c6059baa5.diff

[clang] 4ad17d2 - Clean "./" from __FILE__ expansion.

2022-06-02 Thread Alan Zhao via cfe-commits
Author: Paul Pluzhnikov Date: 2022-06-02T18:00:19-04:00 New Revision: 4ad17d2e96a382e5f595bab30920ba26762a6fa9 URL: https://github.com/llvm/llvm-project/commit/4ad17d2e96a382e5f595bab30920ba26762a6fa9 DIFF: