[clang] [analyzer] Refine LCV handling in Store for better taint propagation (PR #114835)

2024-11-09 Thread Balazs Benics via cfe-commits
@@ -15,20 +19,103 @@ struct empty { void test_copy_return() { aggr s1 = {1, 2}; aggr const& cr1 = aggr(s1); - clang_analyzer_dump(cr1); // expected-warning-re {{&lifetime_extended_object{aggr, cr1, S{{[0-9]+}}} }} + clang_analyzer_dump_lref(cr1); // expected-warning-re

[clang] [analyzer] Refine LCV handling in Store for better taint propagation (PR #114835)

2024-11-09 Thread Balazs Benics via cfe-commits
steakhal wrote: > Thanks for the explanation -- code example reduction friendliness is a good > point that I didn't think about. Based on this, I support keeping that > commit, but perhaps add some remarks (in comments or the commit message, > wherever you think it's well-placed) that mentions

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -0,0 +1,62 @@ +//===--- IncorrectEnableSharedFromThisCheck.cpp - clang-tidy --===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread via cfe-commits
https://github.com/MichelleCDjunaidi edited https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread via cfe-commits
https://github.com/MichelleCDjunaidi edited https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [StaticAnalyzer] early return if sym is concrete on assuming (PR #115579)

2024-11-09 Thread Balazs Benics via cfe-commits
steakhal wrote: Hi, thanks for the PR! I'm slightly confused that the compiler crash you refer to comes from the stdlibrary fn checker. This suggest to me a checker problem - and likely relates to the stdlibraryfn checker early return. However, this also couples with a solver change. Is this

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -279,7 +281,7 @@ void UseAfterMoveFinder::getDeclRefs( if (DeclRef && BlockMap->blockContainingStmt(DeclRef) == Block) { // Ignore uses of a standard smart pointer that don't dereference the // pointer. - if (Operator || !isStandardSmartP

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread via cfe-commits
@@ -0,0 +1,62 @@ +//===--- IncorrectEnableSharedFromThisCheck.cpp - clang-tidy --===// +// +// 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: Apa

[clang-tools-extra] [clang-tidy] fix bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

2024-11-09 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 updated https://github.com/llvm/llvm-project/pull/115275 >From 06fb72b3720e3c457fc672c38258474879006682 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 7 Nov 2024 15:21:48 +0800 Subject: [PATCH 1/2] [clang-tidy] fix bugprone-sizeof-expression when sizeof e

[clang] [PAC][Driver] Add `-faarch64-jump-table-hardening` flag (PR #113149)

2024-11-09 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: @ahmedbougacha @ahatanak Please let me know if you have any objections on this. https://github.com/llvm/llvm-project/pull/113149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [llvm] [PAC][ELF][AArch64] Support signed personality function pointer (PR #113148)

2024-11-09 Thread Daniil Kovalev via cfe-commits
kovdan01 wrote: Would be glad to see everyone's feedback on the changes. https://github.com/llvm/llvm-project/pull/113148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
@@ -99,6 +99,7 @@ def int_dx_step : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty, L def int_dx_splitdouble : DefaultAttrsIntrinsic<[llvm_anyint_ty, LLVMMatchType<0>], [LLVMScalarOrSameVectorWidth<0, llvm_double_ty>], [IntrNoMem]>; def int_dx_radians : Defa

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/114588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-pixel %s -fnative-half-type -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple spirv-vulkan-pixel %s -fnative-half-type -emit-llvm -o -

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
@@ -91,6 +91,7 @@ let TargetPrefix = "spv" in { def int_spv_sign : DefaultAttrsIntrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i32_ty>], [llvm_any_ty], [IntrNoMem]>; def int_spv_radians : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty], [IntrNoMem]>; def int

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/114588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
@@ -164,6 +164,9 @@ class SPIRVInstructionSelector : public InstructionSelector { unsigned comparisonOpcode, MachineInstr &I) const; bool selectCross(Register ResVReg, const SPIRVType *ResType, MachineInstr &I) const; + bool selectClip(Re

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/114588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
@@ -633,7 +633,8 @@ void RequirementHandler::initAvailableCapabilities(const SPIRVSubtarget &ST) { if (ST.isAtLeastSPIRVVer(VersionTuple(1, 6))) addAvailableCaps({Capability::DotProduct, Capability::DotProductInputAll, Capability::DotProductInput4x8

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
@@ -1407,6 +1408,19 @@ void addInstrRequirements(const MachineInstr &MI, Reqs.addCapability(SPIRV::Capability::SplitBarrierINTEL); } break; + case SPIRV::OpKill: { +Reqs.addCapability(SPIRV::Capability::Shader); + } break; + case SPIRV::OpDemoteToHelperInvo

[clang] [llvm] [RISCV] Use the 'B' extension in RISC-V profile definitions (PR #113942)

2024-11-09 Thread Craig Topper via cfe-commits
https://github.com/topperc approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/113942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Make RegionStore dumps deterministic (PR #115615)

2024-11-09 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/115615 Dump the memory space clusters before the other clusters, in alphabetical order. Then default bindings over direct bindings, and if any has symbolic offset, then those should come before the ones with concrete

[clang] [analyzer][NFC] Make RegionStore dumps deterministic (PR #115615)

2024-11-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Balazs Benics (steakhal) Changes Dump the memory space clusters before the other clusters, in alphabetical order. Then default bindings over direct bindings, and if any has symbolic offset, then those should come before

[clang] [analyzer][NFC] Make RegionStore dumps deterministic (PR #115615)

2024-11-09 Thread Balazs Benics via cfe-commits
@@ -232,27 +233,86 @@ class RegionBindingsRef : public llvm::ImmutableMapRefhttps://github.com/llvm/llvm-project/pull/115615 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [llvm] [HLSL] Adding HLSL `clip` function. (PR #114588)

2024-11-09 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl edited https://github.com/llvm/llvm-project/pull/114588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

2024-11-09 Thread Helena Kotas via cfe-commits
@@ -271,53 +246,70 @@ struct BuiltinTypeDeclBuilder { return *this; } + FieldDecl *getResourceHandleField() { +FieldDecl *FD = Fields["h"]; hekota wrote: Both [] operator and lookup will add the field if it is not already there. I will update it t

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-09 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/115302 >From c6ad9d042612c63cb9862782f17082e07277fc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= Date: Wed, 6 Nov 2024 08:52:06 + Sub

[clang-tools-extra] 69fb9bc - Fix false positive in bugprone-throw-keyword-missing (#115302)

2024-11-09 Thread via cfe-commits
Author: Carlos Galvez Date: 2024-11-09T22:04:17+01:00 New Revision: 69fb9bcde0312e672e6f2280f8662784731d79e6 URL: https://github.com/llvm/llvm-project/commit/69fb9bcde0312e672e6f2280f8662784731d79e6 DIFF: https://github.com/llvm/llvm-project/commit/69fb9bcde0312e672e6f2280f8662784731d79e6.diff

[clang-tools-extra] Fix false positive in bugprone-throw-keyword-missing (PR #115302)

2024-11-09 Thread Carlos Galvez via cfe-commits
Carlos =?utf-8?q?Gálvez?= Message-ID: In-Reply-To: https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/115302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread via cfe-commits
@@ -0,0 +1,62 @@ +//===--- IncorrectEnableSharedFromThisCheck.cpp - clang-tidy --===// +// +// 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: Apa

[clang-tools-extra] Extend bugprone-use-after-move check to handle std::optional::reset() and std::any::reset() (PR #114255)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -196,10 +196,9 @@ Any occurrence of the moved variable that is not a reinitialization (see below) is considered to be a use. An exception to this are objects of type ``std::unique_ptr``, -``std::shared_ptr`` and ``std::weak_ptr``, which have defined move behavior -(objects

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread via cfe-commits
https://github.com/MichelleCDjunaidi edited https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Create bugprone-incorrect-enable-shared-from-this check (PR #102299)

2024-11-09 Thread via cfe-commits
MichelleCDjunaidi wrote: Note: I'll need someone to merge this in for me, as I don't have write access. https://github.com/llvm/llvm-project/pull/102299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [clang-tools-extra] RFC: [clang-tidy] [analyzer] Move nondeterministic pointer usage check to tidy (PR #110471)

2024-11-09 Thread Julian Schmidt via cfe-commits
5chmidti wrote: FYI: #115620 & #115621 https://github.com/llvm/llvm-project/pull/110471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] fix bugprone-sizeof-expression when sizeof expression with template types (PR #115275)

2024-11-09 Thread Julian Schmidt via cfe-commits
@@ -385,3 +385,8 @@ int ValidExpressions() { sum += sizeof(PtrArray) / sizeof(A[0]); return sum; } + +template +int ValidateTemplateTypeExpressions(T t) { + return sizeof(t.val) / sizeof(t.val[0]); +} 5chmidti wrote: Please note the issue somewhere on thi

<    1   2