[clang] [NFC][Clang][CodeGen] Remove vestigial assertion (PR #127528)

2025-02-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Alex Voicu (AlexVlx) Changes This removes a vestigial assertion, which would erroneously trigger even though we now correctly handle valid arg mismatches (

[clang] [NFC][Clang][CodeGen] Remove vestigial assertion (PR #127528)

2025-02-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Alex Voicu (AlexVlx) Changes This removes a vestigial assertion, which would erroneously trigger even though we now correctly handle valid arg mismatches (

[clang] [compiler-rt] [Clang][PGO] Fix profile function visibility bug (PR #127257)

2025-02-17 Thread Qiongsi Wu via cfe-commits
https://github.com/qiongsiwu approved this pull request. Thanks Ethan! LGTM! https://github.com/llvm/llvm-project/pull/127257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Fix returne value of array CXXNewExprs (PR #127526)

2025-02-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Just like with the __builtin_operator_new version, we need to point to the first array element, not the array element itself. --- Full diff: https://github.com/llvm/llvm-project/pull/127526.diff 3 Files Af

[clang] [NFC][Clang][CodeGen] Remove vestigial assertion (PR #127528)

2025-02-17 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 approved this pull request. Makes sense, since this is only for these call arguments which are handled in all cases now I presume. https://github.com/llvm/llvm-project/pull/127528 ___ cfe-commits mailing list cfe-commits@lis

[clang] [clang][CodeGen] `sret` args should always point to the `alloca` AS, so use that (PR #114062)

2025-02-17 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > @AlexVlx I found this breaks my clang build, reduced the C++ source to the > following reproducer https://godbolt.org/z/jGnvKeqvr. Please verify that it > breaks for you as well and revert or fix. (The issue is the s() function call > not using AS(5)) > > ```c++ > #pragma omp

[clang] [HLSL] Implement the 'and' HLSL function (PR #127098)

2025-02-17 Thread Farzon Lotfi via cfe-commits
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { break; } + case Builtin::BI__builtin_hlsl_and: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; +if (CheckVectorElementCallArgs(&SemaRef, TheCal

[clang] [Clang][AArch64] Add support for SHF_AARCH64_PURECODE ELF section flag (2/3) (PR #125688)

2025-02-17 Thread Peter Smith via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang --sysroot=%S/Inputs -c -fdriver-only -Werror --target=aarch64-unknown-linux-gnu \ smithp35 wrote: Can you check that this test still passes with a aarch64-none-elf bare-metal target? There's a !ForMultilib in the ARM code https

[clang] [llvm] [RISCV] Add Support of RISCV Zibimm Experimental Extension (PR #127463)

2025-02-17 Thread Craig Topper via cfe-commits
@@ -0,0 +1,48 @@ +//===-- RISCVInstrInfoZvabd.td - 'Zvabd' instructions --*- tablegen -*-===// topperc wrote: Incorrect file name https://github.com/llvm/llvm-project/pull/127463 ___ cfe-commits mailing list cfe-c

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

2025-02-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127532 libclc uses llvm-link to link together all of the individually built libclc builtins files into one module. Some of these builtins files are compiled from source by clang whilst others are converted from LL

[libclc] [libclc] Suppress data-layout warnings during linking (PR #127532)

2025-02-17 Thread Fraser Cormack via cfe-commits
@@ -1,8 +1,4 @@ -#if __clang_major__ >= 7 -target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5" -#else -target datalayout = "e-p:32:32-p1:64

[clang] [llvm] [OpenMP] Missing implicit otherwise clause in metadirective. (PR #127113)

2025-02-17 Thread Alexey Bataev via cfe-commits
@@ -2882,6 +2882,12 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective( /*ReadDirectiveWithinMetadirective=*/true); break; } +// If no match is found and no otherwise clause is present, skip +// OMP5.2 Chapter 7.4: If no otherwise cla

[clang] [Clang][CodeGen] Bail out on constexpr unknown values in ConstantEmitter (PR #127525)

2025-02-17 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/127525 Close https://github.com/llvm/llvm-project/issues/127475 >From d931667e3b7e18f8ba6f054405ffc5fe2fac36b4 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 18 Feb 2025 01:26:26 +0800 Subject: [PATCH] [Clang

[clang] [libc] [Clang] Add handlers for 'match_any' and 'match_all' to `gpuintrin.h` (PR #127504)

2025-02-17 Thread Joseph Huber via cfe-commits
@@ -162,6 +162,62 @@ __gpu_shuffle_idx_u64(uint64_t __lane_mask, uint32_t __idx, uint64_t __x, ((uint64_t)__gpu_shuffle_idx_u32(__lane_mask, __idx, __lo, __width)); } +// Returns a bitmask marking all lanes that have the same value of __x. +_DEFAULT_FN_ATTRS static _

[libclc] [libclc] Fix dependencies on generated convert builtins (PR #127515)

2025-02-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/127515 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement __attribute__((format_matches)) (PR #116708)

2025-02-17 Thread via cfe-commits
=?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier , =?utf-8?q?Félix?= Cloutier Message-ID

[clang] [clang][bytecode] Fix returne value of array CXXNewExprs (PR #127526)

2025-02-17 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/127526 Just like with the __builtin_operator_new version, we need to point to the first array element, not the array element itself. >From ba084758083d32d2db4773abd181880717830706 Mon Sep 17 00:00:00 2001 From: =?UTF

[libclc] 15c2d1b - [libclc] Fix dependencies on generated convert builtins (#127515)

2025-02-17 Thread via cfe-commits
Author: Fraser Cormack Date: 2025-02-17T17:36:02Z New Revision: 15c2d1b328433d2c26327e072059c8960469d378 URL: https://github.com/llvm/llvm-project/commit/15c2d1b328433d2c26327e072059c8960469d378 DIFF: https://github.com/llvm/llvm-project/commit/15c2d1b328433d2c26327e072059c8960469d378.diff LOG

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2025-02-17 Thread John McCall via cfe-commits
Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?=, Alejandro =?utf-8?q?=C3=81lvarez_Ayll=C3=B3n?= Message-ID:

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,146 @@ +//===--- SmartptrResetAmbiguousCallCheck.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: Ap

[clang] [HLSL] Implement the 'and' HLSL function (PR #127098)

2025-02-17 Thread Chris B via cfe-commits
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { break; } + case Builtin::BI__builtin_hlsl_and: { +if (SemaRef.checkArgCount(TheCall, 2)) + return true; +if (CheckVectorElementCallArgs(&SemaRef, TheCal

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,146 @@ +//===--- SmartptrResetAmbiguousCallCheck.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: Ap

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-17 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > That being said, I wonder if we should record the presence of casts when we > produce `ElementRegion`s to better help checks suppress potentially false > results. This would just make some workarounds easier to write rather than > having full modelling. After stabilizing th

[clang-tools-extra] [clang-tidy] Add support for `-ignore-insert-conflict` in `run-clang-tidy.py` (PR #127066)

2025-02-17 Thread Vicente Mataix Ferrándiz via cfe-commits
@@ -446,6 +448,12 @@ async def main() -> None: action="store_true", help="Allow empty enabled checks.", ) +parser.add_argument( +"-ignore-insert-conflict", loumalouomega wrote: The problem is that `-ignore-insert-conflict` does

[clang] [clang] Fix false positive regression for lifetime analysis warning. (PR #127460)

2025-02-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/127460 >From 3601ae837475da3c473f5be9c17687c439495ded Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 17 Feb 2025 10:08:14 +0100 Subject: [PATCH 1/2] [clang] Fix false positive regression for lifetime analysis war

[clang] [clang] Fix false positive regression for lifetime analysis warning. (PR #127460)

2025-02-17 Thread Haojian Wu via cfe-commits
@@ -852,3 +852,27 @@ struct Test { }; } // namespace GH120543 + +namespace GH127195 { +template +struct StatusOr { + T* operator->() [[clang::lifetimebound]]; + T* value() [[clang::lifetimebound]]; +}; + +const char* foo() { + StatusOr s; + return s->data(); // expected-w

[clang] Clang/bug113094 (PR #127439)

2025-02-17 Thread Joseph Huber via cfe-commits
@@ -8336,12 +8336,11 @@ static bool verifyValidIntegerConstantExpr(Sema &S, const ParsedAttr &Attr, /// match one of the standard Neon vector types. static void HandleNeonVectorTypeAttr(QualType &CurType, const ParsedAttr &Attr, Sema &S, Ve

[clang] Clang/bug113094 (PR #127439)

2025-02-17 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang -fopenmp --offload-arch=sm_90 -nocudalib -target aarch64-unknown-linux-gnu -c -Xclang -verify %s jhuber6 wrote: Seems CUDA used to have a test for this but it was removed for some reason? I would just stash it in `SemaOpenMP` or

[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)

2025-02-17 Thread Louis Dionne via cfe-commits
https://github.com/ldionne closed https://github.com/llvm/llvm-project/pull/125412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] f4206f9 - [libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (#125412)

2025-02-17 Thread via cfe-commits
Author: Yuriy Chernyshov Date: 2025-02-17T08:39:18-05:00 New Revision: f4206f92c5f900a4e0fc0f6dcab6afb6865df1e9 URL: https://github.com/llvm/llvm-project/commit/f4206f92c5f900a4e0fc0f6dcab6afb6865df1e9 DIFF: https://github.com/llvm/llvm-project/commit/f4206f92c5f900a4e0fc0f6dcab6afb6865df1e9.di

[clang] [OpenMP] Silencly accept `neon_vector_type` for the offloading device (PR #127439)

2025-02-17 Thread via cfe-commits
github-actions[bot] wrote: ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo. Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account. See [LLVM Discourse](https://discourse.llvm.org/t/hidden-email

[clang] 9c49b18 - [clang] Fix false positive regression for lifetime analysis warning. (#127460)

2025-02-17 Thread via cfe-commits
Author: Haojian Wu Date: 2025-02-17T14:40:31+01:00 New Revision: 9c49b188b8e1434eb774ee8422124ad3e8870dce URL: https://github.com/llvm/llvm-project/commit/9c49b188b8e1434eb774ee8422124ad3e8870dce DIFF: https://github.com/llvm/llvm-project/commit/9c49b188b8e1434eb774ee8422124ad3e8870dce.diff LO

[clang] [clang] Fix false positive regression for lifetime analysis warning. (PR #127460)

2025-02-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/127460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] Integrated Distributed ThinLTO (DTLTO): Initial support (PR #126654)

2025-02-17 Thread via cfe-commits
https://github.com/bd1976bris edited https://github.com/llvm/llvm-project/pull/126654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-17 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. LGTM. An interesting thing could be to track in the analyzer the number of suppressed underflows (i.e.: the number of times we resorted to hacking with this solution). That way, we could have more information about how far we deviate fro

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Baranov Victor via cfe-commits
vbvictor wrote: @PiotrZSL, thank you for pointing out better naming pattern for diag-messages, would use it in the future. 1. Created new warning and fix-it messages. 2. Renamed check. 3. As for now, my check can support any type that will have `reset` method, this include `std::optional`. May

[clang] [SystemZ][z/OS] Mark text files as text in ClangScanDeps (PR #127514)

2025-02-17 Thread Abhina Sree via cfe-commits
https://github.com/abhina-sree updated https://github.com/llvm/llvm-project/pull/127514 >From a015e8389fa263cbbb28e56e93fae733f5e94dde Mon Sep 17 00:00:00 2001 From: Abhina Sreeskantharajan Date: Mon, 17 Feb 2025 10:56:10 -0500 Subject: [PATCH 1/2] mark text files as text in ClangScanDeps ---

[clang] [SystemZ][z/OS] Mark text files as text in ClangScanDeps (PR #127514)

2025-02-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Abhina Sree (abhina-sree) Changes This patch continues the work that was started here https://reviews.llvm.org/D99426 to correctly open text files in text mode. --- Full diff: https://github.com/llvm/llvm-project/pull/127514.diff 1 File

[clang] [SystemZ][z/OS] Mark text files as text in ClangScanDeps (PR #127514)

2025-02-17 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 48c92dda0086d0ec2e8c1032ec53edec743c85f3 a015e8389fa263cbbb28e56e93fae733f5e94dde --e

[clang-tools-extra] [clang-tidy] Add AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-17 Thread Dmitry Nechitaev via cfe-commits
https://github.com/Nechda edited https://github.com/llvm/llvm-project/pull/126897 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Check for `-ignore-insert-conflict` support before using it in `apply_fixes` in `run-clang-tidy.py` (PR #127066)

2025-02-17 Thread Vicente Mataix Ferrándiz via cfe-commits
https://github.com/loumalouomega updated https://github.com/llvm/llvm-project/pull/127066 From 6c210298a5aab4eeb0d155534d739e21ba315469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicente=20Mataix=20Ferr=C3=A1ndiz?= Date: Thu, 13 Feb 2025 15:28:30 +0100 Subject: [PATCH 1/5] [tool] Remove legacy ar

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-17 Thread Endre Fülöp via cfe-commits
@@ -588,20 +603,48 @@ void ArrayBoundChecker::performCheck(const Expr *E, CheckerContext &C) const { State, ByteOffset, SVB.makeZeroArrayIndex(), SVB); if (PrecedesLowerBound) { - // The offset may be invalid (negative)... - if (!WithinLowerBound) { -

[clang-tools-extra] [clang-tidy] Add new check `readability-use-numeric-limits` (PR #127430)

2025-02-17 Thread Katherine Whitlock via cfe-commits
https://github.com/stellar-aria updated https://github.com/llvm/llvm-project/pull/127430 >From ba0eef9808b42b01e356cd5c87745f7477e07c68 Mon Sep 17 00:00:00 2001 From: Katherine Whitlock Date: Sun, 16 Feb 2025 22:45:06 -0500 Subject: [PATCH 1/2] [clang-tidy] Add new check `readability-use-numer

[clang] [clang][analyzer] Teach the BlockInCriticalSectionChecker about O_NONBLOCK streams (PR #127049)

2025-02-17 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun edited https://github.com/llvm/llvm-project/pull/127049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP] Missing implicit otherwise clause in metadirective. (PR #127113)

2025-02-17 Thread Alexey Bataev via cfe-commits
@@ -2882,6 +2882,12 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective( /*ReadDirectiveWithinMetadirective=*/true); break; } +// If no match is found and no otherwise clause is present, skip +// OMP5.2 Chapter 7.4: If no otherwise cla

[clang-tools-extra] [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (PR #127394)

2025-02-17 Thread via cfe-commits
@@ -110,6 +110,10 @@ Changes in existing checks ` check by providing additional examples and fixing some macro related false positives. +- Improved :doc:`cppcoreguidelines-pro-bounds-pointer-arithmetic flovent wrote: Done. https://github.com/llvm/llvm-pr

[clang] [Sema] Add code completion for if constexpr (PR #124315)

2025-02-17 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX updated https://github.com/llvm/llvm-project/pull/124315 >From 23e07a719b8262bd68950812bf47c5b9c0ecbeba Mon Sep 17 00:00:00 2001 From: Letu Ren Date: Sat, 25 Jan 2025 01:23:52 +0800 Subject: [PATCH 1/5] [Sema] Add code completion for if constexpr C++17 supports `i

[clang] [Sema] Add code completion for if constexpr and consteval (PR #124315)

2025-02-17 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX edited https://github.com/llvm/llvm-project/pull/124315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add code completion for if constexpr and consteval (PR #124315)

2025-02-17 Thread Letu Ren via cfe-commits
https://github.com/FantasqueX edited https://github.com/llvm/llvm-project/pull/124315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CMake] Fix -DLLVM_LINK_LLVM_DYLIB=on builds when using ninja multi config (PR #65451)

2025-02-17 Thread via cfe-commits
https://github.com/ur4t updated https://github.com/llvm/llvm-project/pull/65451 >From 77d8ba05ccf4f8d6953373d1e4f118ddbe865be9 Mon Sep 17 00:00:00 2001 From: ur4t <46435411+u...@users.noreply.github.com> Date: Thu, 17 Aug 2023 23:21:39 +0800 Subject: [PATCH 1/2] [llvm][CMake] Fix llvm shared libr

[clang] [clang][analyzer] Teach the BlockInCriticalSectionChecker about O_NONBLOCK streams (PR #127049)

2025-02-17 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-cmake-x86_64-avx512-win` running on `avx512-intel64-win` while building `clang` at step 6 "ninja check 1". Full details are available at: https://lab.llvm.org/buildbot/#/builders/81/builds/4823 Here is the relevant pi

[clang-tools-extra] [clang-tidy] Add new check `readability-use-numeric-limits` (PR #127430)

2025-02-17 Thread Katherine Whitlock via cfe-commits
@@ -91,6 +91,11 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`readability-use-numeric-limits + ` check to replace certain stellar-aria wrote: Reworded and reformatted to match

[libclc] [libclc] Fix dependencies on generated convert builtins (PR #127515)

2025-02-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/127515 In #127378 it was reported that builds without clspv targets enabled were failing after #124727, as all targets had a dependency on a file that only clspv targets generated. A quick fix was merged in #1273

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,146 @@ +//===--- SmartptrResetAmbiguousCallCheck.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: Ap

[clang] [llvm] [LLVM][Triple][NFCI] Add function to test for offloading triples (PR #126956)

2025-02-17 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/126956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,48 @@ +.. title:: clang-tidy - readability-ambiguous-smartptr-reset-call + +readability-ambiguous-smartptr-reset-call += + +Finds potentially erroneous calls to ``reset`` method on smart pointers when +the pointee type also has a

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Piotr Zegar via cfe-commits
@@ -0,0 +1,239 @@ +// RUN: %check_clang_tidy %s readability-ambiguous-smartptr-reset-call %t --fix-notes -- + +namespace std { + +template +struct unique_ptr { + T& operator*() const; + T* operator->() const; + void reset(T* p = nullptr); +}; + +template +struct shared_ptr {

[clang] [clang] Fix false positive regression for lifetime analysis warning. (PR #127460)

2025-02-17 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/127460 >From 3601ae837475da3c473f5be9c17687c439495ded Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 17 Feb 2025 10:08:14 +0100 Subject: [PATCH 1/3] [clang] Fix false positive regression for lifetime analysis war

[clang] [OpenMP] Silencly accept `neon_vector_type` for the offloading device (PR #127439)

2025-02-17 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 edited https://github.com/llvm/llvm-project/pull/127439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Teach the BlockInCriticalSectionChecker about O_NONBLOCK streams (PR #127049)

2025-02-17 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun approved this pull request. https://github.com/llvm/llvm-project/pull/127049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 9d48705 - [clang][analyzer] Teach the BlockInCriticalSectionChecker about O_NONBLOCK streams (#127049)

2025-02-17 Thread via cfe-commits
Author: flovent Date: 2025-02-17T15:35:40+01:00 New Revision: 9d487050a144b895950a6fd48b993513a714e69d URL: https://github.com/llvm/llvm-project/commit/9d487050a144b895950a6fd48b993513a714e69d DIFF: https://github.com/llvm/llvm-project/commit/9d487050a144b895950a6fd48b993513a714e69d.diff LOG:

[clang] Add support for dynamic libraries in CLANG_BOLT (PR #127020)

2025-02-17 Thread via cfe-commits
https://github.com/serge-sans-paille updated https://github.com/llvm/llvm-project/pull/127020 >From a701851462a19b4708599bd1bfcdd154b5b95573 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Thu, 13 Feb 2025 08:54:03 +0100 Subject: [PATCH] [clang][bolt] Improve CLANG_BOLT setup to support

[clang] [compiler-rt] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

2025-02-17 Thread Jonas Paulsson via cfe-commits
@@ -541,11 +543,26 @@ SystemZTargetLowering::SystemZTargetLowering(const TargetMachine &TM, } // Handle floating-point types. + // Promote all f16 operations to float, with some exceptions below. + for (unsigned Opc = 0; Opc < ISD::BUILTIN_OP_END; ++Opc) +setOperati

[clang] [clang][analyzer] Teach the BlockInCriticalSectionChecker about O_NONBLOCK streams (PR #127049)

2025-02-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/127049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add support for dynamic libraries in CLANG_BOLT (PR #127020)

2025-02-17 Thread via cfe-commits
serge-sans-paille wrote: @tstellar : gentle ping :-) https://github.com/llvm/llvm-project/pull/127020 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: @@ -1,7 +1,163 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s -// expected-no-diagnostics -void foo(void) { +extern void __assert_fail (__const char *__assertion, __const c

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Balazs Benics via cfe-commits
=?utf-8?q?Balázs_Kéri?= , =?utf-8?q?Balázs_Kéri?= Message-ID: In-Reply-To: steakhal wrote: I've marked the resolved comments. There are a few unresolved conversations left. https://github.com/llvm/llvm-project/pull/127191 ___ cfe-commits mailing li

[clang] [flang] [flang][OpenMP] Upstream `do concurrent` loop-nest detection. (PR #127478)

2025-02-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-fir-hlfir Author: Kareem Ergawy (ergawy) Changes Upstreams the next part of `do concurrent` to OpenMP mapping pass (from AMD's ROCm implementation). See https://github.com/llvm/llvm-project/pull/126026 for more context. This PR add loop nest dete

[clang] [clang] Fix false positive regression for lifetime analysis warning. (PR #127460)

2025-02-17 Thread Utkarsh Saxena via cfe-commits
https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/127460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/127409 >From 5eb1d222478c6966780f22aa664321807da87114 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Sun, 16 Feb 2025 20:37:34 +0100 Subject: [PATCH 1/2] [analyzer] Delay the checker constructions after parsing I

[clang] [SystemZ][z/OS] Mark text files as text in ClangScanDeps (PR #127514)

2025-02-17 Thread Abhina Sree via cfe-commits
https://github.com/abhina-sree created https://github.com/llvm/llvm-project/pull/127514 This patch continues the work that was started here https://reviews.llvm.org/D99426 to correctly open text files in text mode. >From a015e8389fa263cbbb28e56e93fae733f5e94dde Mon Sep 17 00:00:00 2001 From: A

[clang-tools-extra] [clang-tidy] Check for `-ignore-insert-conflict` support before using it in `apply_fixes` in `run-clang-tidy.py` (PR #127066)

2025-02-17 Thread Carlos Galvez via cfe-commits
Vicente Mataix =?utf-8?q?Ferrándiz?= , Vicente Mataix =?utf-8?q?Ferrándiz?= , Vicente Mataix =?utf-8?q?Ferrándiz?= , Vicente Mataix =?utf-8?q?Ferrándiz?= Message-ID: In-Reply-To: carlosgalvezp wrote: > should have delivered a run-clang-tidy.py that is appropriate for that > version. It shou

[clang-tools-extra] [clang-tidy] Add new check `readability-use-numeric-limits` (PR #127430)

2025-02-17 Thread via cfe-commits
@@ -91,6 +91,11 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`readability-use-numeric-limits + ` check to replace certain EugeneZelenko wrote: See 19 Release Notes for such statements format examples. https://github.com/llvm/llvm-project/

[clang] [libc] [Clang] Add handlers for 'match_any' and 'match_all' to `gpuintrin.h` (PR #127504)

2025-02-17 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/127504 Summary: These helpers are very useful but currently absent. They allow the user to get a bitmask representing the matches within the warp. I have made an executive decision to drop the `predicate` return from `m

[clang] [libc] [Clang] Add handlers for 'match_any' and 'match_all' to `gpuintrin.h` (PR #127504)

2025-02-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Joseph Huber (jhuber6) Changes Summary: These helpers are very useful but currently absent. They allow the user to get a bitmask representing the matches within the warp. I have made an executive decision to drop the `predicate` retur

[clang-tools-extra] [clang-tidy] Check for `-ignore-insert-conflict` support before using it in `apply_fixes` in `run-clang-tidy.py` (PR #127066)

2025-02-17 Thread Vicente Mataix Ferrándiz via cfe-commits
loumalouomega wrote: > > should have delivered a run-clang-tidy.py that is appropriate for that > > version. > > It should, but does it? A typical installation comes from installing the > Ubuntu packages, do they include `run-clang-tidy.py` at all? > > If not, then I don't think `run-clang-ti

[clang] [libc] [Clang] Add handlers for 'match_any' and 'match_all' to `gpuintrin.h` (PR #127504)

2025-02-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-libc Author: Joseph Huber (jhuber6) Changes Summary: These helpers are very useful but currently absent. They allow the user to get a bitmask representing the matches within the warp. I have made an executive decision

[clang-tools-extra] [clang-tidy] Check for `-ignore-insert-conflict` support before using it in `apply_fixes` in `run-clang-tidy.py` (PR #127066)

2025-02-17 Thread Vicente Mataix Ferrándiz via cfe-commits
https://github.com/loumalouomega closed https://github.com/llvm/llvm-project/pull/127066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add new check `readability-use-numeric-limits` (PR #127430)

2025-02-17 Thread via cfe-commits
@@ -0,0 +1,85 @@ +// RUN: %check_clang_tidy -std=c++11-or-later %s readability-use-numeric-limits %t +#include + +void constants() { + // CHECK-MESSAGES: :[[@LINE+2]]:14: warning: The constant -128 is being utilized. Consider using std::numeric_limits::min() instead [readabil

[clang] [analyzer] Add hack in ArrayBound to cover up missing casts (PR #127117)

2025-02-17 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 edited https://github.com/llvm/llvm-project/pull/127117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [nfc][analyzer] Add MemSpace trait to program state (PR #123003)

2025-02-17 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. LGTM, thanks for the improvements :) In the follow-up commits let's pay attention to the `ArrayBound` lower bound check where the code says that _"A symbolic region in unknown space represents an unknown pointer that may point into the m

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,146 @@ +//===--- SmartptrResetAmbiguousCallCheck.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: Ap

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,146 @@ +//===--- SmartptrResetAmbiguousCallCheck.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: Ap

[clang] [HLSL] Implement the 'and' HLSL function (PR #127098)

2025-02-17 Thread Chris B via cfe-commits
llvm-beanz wrote: For this issue I think there is a clear path forward to use the utilities that the `__builtin_hlsl_select` builtin uses to validate its arguments. I've filed https://github.com/llvm/llvm-project/issues/127512 to revisit all the other builtins that are using the pattern which

[clang-tools-extra] [clang-tidy] Add bugprone-smartptr-reset-ambiguous-call check (PR #121291)

2025-02-17 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,47 @@ +.. title:: clang-tidy - bugprone-smartptr-reset-ambiguous-call + +bugprone-smartptr-reset-ambiguous-call +== + +Finds potentially erroneous calls to ``reset`` method on smart pointers when +the pointee type also has a ``reset``

[clang] [NFC][Clang][CodeGen] Remove vestigial assertion (PR #127528)

2025-02-17 Thread Alex Voicu via cfe-commits
https://github.com/AlexVlx created https://github.com/llvm/llvm-project/pull/127528 This removes a vestigial assertion, which would erroneously trigger even though we now correctly handle valid arg mismatches (

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-17 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/119718 >From af135a1a4156be9076931ceeb92f75171a0cb7ad Mon Sep 17 00:00:00 2001 From: David Truby Date: Thu, 12 Dec 2024 14:50:19 + Subject: [PATCH] [flang] Add -f[no-]vectorize flags --- clang/include/clang/Dr

[clang-tools-extra] [clangd] Update XRefs to support overriden ObjC methods (PR #127109)

2025-02-17 Thread kadir çetinkaya via cfe-commits
@@ -1438,6 +1461,15 @@ ReferencesResult findReferences(ParsedAST &AST, Position Pos, uint32_t Limit, getOverriddenMethods(CMD, OverriddenMethods); } } +// Special case: Objective-C methods can override a parent class or +// protoco

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-17 Thread David Truby via cfe-commits
DavidTruby wrote: It looks like the force push has worked this time. Sorry it took so long to do, I was on holiday. https://github.com/llvm/llvm-project/pull/119718 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[clang] [TBAA] Refine pointer-tbaa for void pointers by pointer depth (PR #126047)

2025-02-17 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @brunodf-snps A reminder at the moment when you think this should be merged would be appreciated. https://github.com/llvm/llvm-project/pull/126047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang-tools-extra] [clang-tidy] Check for `-ignore-insert-conflict` support before using it in `apply_fixes` in `run-clang-tidy.py` (PR #127066)

2025-02-17 Thread Vicente Mataix Ferrándiz via cfe-commits
loumalouomega wrote: > I am a bit confused here. If you're using the **system** Clang toolchain > assembled by your company (outside of your control), that toolchain should > have delivered a `run-clang-tidy.py` that is appropriate for that version. > > If you are using `run-clang-tidy.py` fro

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balazs Benics via cfe-commits
@@ -40,17 +40,28 @@ enum class OpenVariant { OpenAt }; +static CachedMacroValue getCreateFlagValue(const ASTContext &Ctx, + const Preprocessor &PP) { + CachedMacroValue MacroVal("O_CREAT", PP); + if (MacroVal.hasValue()) +retur

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/127409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Thanks for the reviews! https://github.com/llvm/llvm-project/pull/127409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balazs Benics via cfe-commits
@@ -73,6 +73,23 @@ Nullability getNullabilityAnnotation(QualType Type); /// returned. std::optional tryExpandAsInteger(StringRef Macro, const Preprocessor &PP); +class CachedMacroValue { steakhal wrote: Right! Dropped in 10b4bd0403aa82a97f22a7fd55ee5126251390

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-17 Thread Christian Kandeler via cfe-commits
ckandeler wrote: *sigh* I want to use clangd for this purpose because it produces correct results particularly with non-trivial constructs, so I'm afraid that using such textual heuristics would kill that advantage. I'll give it a try, though. https://github.com/llvm/llvm-project/pull/118102

[clang] [OpenMP] Silencly accept `neon_vector_type` for the offloading device (PR #127439)

2025-02-17 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 d841c8842e17b7e74c3ee98c13a8a2505566deed 55e4d444572da286fdd4218178c6bc03c3e56b5b --e

[clang] [OpenMP] Silencly accept `neon_vector_type` for the offloading device (PR #127439)

2025-02-17 Thread Joseph Huber via cfe-commits
jhuber6 wrote: The test you added doesn't seem to pass. You can run it locally with `llvm-lit /path/to/your/test -v`. https://github.com/llvm/llvm-project/pull/127439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[clang-tools-extra] [clang-tidy] Check for `-ignore-insert-conflict` support before using it in `apply_fixes` in `run-clang-tidy.py` (PR #127066)

2025-02-17 Thread via cfe-commits
Vicente Mataix =?utf-8?q?Ferrándiz?= , Vicente Mataix =?utf-8?q?Ferrándiz?= , Vicente Mataix =?utf-8?q?Ferrándiz?= , Vicente Mataix =?utf-8?q?Ferrándiz?= Message-ID: In-Reply-To: whisperity wrote: I am a bit confused here. If you're using the **system** Clang toolchain assembled by your compa

[clang] Diagnose the code with trailing comma in the function call. (PR #125232)

2025-02-17 Thread Björn Pettersson via cfe-commits
bjope wrote: Thanks. I see now that it did not work with older clang (at least not 19.1.0). It did however work with our downstream fork before this patch. I haven't figured out how we avoided the error in the past. I guess we must have something downstream that avoided the error in the past,

  1   2   3   4   5   >