[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Nikita Popov (nikic) Changes HLSL uses CreateRuntimeFunction for two intrinsics. This is pretty unusual thing to do, and doesn't match what the rest of the file does. I suspect this might be because thes

[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/145334 HLSL uses CreateRuntimeFunction for two intrinsics. This is pretty unusual thing to do, and doesn't match what the rest of the file does. I suspect this might be because these are convergent calls, but the intrin

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2025-06-23 Thread Denis Mikhailov via cfe-commits
@@ -0,0 +1,437 @@ +// RUN: %check_clang_tidy -std=c++14 %s bugprone-incorrect-iterators %t + +namespace std { + +template struct pair {}; + +namespace execution { + +class parallel_policy {}; + +constexpr parallel_policy par; + +} // namespace execution + +template class reverse

[clang-tools-extra] Create a new check to look for mis-use in calls that take iterators (PR #99917)

2025-06-23 Thread Denis Mikhailov via cfe-commits
https://github.com/denzor200 requested changes to this pull request. https://github.com/llvm/llvm-project/pull/99917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-23 Thread Balazs Benics via cfe-commits
steakhal wrote: Modeling a function should only happen if that's the intended function. Sometimes this matching is deliberately fuzzy, but most often it's incidentally so and they should have really check the parameter and return types for exact match. Or at least the parameters that the model

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2025-06-23 Thread via cfe-commits
@@ -0,0 +1,163 @@ +.. title:: clang-tidy - bugprone-null-check-after-dereference + +bugprone-null-check-after-dereference += + +.. note:: + + This check uses a flow-sensitive static analysis to produce its + results. Therefore, it may be mor

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2025-06-23 Thread via cfe-commits
@@ -103,6 +103,12 @@ New checks Finds lambda captures that capture the ``this`` pointer and store it as class members without handle the copy and move constructors and the assignments. +- New :doc:`bugprone-null-check-after-dereference + ` check. + + Identifies redundant

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-23 Thread Donát Nagy via cfe-commits
NagyDonat wrote: > I was thinking about possible ways to unblock this change. > > If the additional code complexity needs justification, by measuring the > average impact (to ensure no regression happens in the common cases), and by > repeating the measurement of the handful of edge-cases wher

[clang-tools-extra] [clang-tidy] add new check: modernize-use-scoped-lock (PR #126434)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/126434 >From 516a831127d98d4b1a38a09d7d13f4f04a3a80ae Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 3 Mar 2025 09:25:03 +0300 Subject: [PATCH 01/13] [clang-tidy] add scoped-lock-check --- .../clang-tidy/m

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/143550 >From 897ef525a85345811ed8d3bc4da8d2886d05dfe7 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 10 Jun 2025 18:12:35 +0300 Subject: [PATCH 1/3] [clang-tidy] add 'IgnoreMarcos' option to 'special-member

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-23 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/144934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cccb82e - [HLSL][SPIRV] Allow large z value in numthreads (#144934)

2025-06-23 Thread via cfe-commits
Author: Steven Perron Date: 2025-06-23T09:36:12-04:00 New Revision: cccb82e5529136465ad3d073db7df4fe89a335c0 URL: https://github.com/llvm/llvm-project/commit/cccb82e5529136465ad3d073db7df4fe89a335c0 DIFF: https://github.com/llvm/llvm-project/commit/cccb82e5529136465ad3d073db7df4fe89a335c0.diff

[clang] [clang-tools-extra] [clang-tidy][dataflow] Add `bugprone-null-check-after-dereference` check (PR #84166)

2025-06-23 Thread Denis Mikhailov via cfe-commits
@@ -0,0 +1,163 @@ +.. title:: clang-tidy - bugprone-null-check-after-dereference + +bugprone-null-check-after-dereference += + +.. note:: + + This check uses a flow-sensitive static analysis to produce its + results. Therefore, it may be mor

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'avoid-goto' check (PR #143554)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor closed https://github.com/llvm/llvm-project/pull/143554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 05491e0 - [clang-tidy] add 'IgnoreMarcos' option to 'avoid-goto' check (#143554)

2025-06-23 Thread via cfe-commits
Author: Baranov Victor Date: 2025-06-23T16:27:18+03:00 New Revision: 05491e0359edcac9954a29f2a1579241522669ca URL: https://github.com/llvm/llvm-project/commit/05491e0359edcac9954a29f2a1579241522669ca DIFF: https://github.com/llvm/llvm-project/commit/05491e0359edcac9954a29f2a1579241522669ca.diff

[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-android` running on `sanitizer-buildbot-android` while building `clang` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/186/builds/10118 Here is the relev

[clang] [analyzer] Enforce not making overly complicated symbols (PR #144327)

2025-06-23 Thread Balázs Benics via cfe-commits
balazs-benics-sonarsource wrote: I was thinking about possible ways to unblock this change. If the additional code complexity needs justification, by measuring the average impact (to ensure no regression happens in the common cases), and by repeating the measurement of the handful of edge-case

[clang-tools-extra] [clang-tidy] properly handle private move constructors in `modernize-pass-by-value` check (PR #141304)

2025-06-23 Thread Baranov Victor via cfe-commits
vbvictor wrote: Ping https://github.com/llvm/llvm-project/pull/141304 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `bugprone-infinite-loop` check by adding handing for structured bindings (PR #144213)

2025-06-23 Thread via cfe-commits
flovent wrote: ping. https://github.com/llvm/llvm-project/pull/144213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-23 Thread Baranov Victor via cfe-commits
vbvictor wrote: > Your concern that "However, we will still try to model "incorrect" getline > methods, wasting cpu." is very premature optimization, the runtime change > would be totally negligible Indeed, without measurements, this argument is not viable. I've investigated the code of `StdL

[clang] [HLSL] Add option for VK layouts (PR #145327)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl @llvm/pr-subscribers-clang-driver Author: Steven Perron (s-perron) Changes We add the options to the driver, so that the one option that is being implemented at this time can be used. Issue an error for the other options. When we start to implement

[clang] [HLSL] Add option for VK layouts (PR #145327)

2025-06-23 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/145327 We add the options to the driver, so that the one option that is being implemented at this time can be used. Issue an error for the other options. When we start to implement the other options, we will have to f

[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-debian-cpp20` running on `clang-debian-cpp20` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/14393 Here is the

[clang-tools-extra] [clang-tidy] Add misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/142324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][AST] Adopt `llvm::copy` in Clang AST (PR #145192)

2025-06-23 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/145192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][AST] Drop `llvm::` in front of `ArrayRef`/`MutableArrayRef` (PR #145207)

2025-06-23 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. https://github.com/llvm/llvm-project/pull/145207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

2025-06-23 Thread Rahul Joshi via cfe-commits
https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/145187 >From 0579404d5df9dd7cf8380ed8b90355e3ef8391f0 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Sat, 21 Jun 2025 13:32:25 -0700 Subject: [PATCH 1/2] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in Str

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

2025-06-23 Thread via cfe-commits
@@ -1853,18 +1852,11 @@ class StringLiteral final public: /// This is the "fully general" constructor that allows representation of - /// strings formed from multiple concatenated tokens. + /// strings formed from multiple concatenated tokens. This same constructor + ///

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

2025-06-23 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/145187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Clang][AST] Use `llvm::copy` instead of `memcpy` in StringLiteral (PR #145187)

2025-06-23 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. Nice cleanup, thanks! https://github.com/llvm/llvm-project/pull/145187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 23ba0fd - [clang][bytecode] Fix assignInteger() with allocated primtypes (#145302)

2025-06-23 Thread via cfe-commits
Author: Timm Baeder Date: 2025-06-23T14:43:11+02:00 New Revision: 23ba0fdbfc2a240ca5ddcc7f71c7383437c00aaa URL: https://github.com/llvm/llvm-project/commit/23ba0fdbfc2a240ca5ddcc7f71c7383437c00aaa DIFF: https://github.com/llvm/llvm-project/commit/23ba0fdbfc2a240ca5ddcc7f71c7383437c00aaa.diff L

[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/145302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
@@ -220,6 +220,24 @@ getFoldingRanges(const std::string &Code, bool LineFoldingOnly) { auto EndPosition = [&](const Token &T) { return offsetToPosition(Code, EndOffset(T)); }; + + // Preprocessor directives HighCommander4 wrote: A couple of minor poi

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 requested changes to this pull request. Thanks for adding some unit tests, and sorry I didn't get a chance to look at this sooner. Unfortunately, it looks like the patch needs a bit more work, as I'm seeing it crash on incomplete code, for example: ```c++ #if

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
@@ -220,6 +220,24 @@ getFoldingRanges(const std::string &Code, bool LineFoldingOnly) { auto EndPosition = [&](const Token &T) { return offsetToPosition(Code, EndOffset(T)); }; + + // Preprocessor directives + auto PPRanges = pairDirectiveRanges(DirectiveStructure, Or

[clang-tools-extra] [clangd] Implement simple folding for preprocessor branches (PR #140959)

2025-06-23 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/140959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov requested changes to this pull request. Thanks, I believe we've seen some related breakages in the past and had to workaround the module structure because of this. It would definitely save some cycles for us in the future! My only request is to keep this change

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Orlando Cazalet-Hyams via cfe-commits
@@ -922,8 +922,8 @@ template <> struct MDNodeKeyImpl { MDString *LinkageName; Metadata *File; unsigned Line; - Metadata *Type; unsigned ScopeLine; + Metadata *Type; OCHyams wrote: Yep, 136 -> 128 bytes (144 -> 136 with the new bool). I don't think i

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Orlando Cazalet-Hyams via cfe-commits
OCHyams wrote: > LGTM, I think this raises a few questions about whether we're going to > support non-key-instructions code forever more. AFAIUI the premise is that > the debugging behaviour is worse if you've got groupless instructions in a > key-instructions program? Worse is an understatem

[clang-tools-extra] [clang-tidy] Add misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Denis Mikhailov via cfe-commits
@@ -0,0 +1,219 @@ +//===--- BoolBitwiseOperationCheck.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] [RISCV] Add Andes AX45MPV processor definition (PR #145267)

2025-06-23 Thread Pengcheng Wang via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang --target=riscv64 -mcpu=andes-ax45mpv --print-enabled-extensions | FileCheck %s wangpc-pp wrote: Is that necessary to add a new file for each CPU? https://github.com/llvm/llvm-project/pull/145267 _

[clang] [Clang] Back out the source location workaround for CXXConstructExpr (PR #145260)

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/145260 ___ 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 misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,198 @@ +//===--- BoolBitwiseOperationCheck.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] [RISCV] Add Andes AX45MPV processor definition (PR #145267)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Jim Lin (tclin914) Changes Andes AX45MPV is 64-bit in-order dual-issue 8-stage pipeline linux-capable CPU implementing the RV64IMAFDCV ISA extension. That is developed by Andes Technology https://www.andestech.com, a RISC-V IP pr

[clang] [clang][bytecode] Fix shifts with an allocated RHS (PR #145280)

2025-06-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/145280 ___ 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 misc-bool-bitwise-operation check (PR #142324)

2025-06-23 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,198 @@ +//===--- BoolBitwiseOperationCheck.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 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-23 Thread Baranov Victor via cfe-commits
@@ -18,6 +18,12 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { +namespace { +AST_MATCHER(CXXRecordDecl, isInMacro) { vbvictor wrote: Yes, I was thinking lately about it. I've seen some matchers use only `Node.getBeginLoc()

[clang] [llvm] [RISCV] Add Andes AX45MPV processor definition (PR #145267)

2025-06-23 Thread Jim Lin via cfe-commits
https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/145267 Andes AX45MPV is 64-bit in-order dual-issue 8-stage pipeline linux-capable CPU implementing the RV64IMAFDCV ISA extension. That is developed by Andes Technology https://www.andestech.com, a RISC-V IP provider.

[clang] [llvm] [WPD]: Apply speculative WPD in non-lto mode. (PR #145031)

2025-06-23 Thread Hassnaa Hamdi via cfe-commits
https://github.com/hassnaaHamdi edited https://github.com/llvm/llvm-project/pull/145031 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang][OpenMP] Non-contiguous strided update (PR #144635)

2025-06-23 Thread Alexey Bataev via cfe-commits
@@ -7384,7 +7384,40 @@ class MappableExprsHandler { // dimension. uint64_t DimSize = 1; -bool IsNonContiguous = CombinedInfo.NonContigInfo.IsNonContiguous; +// Detects non-contiguous updates due to strided accesses. +// Sets the 'IsNonContiguous' flag so th

[clang] [Clang] Back out the source location workaround for CXXConstructExpr (PR #145260)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Younan Zhang (zyn0217) Changes This removes the workaround introduced in 3e1a9cf3b8 and 1ba7dc38d. The workaround overwrote the right parenthesis location of the sub expression, which could be wrong when a CXXTemporaryObjectExpr occurs wi

[clang] [Clang] Back out the source location workaround for CXXConstructExpr (PR #145260)

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 ready_for_review https://github.com/llvm/llvm-project/pull/145260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Add s_setprio_inc_wg gfx1250 instruction (PR #145152)

2025-06-23 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec closed https://github.com/llvm/llvm-project/pull/145152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1c78d8d - [clang][bytecode] Fix shifts with an allocated RHS (#145280)

2025-06-23 Thread via cfe-commits
Author: Timm Baeder Date: 2025-06-23T10:14:33+02:00 New Revision: 1c78d8d9d7bcb4b20910047ad7db35f177a17c8c URL: https://github.com/llvm/llvm-project/commit/1c78d8d9d7bcb4b20910047ad7db35f177a17c8c DIFF: https://github.com/llvm/llvm-project/commit/1c78d8d9d7bcb4b20910047ad7db35f177a17c8c.diff L

[clang] [clang-tools-extra] [clang-tidy] Warn about misuse of sizeof operator in loops. (PR #143205)

2025-06-23 Thread Ziqing Luo via cfe-commits
@@ -130,6 +140,14 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { this); } + if (WarnOnSizeOfInLoopTermination) { +Finder->addMatcher(LoopExpr(hasDescendant(binaryOperator( ziqingluo-90 wrote: Since `hasDe

[clang-tools-extra] [clang-tidy] add 'IgnoreMarcos' option to 'special-member-functions' check (PR #143550)

2025-06-23 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp approved this pull request. LGTM, don't have strong opinions on the default. https://github.com/llvm/llvm-project/pull/143550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov edited https://github.com/llvm/llvm-project/pull/144796 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-23 Thread Cristian Assaiante via cfe-commits
https://github.com/cristianassaiante edited https://github.com/llvm/llvm-project/pull/145059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] fix crash when modelling 'getline' function in checkers (PR #145229)

2025-06-23 Thread Donát Nagy via cfe-commits
NagyDonat wrote: Personally I feel that option 2 ("add more error handling to avoid crashes in `checkGetdelim`") would be more "natural" for the static analyzer, because checking the exact types of the parameters is rare in the analyzer (I don't know any significant example apart from `StdLibr

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-23 Thread Cristian Assaiante via cfe-commits
@@ -0,0 +1,13 @@ +// REQUIRES: x86-registered-target + +// Make sure opt-bisect works through both pass managers +// +// RUN: %clang_cc1 -triple x86_64-linux-gnu -O1 %s -mllvm -opt-disable="inlinerpass,SROAPass,machine code sinking" -mllvm -opt-disable-verbose -emit-obj -o /dev/

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
@@ -828,7 +828,23 @@ void ODRHash::AddDecl(const Decl *D) { return; } - AddDeclarationName(ND->getDeclName()); + // For template parameters, use depth+index instead of name, because type + // canonicalization can change the name of the template parameter. + if (auto

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Ilya Biryukov via cfe-commits
@@ -5164,6 +5164,29 @@ namespace A { A::X x; #endif +namespace TemplateDecltypeOperator { + +#if defined(FIRST) || defined(SECOND) +template +T6 func(); +#endif + +#if defined(SECOND) +template +using UnrelatedAlias = decltype(func())(); +#endif + +#if defined(FIRST) || defi

[clang] [clang][bytecode] Fix shifts with an allocated RHS (PR #145280)

2025-06-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/145280 This was broken before because we ended up using a constructor that was disabled via assert(false). Use ShiftAP() if either LHS or RHS is allocated. >From 58751e9c9b5d9c2437c6a3a6f22b16c5aba8b8ab Mon Sep 17 00

[clang] [-Wunsafe-buffer-usage] Support span creation from std::initializer_list and begin/end pairs (PR #145311)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-analysis Author: Ziqing Luo (ziqingluo-90) Changes Support safe construction of `std::span` from `begin` and `end` calls on hardened containers or views or `std::initializer_list`s. For example, the following code is safe: ``` void create(std::in

[clang] [-Wunsafe-buffer-usage] Support span creation from std::initializer_list and begin/end pairs (PR #145311)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ziqing Luo (ziqingluo-90) Changes Support safe construction of `std::span` from `begin` and `end` calls on hardened containers or views or `std::initializer_list`s. For example, the following code is safe: ``` void create(std::initializer

[clang] [-Wunsafe-buffer-usage] Support span creation from std::initializer_list and begin/end pairs (PR #145311)

2025-06-23 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 created https://github.com/llvm/llvm-project/pull/145311 Support safe construction of `std::span` from `begin` and `end` calls on hardened containers or views or `std::initializer_list`s. For example, the following code is safe: ``` void create(std::initializer_

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
@@ -1904,7 +1904,8 @@ CGDebugInfo::createInlinedSubprogram(StringRef FuncName, /*ScopeLine=*/0, /*Flags=*/llvm::DINode::FlagArtificial, /*SPFlags=*/llvm::DISubprogram::SPFlagDefinition, -/*TParams=*/nullptr, /*ThrownTypes=*/nullptr, /*Annotations

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM, I think this raises a few questions about whether we're going to support non-key-instructions code forever more. AFAIUI the premise is that the debugging behaviour is worse if you've got groupless instructions in a key-instructions pr

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/144107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
@@ -922,8 +922,8 @@ template <> struct MDNodeKeyImpl { MDString *LinkageName; Metadata *File; unsigned Line; - Metadata *Type; unsigned ScopeLine; + Metadata *Type; jmorse wrote: This is space packing rather than being related to a functional change

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-23 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > I think this functionality will also help identify passes which drop debug > information and help with [the work proposed in this > RFC](https://discourse.llvm.org/t/rfc-require-real-or-annotated-source-locations-on-all-instructions/86816). As it happens, I have been using a d

[clang] [llvm] [RISCV] Add Andes AX45MPV processor definition (PR #145267)

2025-06-23 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/145267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++20][Modules] Implement P1857R3 Modules Dependency Discovery (PR #107168)

2025-06-23 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/107168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread Baranov Victor via cfe-commits
vbvictor wrote: Is this unfinished work? I'd suggest to covert this to draft. https://github.com/llvm/llvm-project/pull/145307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-23 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: If we choose to be consistent with the standard wording, we might need to say "[...] templates for which neither explicit specialization nor partial specialization should be declared [...]", which is quite verbose. The crux seems to be that it's not clear in the standard

[clang] [Clang] Allow explicit member specialization to differ from template declaration wrt constexpr (PR #145272)

2025-06-23 Thread Vikram Hegde via cfe-commits
https://github.com/vikramRH created https://github.com/llvm/llvm-project/pull/145272 This attempts to fix https://github.com/llvm/llvm-project/issues/26078. However I have couple of fundamental questions with the 7.1.5 consexpr note "[ Note: An explicit specialization can differ from the templa

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread Vasiliy Kulikov via cfe-commits
https://github.com/segoon updated https://github.com/llvm/llvm-project/pull/145307 >From 546567ee93c1c0c0de5e34a1ec4d7c2ccfd081c8 Mon Sep 17 00:00:00 2001 From: Vasily Kulikov Date: Mon, 12 May 2025 20:36:43 +0300 Subject: [PATCH 1/3] clang-tidy: add bugprone-taxi-async-use-after-free --- ...

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-23 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts approved this pull request. https://github.com/llvm/llvm-project/pull/144934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-23 Thread Nathan Gauër via cfe-commits
@@ -1033,12 +1033,15 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) { void SemaHLSL::handleNumThreadsAttr(Decl *D, const ParsedAttr &AL) { llvm::VersionTuple SMVersion = getASTContext().getTargetInfo().getTriple().getOSVersion(); + bool IsDXI

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Vasiliy Kulikov (segoon) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/145307.diff 8 Files Affected: - (modified) clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp (+3) - (modified) clang-tool

[clang-tools-extra] Feature/labmda uaf (PR #145307)

2025-06-23 Thread Vasiliy Kulikov via cfe-commits
https://github.com/segoon created https://github.com/llvm/llvm-project/pull/145307 None >From 546567ee93c1c0c0de5e34a1ec4d7c2ccfd081c8 Mon Sep 17 00:00:00 2001 From: Vasily Kulikov Date: Mon, 12 May 2025 20:36:43 +0300 Subject: [PATCH 1/2] clang-tidy: add bugprone-taxi-async-use-after-free --

[clang] [clang-c] introduce queries on GCC-style inline assembly statements (PR #143424)

2025-06-23 Thread via cfe-commits
https://github.com/dingxiangfei2009 updated https://github.com/llvm/llvm-project/pull/143424 >From cbfed6b195083d07330694ae497f59f4007e6a1f Mon Sep 17 00:00:00 2001 From: Xiangfei Ding Date: Mon, 9 Jun 2025 13:57:18 + Subject: [PATCH 1/2] [clang-c] introduce queries on GCC-style inline asse

[clang] [clang][nvlink-wrapper] Add support for opt-remarks command line options (PR #145200)

2025-06-23 Thread Miguel Cárdenas via cfe-commits
https://github.com/miguelcsx updated https://github.com/llvm/llvm-project/pull/145200 From 883345d337df982a87c55b11b3374cf661b7b49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20C=C3=A1rdenas?= Date: Sun, 22 Jun 2025 03:32:24 +0200 Subject: [PATCH 1/3] [clang][nvlink-wrapper] Add support fo

[clang] [AArch64] Add option -msve-streaming-vector-bits= . (PR #144611)

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -820,16 +820,23 @@ AArch64TargetInfo::getTargetBuiltins() const { std::optional> AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts, - bool IsArmStreamingFunction, + ArmStreamingKind IsArmStreaming

[clang] [AArch64] Add option -msve-streaming-vector-bits= . (PR #144611)

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -1666,30 +1666,43 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, } // Handle -msve_vector_bits= - if (Arg *A = Args.getLastArg(options::OPT_msve_vector_bits_EQ)) { + auto HandleVectorBits = [&](Arg *A, bool Streaming) { StringRef Val = A->getValue();

[clang] [AArch64] Add option -msve-streaming-vector-bits= . (PR #144611)

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -82,6 +82,15 @@ class SemaARM : public SemaBase { void handleInterruptSaveFPAttr(Decl *D, const ParsedAttr &AL); void CheckSMEFunctionDefAttributes(const FunctionDecl *FD); + + /// Return true if the given types are an SVE builtin and a VectorType that + /// is a fixe

[clang] [AArch64] Add option -msve-streaming-vector-bits= . (PR #144611)

2025-06-23 Thread Sander de Smalen via cfe-commits
@@ -820,16 +820,23 @@ AArch64TargetInfo::getTargetBuiltins() const { std::optional> AArch64TargetInfo::getVScaleRange(const LangOptions &LangOpts, - bool IsArmStreamingFunction, + ArmStreamingKind IsArmStreaming

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-23 Thread Cristian Assaiante via cfe-commits
https://github.com/cristianassaiante updated https://github.com/llvm/llvm-project/pull/145059 >From ab6063493744ef5a1ee92fd249bf8d86b7299fad Mon Sep 17 00:00:00 2001 From: Cristian Assaiante Date: Fri, 20 Jun 2025 16:56:23 +0200 Subject: [PATCH 1/3] Adding -opt-disable and a test for it --- c

[clang] [clang] ODR hashes depth+index and not name of TemplateTypeParm (PR #144796)

2025-06-23 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. The fix doesn't look quite right. It's not correct to say that canonicalization changes the declaration name. We don't canonicalize declarations after all. It's just that a canonical template parameter type doesn't refer to a

[clang] [clang][scandeps] Improve handling of rawstrings. (PR #139504)

2025-06-23 Thread Tobias Hieta via cfe-commits
tru wrote: Sorry for the delay. I have addressed both your comments now @benlangmuir - reworked it to use Lexer::getEscapedNewLineSize() and removed the assertline. I also expanded the test coverage. https://github.com/llvm/llvm-project/pull/139504 _

[clang] [Clang][LoongArch] Fixed incorrect _BitInt(N>64) alignment (PR #145297)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Ami-zhang) Changes This patch makes determining alignment and width of BitInt to be target ABI specific and makes it consistent with [Procedure Call Standard for the LoongArch™ Architecture] for LoongArch target (https://github.com/

[clang] [clang][CodeGen] Added SanitizerHandler mapping, trap messages in debug info, and corresponding test cases. (PR #143758)

2025-06-23 Thread via cfe-commits
https://github.com/anthonyhatran updated https://github.com/llvm/llvm-project/pull/143758 >From 0cf31b41838d449835296d4ec290209bd5aae1e6 Mon Sep 17 00:00:00 2001 From: Anthony Tran Date: Wed, 11 Jun 2025 10:11:09 -0700 Subject: [PATCH 1/2] Added Trap messages in debug info --- clang/lib/CodeG

[clang] fccc6ee - [C++20] [Modules] Don't make enum constant members always visible

2025-06-23 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2025-06-23T14:39:08+08:00 New Revision: fccc6ee7021811a27ab1303d19407f703853ab92 URL: https://github.com/llvm/llvm-project/commit/fccc6ee7021811a27ab1303d19407f703853ab92 DIFF: https://github.com/llvm/llvm-project/commit/fccc6ee7021811a27ab1303d19407f703853ab92.diff LO

[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/145302.diff 2 Files Affected: - (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+17-6) - (modified) clang/test/AST/ByteCode/builtin-functions

[clang] [Clang] Back out the source location workaround for CXXConstructExpr (PR #145260)

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/145260 >From 96f1c3bbbf7c07bf9d11bb907e3a35e196d181aa Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 23 Jun 2025 12:31:39 +0800 Subject: [PATCH] [Clang] Back out the source location workaround for CXXConstruct

[clang] [clang-tools-extra] [clang-tidy] `bugprone-unchecked-optional-access`: handle `BloombergLP::bdlb:NullableValue::makeValue` to prevent false-positives (PR #144313)

2025-06-23 Thread Baranov Victor via cfe-commits
@@ -985,6 +985,20 @@ auto buildTransferMatchSwitch() { isOptionalMemberCallWithNameMatcher(hasName("isNull")), transferOptionalIsNullCall) + // NullableValue::makeValue, NullableValue::makeValueInplace + // Only NullableValue has these methods, bu

[clang] [clang][bytecode] Fix assignInteger() with allocated primtypes (PR #145302)

2025-06-23 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/145302 None >From 33eadba2a8d300be67cab69540537589400f7b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 23 Jun 2025 12:00:20 +0200 Subject: [PATCH] [clang][bytecode] Fix assignInteger() wit

[clang] [Clang] Back out the source location workaround for CXXConstructExpr (PR #145260)

2025-06-23 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/145260 >From 504c05c3a076ecafb4f11ce0703caddfac6e06d1 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Mon, 23 Jun 2025 12:31:39 +0800 Subject: [PATCH] [Clang] Back out the source location workaround for CXXConstruct

[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

2025-06-23 Thread Cristian Assaiante via cfe-commits
https://github.com/cristianassaiante updated https://github.com/llvm/llvm-project/pull/145059 >From ab6063493744ef5a1ee92fd249bf8d86b7299fad Mon Sep 17 00:00:00 2001 From: Cristian Assaiante Date: Fri, 20 Jun 2025 16:56:23 +0200 Subject: [PATCH 1/2] Adding -opt-disable and a test for it --- c

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-23 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/144710 >From 2c278271277823b3544d991365e58f97dd4b7031 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 18 Jun 2025 10:17:05 +0100 Subject: [PATCH 1/2] [flang][AArch64] Always compiler-rt to flang linking after

  1   2   >