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

2024-04-02 Thread Andreas Fertig via cfe-commits
andreasfertig wrote: Hello all, I did more investigation and found another shortcoming. In some cases, my initial implementation picked the wrong `this`- type, for example, https://github.com/andreasfertig/llvm-project/blob/9c60fec6881cca7e7fed9dca5cf24a0bd1924eaa/clang/test/SemaCXX/coroutine-

[clang] e47a81c - [OpenCL] Fix BIenqueue_kernel fallthrough (#83238)

2024-04-02 Thread via cfe-commits
Author: Sven van Haastregt Date: 2024-04-02T09:31:38+02:00 New Revision: e47a81c1d2830dda45a561e2c092ebb0c868ed27 URL: https://github.com/llvm/llvm-project/commit/e47a81c1d2830dda45a561e2c092ebb0c868ed27 DIFF: https://github.com/llvm/llvm-project/commit/e47a81c1d2830dda45a561e2c092ebb0c868ed27.

[clang] [OpenCL] Fix BIenqueue_kernel fallthrough (PR #83238)

2024-04-02 Thread Sven van Haastregt via cfe-commits
https://github.com/svenvh closed https://github.com/llvm/llvm-project/pull/83238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -97,21 +97,34 @@ class Environment { const Value &Val2, const Environment &Env2, Value &JoinedVal, Environment &JoinedEnv) {} +/// The result of the `widen` operation. +struct WidenResult { + /// Non-null pointer to a

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
https://github.com/martinboehme requested changes to this pull request. Nice. This is _much_ clearer! Mostly nits, the only substantive question I have is how we will migrate existing overrides. https://github.com/llvm/llvm-project/pull/87233 ___ cfe

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/87233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -975,6 +994,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -975,6 +994,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -122,17 +135,19 @@ class Environment { /// /// `Prev` and `Current` must be assigned to the same storage location in /// `PrevEnv` and `CurrentEnv`, respectively. -virtual Value *widen(QualType Type, Value &Prev, const Environment &PrevEnv, -

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -166,17 +166,20 @@ static Value *joinDistinctValues(QualType Type, Value &Val1, return JoinedVal; } -// When widening does not change `Current`, return value will equal `&Prev`. -static Value &widenDistinctValues(QualType Type, Value &Prev, -

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -975,6 +994,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -805,6 +805,25 @@ class NullPointerAnalysis final else JoinedVal.setProperty("is_null", JoinedEnv.makeTopBoolValue()); } + + std::optional widen(QualType Type, Value &Prev, + const Environment &PrevEnv, Value &Current, +

[clang] Clang: Return new layout path if cannot find CRT (PR #87319)

2024-04-02 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa created https://github.com/llvm/llvm-project/pull/87319 In ToolChain::getCompilerRT: If none is found, use a file name from the new layout, which may get printed in an error message, aiding users in knowing what Clang is looking for. But in current code, the old

[clang] Clang: Return new layout path if cannot find CRT (PR #87319)

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: YunQiang Su (wzssyqa) Changes In ToolChain::getCompilerRT: If none is found, use a file name from the new layout, which may get printed in an error message, aiding users in knowing what Clang is looking for. But in current code, the

[clang] Clang: Return new layout path if cannot find CRT (PR #87319)

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: YunQiang Su (wzssyqa) Changes In ToolChain::getCompilerRT: If none is found, use a file name from the new layout, which may get printed in an error message, aiding users in knowing what Clang is looking for. But in current cod

[clang] Clang: Return new layout path if cannot find CRT (PR #87319)

2024-04-02 Thread YunQiang Su via cfe-commits
https://github.com/wzssyqa edited https://github.com/llvm/llvm-project/pull/87319 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Propagate locations from result objects to initializers. (PR #87320)

2024-04-02 Thread via cfe-commits
https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/87320 Previously, we were propagating storage locations the other way around, i.e. from initializers to result objects, using `RecordValue::getLoc()`. This gave the wrong behavior in some cases -- see the newly add

[clang] [clang][dataflow] Propagate locations from result objects to initializers. (PR #87320)

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-analysis Author: None (martinboehme) Changes Previously, we were propagating storage locations the other way around, i.e. from initializers to result objects, using `RecordValue::getLoc()`. This gave the wrong behavior in

[clang] [clang] Catch missing format attributes (PR #70024)

2024-04-02 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovicsyrmia updated https://github.com/llvm/llvm-project/pull/70024 From 7adedf54a6c4d509046915777600b6e66b90bb8c Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Fri, 13 Oct 2023 14:45:15 +0200 Subject: [PATCH] [clang] Catch missing format attribu

[clang] [llvm] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87321)

2024-04-02 Thread via cfe-commits
https://github.com/idler66 created https://github.com/llvm/llvm-project/pull/87321 For example, struct base { public : base() {} template base(T x) {} }; struct derived : public base { public: derived() {} derived(derived& that): base(that) {} }; int main() { derived d1; derived d2 = d1; retu

[clang] [llvm] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87321)

2024-04-02 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [llvm] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87321)

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: idle666 (idler66) Changes For example, struct base { public : base() {} template base(T x) {} }; struct derived : public base { public: derived() {} derived(derived& that): base(that) {} }; int main() { derived d1; de

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/87322 The checker may create failure branches for all stream write operations only if the new option "pedantic" is set to true. Result of the write operations is often not checked in typical code. If failure branches

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Balázs Kéri (balazske) Changes The checker may create failure branches for all stream write operations only if the new option "pedantic" is set to true. Result of the write operations is often not checked in typical code. If failure branc

[clang] [analyzer] Remove barely used class 'KnownSVal' (NFC) (PR #86953)

2024-04-02 Thread via cfe-commits
@@ -1238,12 +1238,12 @@ class StoreSiteFinder final : public TrackingBugReporterVisitor { ///changes to its value in a nested stackframe could be pruned, and ///this visitor can prevent that without polluting the bugpath too ///much. - StoreSiteF

[clang] [analyzer] Remove barely used class 'KnownSVal' (NFC) (PR #86953)

2024-04-02 Thread via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/86953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Remove barely used class 'KnownSVal' (NFC) (PR #86953)

2024-04-02 Thread via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/86953 >From 638497ef227cf6f3e8d558618a186a3c45935dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 28 Mar 2024 14:49:15 +0100 Subject: [PAT

[clang] [HLSL][clang] Move hlsl_wave_get_lane_index to EmitHLSLBuiltinExpr (PR #87131)

2024-04-02 Thread Nathan Gauër via cfe-commits
Keenuts wrote: Hi! Thanks @farzonl and @marcauberer for making sure SPIR-V backend didn't break, really appreciate it! 😊 https://github.com/llvm/llvm-project/pull/87131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/87322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
@@ -1059,6 +1066,9 @@ void StreamChecker::evalFputx(const FnDescription *Desc, const CallEvent &Call, // Add transition for the failed state. The resulting value of the file // position indicator for the stream is indeterminate. + if (!PedanticMode) +return; + --

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
https://github.com/NagyDonat approved this pull request. Good change, I have a few minor suggestions that tweak comment placement. I felt that it's confusing to have an "Add a transition for" comment directly followed by a seemingly unrelated `if (!PedanticMode)` block -- my suggestions swap t

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
@@ -1094,6 +1104,9 @@ void StreamChecker::evalFprintf(const FnDescription *Desc, // Add transition for the failed state. The resulting value of the file // position indicator for the stream is indeterminate. + if (!PedanticMode) +return; + NagyDonat w

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
@@ -1264,16 +1277,18 @@ void StreamChecker::evalFseek(const FnDescription *Desc, const CallEvent &Call, if (!E.Init(Desc, Call, C, State)) return; - // Bifurcate the state into failed and non-failed. - // Return zero on success, -1 on error. + // Add success state.

[clang] Reapply "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)" (PR #87325)

2024-04-02 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall created https://github.com/llvm/llvm-project/pull/87325 This reverts commit 28760b63bbf9e267713957105a8d17091fb0d20e. The last commit was missing the new testcase, now fixed. >From dfcb5dd823e2eb4614be6e34369ac703eb87312e Mon Sep 17 00:00:00 2001 From: Sam McCall

[clang] Reapply "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)" (PR #87325)

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Sam McCall (sam-mccall) Changes This reverts commit 28760b63bbf9e267713957105a8d17091fb0d20e. The last commit was missing the new testcase, now fixed. --- Patch is 28.55 KiB, truncated to 20.00 KiB bel

[clang] Revert "Reapply "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)"" (PR #87041)

2024-04-02 Thread Sam McCall via cfe-commits
sam-mccall wrote: Sorry Douglas, and thanks for the revert. (I missed including the new test file in the commit - I'll make sure to run through CI when relanding this!) https://github.com/llvm/llvm-project/pull/87041 ___ cfe-commits mailing list cfe-c

[clang] [llvm] [RFC][AMDGPU] Add OpenCL-specific fence address space masks (PR #78572)

2024-04-02 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 59dd10faf8c3bb9dbcecb60d932284b8762cebf8 36bcf92bf7187b07a3842d3077b9f28c556e --

[clang] [llvm] [RFC][AMDGPU] Add vulkan:private/nonprivate MMRAs support (PR #78573)

2024-04-02 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 59dd10faf8c3bb9dbcecb60d932284b8762cebf8 4e9fd8a4c6f38bca145493e5e7cfe818a090a965 --

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

2024-04-02 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Hi Andreas, thanks for looking into this. I am still confused about whether or not your new branch can fix the crash or not. For the question about the crash itself, I don't have any insight though, I feel like this is a defect in the code generator. I didn't understand why m

[clang] [llvm] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87321)

2024-04-02 Thread via cfe-commits
https://github.com/idler66 updated https://github.com/llvm/llvm-project/pull/87321 >From 0233bb27a16ce0480a5fcf246e70880dde7a8868 Mon Sep 17 00:00:00 2001 From: wangjufan Date: Sun, 31 Mar 2024 23:49:30 +0800 Subject: [PATCH] [clang][CodeGen] Fix templated constructors in base classes introduc

[clang] [llvm] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87321)

2024-04-02 Thread via cfe-commits
https://github.com/idler66 updated https://github.com/llvm/llvm-project/pull/87321 >From 20dc290ea0d01d3b9979b189652e6eedec8c6923 Mon Sep 17 00:00:00 2001 From: wangjufan Date: Sun, 31 Mar 2024 23:49:30 +0800 Subject: [PATCH] [clang][CodeGen] Fix templated constructors in base classes introduc

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Unless you plan to add more heuristics, I'd prefer a more concrete option name, like AssumeSuccessfulWrites=true. This would better describe it imo. https://github.com/llvm/llvm-project/pull/87322 ___ cfe-commits

[clang] [llvm] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87321)

2024-04-02 Thread via cfe-commits
https://github.com/idler66 closed https://github.com/llvm/llvm-project/pull/87321 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Lambda parameter should be passed by const reference (PR #87306)

2024-04-02 Thread Simon Pilgrim via cfe-commits
@@ -3578,7 +3578,7 @@ cleanupAroundReplacements(StringRef Code, const tooling::Replacements &Replaces, // We need to use lambda function here since there are two versions of // `cleanup`. auto Cleanup = [](const FormatStyle &Style, StringRef Code, -st

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-04-02 Thread Jay Foad via cfe-commits
@@ -2594,12 +2594,10 @@ bool SIMemoryLegalizer::expandAtomicCmpxchgOrRmw(const SIMemOpInfo &MOI, MOI.getOrdering() == AtomicOrdering::SequentiallyConsistent || MOI.getFailureOrdering() == AtomicOrdering::Acquire || MOI.getFailureOrdering() == AtomicOrde

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-04-02 Thread Jay Foad via cfe-commits
@@ -0,0 +1,1406 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 +; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX9 +; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -mattr=+preci

[clang] [llvm] [AMDGPU] Emit a waitcnt instruction after each memory instruction (PR #79236)

2024-04-02 Thread Jay Foad via cfe-commits
@@ -0,0 +1,1406 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 +; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+precise-memory < %s | FileCheck %s -check-prefixes=GFX9 +; RUN: llc -mtriple=amdgcn -mcpu=gfx90a -mattr=+preci

[clang] [X86_32] Teach X86_32 va_arg to ignore empty structs. (PR #86075)

2024-04-02 Thread Longsheng Mou via cfe-commits
https://github.com/CoTinker updated https://github.com/llvm/llvm-project/pull/86075 >From 95a11789d89a57cc96512bd180949164f89695d0 Mon Sep 17 00:00:00 2001 From: Longsheng Mou Date: Thu, 21 Mar 2024 11:23:56 +0800 Subject: [PATCH] [X86_32] Teach X86_32 va_arg to ignore empty structs. Empty str

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-04-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/82776 >From 7fcd58b750872221aa754e81e17ab9068e144a44 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 23 Feb 2024 10:03:16 +0100 Subject: [PATCH 1/2] [clang] Add __builtin_start_object_lifetime builtin. This patch

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-04-02 Thread Haojian Wu via cfe-commits
@@ -4386,6 +4386,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(nullptr); } + case Builtin::BI__builtin_start_object_lifetime: case Builtin::BI__builtin_launder: { hokein wrote: I think the

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-04-02 Thread Haojian Wu via cfe-commits
@@ -896,6 +896,12 @@ def Launder : Builtin { let Prototype = "void*(void*)"; } +def StartObjectLifeTime : Builtin { hokein wrote: Done. https://github.com/llvm/llvm-project/pull/82776 ___ cfe-commits mailing list

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-04-02 Thread Haojian Wu via cfe-commits
@@ -4386,6 +4386,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(nullptr); } + case Builtin::BI__builtin_start_object_lifetime: hokein wrote: Added a comment for it, please take a look. https:/

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-04-02 Thread Haojian Wu via cfe-commits
@@ -896,6 +896,12 @@ def Launder : Builtin { let Prototype = "void*(void*)"; } +def StartObjectLifeTime : Builtin { + let Spellings = ["__builtin_start_object_lifetime"]; hokein wrote: I don't have strong opinion on the name. Since this builtin doesn't str

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-04-02 Thread Haojian Wu via cfe-commits
@@ -156,6 +156,37 @@ void test_noexcept(int *i) { #undef TEST_TYPE } // end namespace test_launder +namespace test_start_object_lifetime { +// The builtin is non-constant. +constexpr int test_non_constexpr(int i) { // expected-error {{constexpr function never produces a const

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
NagyDonat wrote: Personally I like the habit that these options are consistently named "Pedantic" because it highlights that they all provide "true, but not helpful" results. When the users see that an option is named "Pedantic", many of them will be able to immediately conclude that they are

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
@@ -122,17 +135,19 @@ class Environment { /// /// `Prev` and `Current` must be assigned to the same storage location in /// `PrevEnv` and `CurrentEnv`, respectively. -virtual Value *widen(QualType Type, Value &Prev, const Environment &PrevEnv, -

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread Balázs Kéri via cfe-commits
balazske wrote: > Unless you plan to add more heuristics, I'd prefer a more concrete option > name, like AssumeSuccessfulWrites=true. This would better describe it imo. I do not like totally the name "Pedantic", it could be "AssumeOftenUncheckedOperationsMayFail". I am not sure if this behavio

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
@@ -805,6 +805,25 @@ class NullPointerAnalysis final else JoinedVal.setProperty("is_null", JoinedEnv.makeTopBoolValue()); } + + std::optional widen(QualType Type, Value &Prev, + const Environment &PrevEnv, Value &Current, +

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
@@ -975,6 +994,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread via cfe-commits
NagyDonat wrote: I feel that "AssumeOftenUncheckedOperationsMayFail" does not provide more information than "Pedantic" (≈ report issues that are often left unchecked), while it is significantly longer, so my preferences are _Pedantic > AssumeSuccessfulWrites > AssumeOftenUncheckedOperationsMay

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
@@ -975,6 +994,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87332)

2024-04-02 Thread via cfe-commits
https://github.com/idler66 created https://github.com/llvm/llvm-project/pull/87332 For example, struct base { public : base() {} template base(T x) {} }; struct derived : public base { public: derived() {} derived(derived& that): base(that) {} }; int main() { derived d1; derived d2 = d1; retu

[clang] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87332)

2024-04-02 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang][CodeGen] Fix templated constructors in base classes introduce bugs. (PR #87332)

2024-04-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: idle666 (idler66) Changes For example, struct base { public : base() {} template base(T x) {} }; struct derived : public base { public: derived() {} derived(derived& that): base(that) {} }; int main() { derived d1; de

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/87233 >From d8d875271bd47b71701143afb06ea654546e2b7c Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 1 Apr 2024 12:13:39 + Subject: [PATCH 1/2] [clang][dataflow] Refactor `widen` API to be explicit about

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/87233 >From d8d875271bd47b71701143afb06ea654546e2b7c Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 1 Apr 2024 12:13:39 + Subject: [PATCH 1/3] [clang][dataflow] Refactor `widen` API to be explicit about

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
@@ -975,6 +994,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: Martin, I've addressed all of your comments. PTAL. https://github.com/llvm/llvm-project/pull/87233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Catch missing format attributes (PR #70024)

2024-04-02 Thread Budimir Aranđelović via cfe-commits
https://github.com/budimirarandjelovicsyrmia updated https://github.com/llvm/llvm-project/pull/70024 From 1c027637176d9100d3cc0a4f92b4ee227d4afddf Mon Sep 17 00:00:00 2001 From: budimirarandjelovicsyrmia Date: Fri, 13 Oct 2023 14:45:15 +0200 Subject: [PATCH] [clang] Catch missing format attribu

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-04-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/82776 >From 7fcd58b750872221aa754e81e17ab9068e144a44 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 23 Feb 2024 10:03:16 +0100 Subject: [PATCH 1/2] [clang] Add __builtin_start_object_lifetime builtin. This patch

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -805,6 +805,25 @@ class NullPointerAnalysis final else JoinedVal.setProperty("is_null", JoinedEnv.makeTopBoolValue()); } + + std::optional widen(QualType Type, Value &Prev, + const Environment &PrevEnv, Value &Current, +

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -122,17 +135,19 @@ class Environment { /// /// `Prev` and `Current` must be assigned to the same storage location in /// `PrevEnv` and `CurrentEnv`, respectively. -virtual Value *widen(QualType Type, Value &Prev, const Environment &PrevEnv, -

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -975,6 +989,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
https://github.com/martinboehme edited https://github.com/llvm/llvm-project/pull/87233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
https://github.com/martinboehme approved this pull request. https://github.com/llvm/llvm-project/pull/87233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread via cfe-commits
@@ -975,6 +994,35 @@ TEST_F(WideningTest, DistinctValuesWithSamePropertiesAreEquivalent) { }); } +TEST_F(WideningTest, DistinctValuesWithDifferentPropertiesWidenedToTop) { + std::string Code = R"( +void target(bool Cond) { + int *Foo; + int i = 0; +

[clang] [clang]Treat arguments to builtin type traits as template type arguments (PR #87132)

2024-04-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you! No need for a release note because the changes are correcting an issue introduced in 19.x. https://github.com/llvm/llvm-project/pull/87132 ___ cfe-commits mailing list cfe-co

[clang] [clang-repl] Add call to 'InitializeAllAsmParsers' (PR #86727)

2024-04-02 Thread Andrew V. Teylu via cfe-commits
https://github.com/aytey updated https://github.com/llvm/llvm-project/pull/86727 >From 480d77eb88df2abc589c4be90ceab200cb3fac98 Mon Sep 17 00:00:00 2001 From: "Andrew V. Teylu" Date: Tue, 26 Mar 2024 20:10:24 + Subject: [PATCH 1/2] [clang-repl] Add call to 'InitializeAllAsmParsers' Signed-o

[clang] [clang-repl] Add call to 'InitializeAllAsmParsers' (PR #86727)

2024-04-02 Thread Andrew V. Teylu via cfe-commits
aytey wrote: @weliveindetail @vgvassilev @junaire: sorry for pinging you directly, but could you take a look at this PR? I see you're all active on other `clang-repl` PRs, so thought you might be the best place to start to take a look at this one 🤞 https://github.com/llvm/llvm-project/pull/86

[clang] 7ef602b - Reapply "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)" (#87325)

2024-04-02 Thread via cfe-commits
Author: Sam McCall Date: 2024-04-02T13:48:45+02:00 New Revision: 7ef602b58c1ccacab20d9d01e24b281458c3facc URL: https://github.com/llvm/llvm-project/commit/7ef602b58c1ccacab20d9d01e24b281458c3facc DIFF: https://github.com/llvm/llvm-project/commit/7ef602b58c1ccacab20d9d01e24b281458c3facc.diff LO

[clang] Reapply "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)" (PR #87325)

2024-04-02 Thread Sam McCall via cfe-commits
https://github.com/sam-mccall closed https://github.com/llvm/llvm-project/pull/87325 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix crash when inheriting from a cv-qualified type (PR #70594)

2024-04-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: You might want to include a test from https://github.com/llvm/llvm-project/issues/85256#issuecomment-2031815104 https://github.com/llvm/llvm-project/pull/70594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

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

2024-04-02 Thread Andreas Fertig via cfe-commits
andreasfertig wrote: Hello @ChuanqiXu9, > Hi Andreas, thanks for looking into this. I am still confused about whether > or not your new branch can fix the crash or not. It's my pleasure! The new branch doesn't fix the crash. If I understand why it is crashing, this branch is a better change c

[clang] [clang] Add test for CWG1606 (PR #87274)

2024-04-02 Thread Yuri Istomin via cfe-commits
https://github.com/NekoCdr updated https://github.com/llvm/llvm-project/pull/87274 >From 1dfb9414a28f99024a8abe36b0b10a4d91eae573 Mon Sep 17 00:00:00 2001 From: Yuri Istomin Date: Mon, 1 Apr 2024 22:02:42 +0300 Subject: [PATCH 1/3] [clang] Add test for CWG1606 --- clang/test/CXX/drs/dr16xx.cp

[clang] [llvm] [HLSL][DXIL][SPIRV] Implementation of an abstraction for intrinsic selection of HLSL backends (PR #87171)

2024-04-02 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,44 @@ + +//===- CGHLSLUtils.h - Utility functions for HLSL CodeGen ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [llvm] [HLSL][DXIL][SPIRV] Implementation of an abstraction for intrinsic selection of HLSL backends (PR #87171)

2024-04-02 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,95 @@ +; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s +; Note: The validator is wrong it wants the return to be a bool vector when it is bool scalar return Keenuts wrote: AFAIK the validator is not wrong, it complains for 2 reaso

[clang] [llvm] [HLSL][DXIL][SPIRV] Implementation of an abstraction for intrinsic selection of HLSL backends (PR #87171)

2024-04-02 Thread Nathan Gauër via cfe-commits
@@ -100,6 +100,118 @@ double3 abs(double3); _HLSL_BUILTIN_ALIAS(__builtin_elementwise_abs) double4 abs(double4); +//===--===// +// all builtins +//===---

[clang] [llvm] [HLSL][DXIL][SPIRV] Implementation of an abstraction for intrinsic selection of HLSL backends (PR #87171)

2024-04-02 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,44 @@ + +//===- CGHLSLUtils.h - Utility functions for HLSL CodeGen ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [llvm] [HLSL][DXIL][SPIRV] Implementation of an abstraction for intrinsic selection of HLSL backends (PR #87171)

2024-04-02 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,44 @@ + +//===- CGHLSLUtils.h - Utility functions for HLSL CodeGen ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[clang] [clang][ASTImporter] fix variable inline of CXX17 (PR #87314)

2024-04-02 Thread via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/87314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] fix variable inline of CXX17 (PR #87314)

2024-04-02 Thread via cfe-commits
@@ -5317,6 +5317,34 @@ TEST_P(ASTImporterOptionSpecificTestBase, EXPECT_FALSE(ToX); } +TEST_P(ASTImporterOptionSpecificTestBase, VarTemplateDeclInlineWithCXX17) { + Decl *FromTU = getTuDecl( + R"( + struct S { +template static constexpr bool X = true; +

[clang] [clang][ASTImporter] fix variable inline of CXX17 (PR #87314)

2024-04-02 Thread via cfe-commits
https://github.com/NagyDonat commented: Looks good, but I'm not familiar enough with these details of the standard to provide a definite review. https://github.com/llvm/llvm-project/pull/87314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
https://github.com/ymand updated https://github.com/llvm/llvm-project/pull/87233 >From d8d875271bd47b71701143afb06ea654546e2b7c Mon Sep 17 00:00:00 2001 From: Yitzhak Mandelbaum Date: Mon, 1 Apr 2024 12:13:39 + Subject: [PATCH 1/4] [clang][dataflow] Refactor `widen` API to be explicit about

[clang] [clang][dataflow] Refactor `widen` API to be explicit about change effect. (PR #87233)

2024-04-02 Thread Yitzhak Mandelbaum via cfe-commits
ymand wrote: I also fixed up the other tests to use `getValue/LocForDecl` to be consistent. https://github.com/llvm/llvm-project/pull/87233 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-04-02 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > FWIW, I did verify that it's very unlikely the changes in this PR will > > break existing code: > > https://sourcegraph.com/search?q=context:global+__need_unreachable+-file:.*clang.*&patternType=keyword&sm=0, > > so that's a good thing. > > > I do wonder if we could hav

[clang] [X86_32] Teach X86_32 va_arg to ignore empty structs. (PR #86075)

2024-04-02 Thread Longsheng Mou via cfe-commits
https://github.com/CoTinker updated https://github.com/llvm/llvm-project/pull/86075 >From 85d829dcef3484892d6db8f6a0329cb9bc34c349 Mon Sep 17 00:00:00 2001 From: Longsheng Mou Date: Thu, 21 Mar 2024 11:23:56 +0800 Subject: [PATCH] [X86_32] Teach X86_32 va_arg to ignore empty structs. Empty str

[clang] [clang-tools-extra] [Clang][Sema] Fix explicit specializations of member function templates with a deduced return type (PR #86817)

2024-04-02 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/86817 >From e84e4b6fedb5a643082cd38d0e10d910b299f73f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 27 Mar 2024 11:23:19 -0400 Subject: [PATCH] [Clang][Sema] Fix explicit specializations of member fun

[clang-tools-extra] Support renaming designated initializers (PR #86976)

2024-04-02 Thread Edwin Vane via cfe-commits
https://github.com/revane updated https://github.com/llvm/llvm-project/pull/86976 >From f8604d450fa3852d5c684bc8ada228a07ce6ccf5 Mon Sep 17 00:00:00 2001 From: Edwin Vane Date: Thu, 28 Mar 2024 09:24:34 -0400 Subject: [PATCH] Support renaming designated initializers Until now, they were just i

[clang-tools-extra] Support renaming designated initializers (PR #86976)

2024-04-02 Thread Edwin Vane via cfe-commits
@@ -367,6 +367,25 @@ class RenamerClangTidyVisitor return true; } + bool VisitDesignatedInitExpr(DesignatedInitExpr *Expr) { +for (const auto &Designator : Expr->designators()) { + if (!Designator.isFieldDesignator()) +continue; + auto *FieldDecl =

[clang] [clang] Fix crash when inheriting from a cv-qualified type (PR #70594)

2024-04-02 Thread Rajveer Singh Bharadwaj via cfe-commits
https://github.com/Rajveer100 updated https://github.com/llvm/llvm-project/pull/70594 >From f2a9a4137d39dd9f3896c64f41d5700774ec9204 Mon Sep 17 00:00:00 2001 From: Rajveer Date: Sun, 29 Oct 2023 18:37:17 +0530 Subject: [PATCH] [clang] Fix a crash in debug mode Resolves Issue #35603 This bug w

  1   2   3   >