[clang] [analyzer] Clean up slightly the messed up ownership model of the analyzer (PR #128368)

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

[clang] [analyzer] Clean up slightly the messed up ownership model of the analyzer (PR #128368)

2025-02-24 Thread Balazs Benics via cfe-commits
@@ -50,14 +46,11 @@ AnalysisManager::AnalysisManager(ASTContext &ASTCtx, Preprocessor &PP, AnalysisManager::~AnalysisManager() { FlushDiagnostics(); - for (PathDiagnosticConsumer *Consumer : PathConsumers) { -delete Consumer; - } } steakhal wrote: `

[clang] [analyzer] Clean up slightly the messed up ownership model of the analyzer (PR #128368)

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

[clang] 3dc1594 - [analyzer] Clean up slightly the messed up ownership model of the analyzer (#128368)

2025-02-24 Thread via cfe-commits
Author: Balazs Benics Date: 2025-02-24T11:34:36+01:00 New Revision: 3dc159431be7a8c5f1a26a8bd57794f1c7008969 URL: https://github.com/llvm/llvm-project/commit/3dc159431be7a8c5f1a26a8bd57794f1c7008969 DIFF: https://github.com/llvm/llvm-project/commit/3dc159431be7a8c5f1a26a8bd57794f1c7008969.diff

[clang] [-Wunsafe-buffer-usage] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

2025-02-24 Thread Ilya Biryukov via cfe-commits
https://github.com/ilya-biryukov requested changes to this pull request. This makes sense, although I suspect it doesn't work because the code checks for `std` namespace. It would be nice to get a signal from the code owners that they're happy with adding Abseil as a special case in addition

[clang] [-Wunsafe-buffer-usage] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

2025-02-24 Thread Ilya Biryukov via cfe-commits
@@ -891,7 +891,9 @@ AST_MATCHER(CallExpr, hasUnsafeSnprintfBuffer) { // Pattern 1: static StringRef SizedObjs[] = {"span", "array", "vector", - "basic_string_view", "basic_string"}; + "basic_string_view", "b

[clang] [-Wunsafe-buffer-usage] Add absl::{Span,string_view} to UnsafeBufferUsage analysis (PR #127698)

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

[clang] [analyzer] Limit Store by region-store-binding-limit (PR #127602)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat approved this pull request. Anyway, let's just merge this as it is now. The code is basically OK, I still don't have the brainpower to hold all the details in my mind and if I'll catch some divine inspiration in the future, I can still refactor this as a follow-up

[clang] [analyzer] Limit Store by region-store-binding-limit (PR #127602)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/127602 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Updating to include gcc-toolsets 13 and 14 (PR #128438)

2025-02-24 Thread Bill Blum via cfe-commits
roadswitcher wrote: | I suspect that this change may be about people building their own clang (not the one RHEL ships) and wanting to use GCC toolset. Sorry, I should have been more specific in my original comment. Yes, we are building LLVM 19 from source along with a number of other tools/lib

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

2025-02-24 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 e7ad07ffb846a9812d9567b8d4b680045dce5b28 c0eecd16a733d6d157b2011ae0706bf88d3edd2a --e

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

2025-02-24 Thread Dmitry Nechitaev via cfe-commits
https://github.com/Nechda updated https://github.com/llvm/llvm-project/pull/126897 >From 6b61bff3f6ad48baf7414f0e88fd98e098a78e9e Mon Sep 17 00:00:00 2001 From: Dmitry Nechitaev Date: Mon, 17 Feb 2025 13:30:46 +0300 Subject: [PATCH 1/3] Add AllowFalseEvaluated to clang-tidy noexcept-move-const

[clang-tools-extra] e1cc5e9 - [clang-tidy] Fix build after 3dc159431be7a8c5f1a26a8bd57794f1c7008969

2025-02-24 Thread Benjamin Kramer via cfe-commits
Author: Benjamin Kramer Date: 2025-02-24T12:40:02+01:00 New Revision: e1cc5e9f9ab628f501bb88488e865c2a039321e4 URL: https://github.com/llvm/llvm-project/commit/e1cc5e9f9ab628f501bb88488e865c2a039321e4 DIFF: https://github.com/llvm/llvm-project/commit/e1cc5e9f9ab628f501bb88488e865c2a039321e4.dif

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

2025-02-24 Thread Dmitry Nechitaev via cfe-commits
https://github.com/Nechda updated https://github.com/llvm/llvm-project/pull/126897 >From 6b61bff3f6ad48baf7414f0e88fd98e098a78e9e Mon Sep 17 00:00:00 2001 From: Dmitry Nechitaev Date: Mon, 17 Feb 2025 13:30:46 +0300 Subject: [PATCH 1/2] Add AllowFalseEvaluated to clang-tidy noexcept-move-const

[clang-tools-extra] [analyzer][clang-tidy] Fixup build after 3dc159431be7 (PR #128499)

2025-02-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/128499 There was one place I forgot to update, clang-tidy. I only ran the CSA tests in #128368. Fixes: https://lab.llvm.org/buildbot/#/builders/52/builds/6286/steps/9/logs/stdio >From 29a4f188299db40858e23ec27c85ff5

[clang-tools-extra] [analyzer][clang-tidy] Fixup build after 3dc159431be7 (PR #128499)

2025-02-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Balazs Benics (steakhal) Changes There was one place I forgot to update, clang-tidy. I only ran the CSA tests in #128368. Fixes: https://lab.llvm.org/buildbot/#/builders/52/builds/6286/steps/9/logs/stdio --- Full diff:

[clang] c80b99d - [Sema][NFC] Move two misplaced uninit tests to clang/test/SemaCXX (#128013)

2025-02-24 Thread via cfe-commits
Author: Donát Nagy Date: 2025-02-24T12:44:00+01:00 New Revision: c80b99d98ad0c7a3c185b4f09d2b60affb34cad1 URL: https://github.com/llvm/llvm-project/commit/c80b99d98ad0c7a3c185b4f09d2b60affb34cad1 DIFF: https://github.com/llvm/llvm-project/commit/c80b99d98ad0c7a3c185b4f09d2b60affb34cad1.diff LO

[clang] [Sema][NFC] Move two misplaced uninit tests to clang/test/SemaCXX (PR #128013)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat closed https://github.com/llvm/llvm-project/pull/128013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema][NFC] Move two misplaced uninit tests to clang/test/SemaCXX (PR #128013)

2025-02-24 Thread Donát Nagy via cfe-commits
NagyDonat wrote: I'm merging this now because I feel that the current reviews are sufficient for this simple NFC change. If there are any further observations/suggestions, feel free to mention them -- I can address them in a follow-up commit. https://github.com/llvm/llvm-project/pull/128013 _

[clang-tools-extra] [analyzer][clang-tidy] Fixup build after 3dc159431be7 (PR #128499)

2025-02-24 Thread Mikael Holmén via cfe-commits
mikaelholmen wrote: Done already in e1cc5e9f9ab628f5 https://github.com/llvm/llvm-project/pull/128499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Limit Store by region-store-binding-limit (PR #127602)

2025-02-24 Thread Balázs Benics via cfe-commits
balazs-benics-sonarsource wrote: > Anyway, let's just merge this as it is now. > > The code is basically OK, I still don't have the brainpower to hold all the > details in my mind (kudos for the fact that _you_ managed to put this > together) and if I'll catch some divine inspiration in the fu

[clang-tools-extra] [analyzer][clang-tidy] Fixup build after 3dc159431be7 (PR #128499)

2025-02-24 Thread Balazs Benics via cfe-commits
steakhal wrote: > Done already in > [e1cc5e9](https://github.com/llvm/llvm-project/commit/e1cc5e9f9ab628f501bb88488e865c2a039321e4) Thank you @d0k, @mikaelholmen! https://github.com/llvm/llvm-project/pull/128499 ___ cfe-commits mailing list cfe-commi

[clang-tools-extra] [analyzer][clang-tidy] Fixup build after 3dc159431be7 (PR #128499)

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

[libclc] [libclc] Remove clspv-specific clc conversions (PR #128500)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128500 The clc and clc+clspv modes produced the same conversions code, so this patch simplifies the process. It further simplifies the internal checks the script makes by assuming the mutual exclusivity. >From ce

[libclc] [libclc] Remove clspv-specific clc conversions (PR #128500)

2025-02-24 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/128500 ___ 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 AllowFalseEvaluated flag to clang-tidy noexcept-move-constructor check (PR #126897)

2025-02-24 Thread Dmitry Nechitaev via cfe-commits
Nechda wrote: If you are happy with this change, please approve it and merge it. I do not have the necessary permissions to perform the merge operation. https://github.com/llvm/llvm-project/pull/126897 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] Thread Safety Analysis: Improved pointer handling (PR #127396)

2025-02-24 Thread Marco Elver via cfe-commits
melver wrote: Gentle ping. Thanks! https://github.com/llvm/llvm-project/pull/127396 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread via cfe-commits
@@ -0,0 +1,272 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + +class Trivial {}; +struct NonRelocatable { +~NonRelocatable(); +}; +static NonRelocatable NonRelocatable_g; + +class A trivially_relocatable_if_eligible {}; +class B trivially_relocatable_if_eligible : Trivial{}; +

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread via cfe-commits
@@ -0,0 +1,272 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + +class Trivial {}; +struct NonRelocatable { +~NonRelocatable(); +}; +static NonRelocatable NonRelocatable_g; + +class A trivially_relocatable_if_eligible {}; +class B trivially_relocatable_if_eligible : Trivial{}; +

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-02-24 Thread via cfe-commits
https://github.com/el-ev updated https://github.com/llvm/llvm-project/pull/121577 >From 5551c179d4b1ed0f41885fc96fa4844c9b0435b5 Mon Sep 17 00:00:00 2001 From: Iris Shi <0...@owo.li> Date: Fri, 3 Jan 2025 23:00:14 +0800 Subject: [PATCH 1/5] fix gnu::init_priority behavior --- clang/include/cla

[libclc] aca8a5c - [libclc] Remove clspv-specific clc conversions (#128500)

2025-02-24 Thread via cfe-commits
Author: Fraser Cormack Date: 2025-02-24T12:31:55Z New Revision: aca8a5cb2325767859f38894f42ce47732cbb53e URL: https://github.com/llvm/llvm-project/commit/aca8a5cb2325767859f38894f42ce47732cbb53e DIFF: https://github.com/llvm/llvm-project/commit/aca8a5cb2325767859f38894f42ce47732cbb53e.diff LOG

[libclc] [libclc] Remove clspv-specific clc conversions (PR #128500)

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

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread via cfe-commits
@@ -1826,6 +1827,12 @@ The following type trait primitives are supported by Clang. Those traits marked functionally equivalent to copying the underlying bytes and then dropping the source object on the floor. This is true of trivial types and types which were made trivia

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread via cfe-commits
@@ -3625,6 +3632,21 @@ Query for this feature with ``__has_builtin(__builtin_operator_new)`` or replaceable global (de)allocation functions, but do support calling at least ``::operator new(size_t)`` and ``::operator delete(void*)``. + +``__builtin_trivially_relocate

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

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

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

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

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-02-24 Thread via cfe-commits
https://github.com/MythreyaK created https://github.com/llvm/llvm-project/pull/128503 This is the yaml config equivalent of `--header-insertion` CLI Fix for [issue](https://github.com/clangd/clangd/issues/2032) >From c8552b8aa3b805ea8c5679242d5c26c7871196ae Mon Sep 17 00:00:00 2001 From: Mythr

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

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

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-02-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd @llvm/pr-subscribers-clang-tools-extra Author: Mythreya (MythreyaK) Changes This is the yaml config equivalent of `--header-insertion` CLI Fix for [issue](https://github.com/clangd/clangd/issues/2032) --- Full diff: https://github.com/llvm/llvm-

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilia (Large Immediate Arithmetic) extension (PR #124706)

2025-02-24 Thread Sudharsan Veeravalli via cfe-commits
https://github.com/svs-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/124706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-02-24 Thread via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/128503 >From c8552b8aa3b805ea8c5679242d5c26c7871196ae Mon Sep 17 00:00:00 2001 From: Mythreya Date: Mon, 24 Feb 2025 04:34:38 -0800 Subject: [PATCH] [clangd] Add `HeaderInsertion` yaml config option This is the yaml

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-02-24 Thread via cfe-commits
https://github.com/MythreyaK updated https://github.com/llvm/llvm-project/pull/128503 >From 8a0714cc760d5e14de6f3b34ec4058c9c13b8613 Mon Sep 17 00:00:00 2001 From: Mythreya Date: Mon, 24 Feb 2025 04:34:38 -0800 Subject: [PATCH] [clangd] Add `HeaderInsertion` yaml config option This is the yaml

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-02-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/128506 Note the CLC versions of these builtins don't offer the vector/scalar forms, for simplicity. The OpenCL layer converts the vector/scalar form to vector/vector. The CLC builtins use clang's __builtin_elemen

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-02-24 Thread Gábor Horváth via cfe-commits
@@ -171,19 +172,11 @@ class SValBuilder { // Forwarding methods to SymbolManager. - const SymbolConjured* conjureSymbol(const Stmt *stmt, - const LocationContext *LCtx, - QualType type, -

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-02-24 Thread Gábor Horváth via cfe-commits
@@ -27,7 +27,8 @@ namespace ento { /// by the loop body in any iteration. ProgramStateRef getWidenedLoopState(ProgramStateRef PrevState, const LocationContext *LCtx, -unsigned BlockCount, const Stmt *LoopSt

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-02-24 Thread Gábor Horváth via cfe-commits
@@ -1515,7 +1515,8 @@ void CStringChecker::evalCopyCommon(CheckerContext &C, const CallEvent &Call, // conjure a return value for later. if (lastElement.isUnknown()) lastElement = C.getSValBuilder().conjureSymbolVal( -nullptr, Call.getOriginExpr

[clang] [Clang][analyzer] replace Stmt* with ConstCFGElementRef in SymbolConjured (PR #128251)

2025-02-24 Thread Gábor Horváth via cfe-commits
@@ -101,8 +103,10 @@ class SymbolConjured : public SymbolData { } public: - /// It might return null. - const Stmt *getStmt() const { return S; } Xazax-hun wrote: Would it make sense to keep `getStmt`? It could still return null but some callers might fi

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-02-24 Thread via cfe-commits
MythreyaK wrote: Example config ```yaml Completion: HeaderInsertion: Never ``` https://github.com/llvm/llvm-project/pull/128503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-02-24 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Note @arsenm I didn't touch [amdgcn's fmin/fmax](https://github.com/llvm/llvm-project/blob/main/libclc/amdgcn/lib/math/fmin.cl) or [r600's](https://github.com/llvm/llvm-project/blob/main/libclc/r600/lib/math/fmin.cl) as I wasn't sure if any of that could be updated or at le

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread via cfe-commits
@@ -0,0 +1,272 @@ +// RUN: %clang_cc1 -std=c++2c -verify %s + +class Trivial {}; +struct NonRelocatable { +~NonRelocatable(); +}; +static NonRelocatable NonRelocatable_g; + +class A trivially_relocatable_if_eligible {}; +class B trivially_relocatable_if_eligible : Trivial{}; +

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-02-24 Thread Matt Arsenault via cfe-commits
arsenm wrote: These should use the regular builtin fmin / fmax. > I note that the comments around the use of canonicalize mention sNAN, which > isn't required by the spec. The spec is quite badly written on what's expected of snans here, and the conformance test doesn't test what is written

[clang-tools-extra] [clangd] Add `HeaderInsertion` yaml config option (PR #128503)

2025-02-24 Thread via cfe-commits
MythreyaK wrote: Adding @HighCommander4 as reviewer. https://github.com/llvm/llvm-project/pull/128503 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread via cfe-commits
@@ -127,6 +127,33 @@ class AccessSpecDecl : public Decl { static bool classofKind(Kind K) { return K == AccessSpec; } }; +enum class RelocatableOrReplaceableClassSpecifierKind { + Relocatable, + Replaceable +}; + +template +class BasicRelocatableOrReplaceableClassSpecifie

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread via cfe-commits
@@ -12427,6 +12427,11 @@ def err_builtin_invalid_arg_type: Error < "an 'int'|" "a vector of floating points}1 (was %2)">; +def err_builtin_trivially_relocate_invalid_arg_type: Error < + "first%select{||| and second}0 argument%select{|||s}0 to " cor3ntin w

[clang] [llvm] [Clang][LLVM] Implement single-single vectors MOP4{A/S} (PR #127797)

2025-02-24 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/127797 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread Nikolas Klauser via cfe-commits
@@ -1826,6 +1827,12 @@ The following type trait primitives are supported by Clang. Those traits marked functionally equivalent to copying the underlying bytes and then dropping the source object on the floor. This is true of trivial types and types which were made trivia

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-02-24 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > These should use the regular builtin fmin / fmax. Do you mean the AMD implementations, or the CLC ones too? Note there's no vector support for `__builtin_fmin` which is why I chose `__builtin_elementwise_min`. They appear to generate the same code so maybe I'm misundersta

[clang] [Clang] add -Wshift-bool warning to handle shifting of bool (PR #127336)

2025-02-24 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon approved this pull request. I'm happy whenever @AaronBallman is. https://github.com/llvm/llvm-project/pull/127336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [Wunsafe-buffer-usage] Turn off unsafe-buffer warning for methods annotated with clang::unsafe_buffer_usage attribute (PR #125671)

2025-02-24 Thread Mariya Podchishchaeva via cfe-commits
@@ -245,3 +243,56 @@ struct AggregateViaDefaultInit { void testAggregateViaDefaultInit() { AggregateViaDefaultInit A; }; + +struct A { + int arr[2]; + + [[clang::unsafe_buffer_usage]] + int *ptr; +}; + +namespace std{ + template class span { + + T *elements; + + pu

[clang] [Clang][Sema] Add special handling of mfloat8 in initializer lists (PR #125097)

2025-02-24 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/125097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/128508 Before commit 6e17ed9 the test files `outofbound.c` and `outofbound-notwork.c` tested the behavior of the old alpha checker `alpha.security.ArrayBound` (V1); then that commit converted them into tests for the

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Donát Nagy (NagyDonat) Changes Before commit 6e17ed9 the test files `outofbound.c` and `outofbound-notwork.c` tested the behavior of the old alpha checker `alpha.security.ArrayBound` (V1); then that commit converted them into tests for th

[clang] [llvm] [AARCH64][Neon] switch to using bitcasts in arm_neon.h where appropriate (PR #127043)

2025-02-24 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray approved this pull request. LGTM. Glad to see the "utterly horrific" code gone :) https://github.com/llvm/llvm-project/pull/127043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-02-24 Thread Pierre van Houtryve via cfe-commits
https://github.com/Pierre-vh created https://github.com/llvm/llvm-project/pull/128509 The default number of partitions is the number of cores on the machine with a cap at 16, as going above 16 is unlikely to be useful in the common case. Adds a flto-partitions option to override the number of

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-02-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Pierre van Houtryve (Pierre-vh) Changes The default number of partitions is the number of cores on the machine with a cap at 16, as going above 16 is unlikely to be usef

[clang] [clang][bytecode] Expand subscript base if of pointer type (PR #128511)

2025-02-24 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/128511 This is similar to what we do in the AddOffset instruction when adding an offset to a pointer. >From dd05a8c4c2a8d23b294723c554a33b65080a2367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date:

[clang] [clang][bytecode] Expand subscript base if of pointer type (PR #128511)

2025-02-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes This is similar to what we do in the AddOffset instruction when adding an offset to a pointer. --- Full diff: https://github.com/llvm/llvm-project/pull/128511.diff 4 Files Affected: - (modified) clang/lib

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread Mariya Podchishchaeva via cfe-commits
@@ -3808,13 +3868,39 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, SourceLocation AbstractLoc; bool IsFinalSpelledSealed = false; bool IsAbstract = false; + TriviallyRelocatableSpecifier TriviallyRelocatable; + ReplaceableSpecifier Replacable;

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread Mariya Podchishchaeva via cfe-commits
@@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -std=c++03 -verify=expected,cxx11,cxx03 -fsyntax-only %s +// RUN: %clang_cc1 -std=c++11 -verify=expected,cxx11 -fsyntax-only %s +// RUN: %clang_cc1 -std=c++2c -verify=expected -fsyntax-only %s + + +class A trivially_relocatable_if_eligible {};

[clang] [llvm] [Coroutines] Mark parameter allocas with coro.outside.frame metadata (PR #127653)

2025-02-24 Thread Hans Wennborg via cfe-commits
https://github.com/zmodem updated https://github.com/llvm/llvm-project/pull/127653 >From cde82a27139c39406a9afb5b471fa527e52e5bca Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Tue, 18 Feb 2025 15:27:37 +0100 Subject: [PATCH 1/6] [Coroutines] Mark parameter allocas with coro.outside.frame

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: I annotated `outofbound.c` with inline comments to describe why I removed most of the testcases within it. https://github.com/llvm/llvm-project/pull/128508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/128508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [clang][SYCL] Disable float128 device mode diagnostic (PR #128513)

2025-02-24 Thread Nicolas Miller via cfe-commits
https://github.com/npmiller created https://github.com/llvm/llvm-project/pull/128513 This diagnostic is disabled for device compilation as float128 is not supported on the device side. Other diagnostics are already covering the cases where float128 is actually used in the kernel code, and it'

[clang] [clang][SYCL] Disable float128 device mode diagnostic (PR #128513)

2025-02-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nicolas Miller (npmiller) Changes This diagnostic is disabled for device compilation as float128 is not supported on the device side. Other diagnostics are already covering the cases where float128 is actually used in the kernel code, an

[clang] [llvm] [Coroutines] Mark parameter allocas with coro.outside.frame metadata (PR #127653)

2025-02-24 Thread Hans Wennborg via cfe-commits
zmodem wrote: > > > My instinct reaction is, it may block some optimizations to optimize the > > > alloca out. > > > > > > The intrinsic gets dropped by CoroSplit, so after that it's not a problem. > > Before that, I'm not sure much interesting optimization can happen to > > allocas anyway?

[clang] [clang][SYCL] Disable float128 device mode diagnostic (PR #128513)

2025-02-24 Thread Nicolas Miller via cfe-commits
@@ -4700,7 +4700,8 @@ void Sema::AddModeAttr(Decl *D, const AttributeCommonInfo &CI, if (NewElemTy.isNull()) { // Only emit diagnostic on host for 128-bit mode attribute -if (!(DestWidth == 128 && getLangOpts().CUDAIsDevice)) +if (!(DestWidth == 128 && +

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [NFC][analyzer] OOB test consolidation III: 'outofbound' tests (PR #128508)

2025-02-24 Thread Donát Nagy via cfe-commits
@@ -1,130 +0,0 @@ -// RUN: %clang_analyze_cc1 -Wno-array-bounds -verify %s \ -// RUN: -analyzer-checker=core \ -// RUN: -analyzer-checker=unix \ -// RUN: -analyzer-checker=security.ArrayBound \ -// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true - -typedef

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -1826,6 +1827,12 @@ The following type trait primitives are supported by Clang. Those traits marked functionally equivalent to copying the underlying bytes and then dropping the source object on the floor. This is true of trivial types and types which were made trivia

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -3644,16 +3644,20 @@ static void handleInitPriorityAttr(Sema &S, Decl *D, const ParsedAttr &AL) { return; } - // Only perform the priority check if the attribute is outside of a system - // header. Values <= 100 are reserved for the implementation, and libc++ - //

[clang] [clang] Fix `gnu::init_priority` attribute handling for reserved values (PR #121577)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -3644,16 +3644,20 @@ static void handleInitPriorityAttr(Sema &S, Decl *D, const ParsedAttr &AL) { return; } - // Only perform the priority check if the attribute is outside of a system - // header. Values <= 100 are reserved for the implementation, and libc++ - //

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -127,6 +127,33 @@ class AccessSpecDecl : public Decl { static bool classofKind(Kind K) { return K == AccessSpec; } }; +enum class RelocatableOrReplaceableClassSpecifierKind { + Relocatable, + Replaceable +}; + +template +class BasicRelocatableOrReplaceableClassSpecifie

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread Erich Keane via cfe-commits
@@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -std=c++03 -verify=expected,cxx11,cxx03 -fsyntax-only %s +// RUN: %clang_cc1 -std=c++11 -verify=expected,cxx11 -fsyntax-only %s +// RUN: %clang_cc1 -std=c++2c -verify=expected -fsyntax-only %s + + +class A trivially_relocatable_if_eligible {};

[clang] [Clang] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread Mariya Podchishchaeva via cfe-commits
@@ -7258,6 +7261,228 @@ void Sema::CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record) { } } +static bool hasSuitableConstructorForRelocation(CXXRecordDecl *D, +bool AllowUserDefined) { + assert(D->hasDefinition() && !D->

[clang] [Clang][NFC] Add test for CWG2285 "Issues with structured bindings" (PR #126421)

2025-02-24 Thread Vlad Serebrennikov via cfe-commits
@@ -196,6 +196,16 @@ void g() { #endif } // namespace cwg2277 +namespace cwg2285 { // cwg2285: 4 Endilll wrote: You're right, Clang 4 behaves as expected without `#if __cplusplus`. > Do I need to add this note in test file? Yes, leave a comment somewhere th

[clang] [clang][AMDGPU] Enable module splitting by default (PR #128509)

2025-02-24 Thread Matt Arsenault via cfe-commits
@@ -708,6 +712,34 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D, options::OPT_m_amdgpu_Features_Group); } +static unsigned GetFullLTOPartitions(const Driver &D, const ArgList &Args) { + const Arg *A = Args.getLastArg(options::OPT_flto_par

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

2025-02-24 Thread Peter Smith via cfe-commits
=?utf-8?q?Csanád_Hajdú?= Message-ID: In-Reply-To: https://github.com/smithp35 approved this pull request. LGTM. Thanks for updating the code and test to account for Multilib. Apologies for missing this last week. Please leave some time for other reviewers to comment before merging. https://

[clang] [llvm] AMDGPU: Move enqueued block handling into clang (PR #128519)

2025-02-24 Thread Matt Arsenault via cfe-commits
arsenm wrote: * **#128520** https://app.graphite.dev/github/pr/llvm/llvm-project/128520?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * **#128519** https://app.graphite.dev/github/pr/llvm/llvm-p

[clang] [llvm] AMDGPU: Move enqueued block handling into clang (PR #128519)

2025-02-24 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/128519 The previous implementation wasn't maintaining a faithful IR representation of how this really works. The value returned by createEnqueuedBlockKernel wasn't actually used as a function, and hacked up later to be a

[clang] [llvm] AMDGPU: Move enqueued block handling into clang (PR #128519)

2025-02-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) Changes The previous implementation wasn't maintaining a faithful IR representation of how this really works. The value returned by createEnqueuedBlockKernel wasn't actually used as a function, and hacked up

<    1   2   3   4   >