[clang] [llvm] Enable running ClangReplInterpreterTests in an Emscripten environment (PR #150977)

2025-07-30 Thread via cfe-commits
mcbarton wrote: @anutosh491 Yes the plan is that for now CppInterOps ci will be made to run the tests for the llvm 21 branch, assuming it gets cherry picked for the release (I also have the patch for llvm 20 and will create one for llvm 19 to CppInterOp can run for these versions too). Hopeful

[clang] [clang][X86] Update __cpuidex_conflict.c test post #126324 (PR #151220)

2025-07-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: This LGTM but I'd like @sarnex to give the final approval. https://github.com/llvm/llvm-project/pull/151220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [Clang][attr] Add 'kcfi_salt' attribute (PR #141846)

2025-07-30 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -fsyntax-only -fsanitize=kcfi -verify %s + +#define __cfi_salt(S) __attribute__((cfi_salt(S))) + +int foo(int a, int b) __cfi_salt("pepper"); // ok +int foo(int a, int b) __cfi_salt("pepper"); // ok + +typedef int (*bar_t)(void) __cfi_salt("pep

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Balazs Benics via cfe-commits
Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= , Endre =?utf-8?q?Fülöp?= Message-ID: In-Reply-To: steakhal wro

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s gamesh411 wrote: No need for a runline in an example file. https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 commented: Review suggestions resulting from consulting with @NagyDonat https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; gamesh411 wrote: Don't emphasise "global" in variable names, as globals and local variables are handled the sa

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -std=c++14 -verify %s gamesh411 wrote: Add more C++ standard versions. https://github.com/llvm/llvm-project/pull/150417 ___ cf

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { gamesh411 wrote: Maybe just a single function that tests all use cases would be m

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

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

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { + *(int *)&global_const = 100; // warn: Writing to immutable memory +} + +// String literal +// NO

[clang] [analyzer] Fix getElementRegion to retain address space information (PR #151249)

2025-07-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/151249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix getElementRegion to retain address space information (PR #151249)

2025-07-30 Thread Balazs Benics via cfe-commits
@@ -8274,6 +8275,15 @@ inline void QualType::removeLocalVolatile() { removeLocalFastQualifiers(Qualifiers::Volatile); } +inline QualType QualType::removeNonAddressSpaceQualifiers() { + if (getQualifiers().hasTargetSpecificAddressSpace()) { +removeLocalFastQualifiers();

[clang] [llvm] [CodeGen][AArch64] ptrauth intrinsic to safely construct relative ptr (PR #142047)

2025-07-30 Thread Abhay Kanhere via cfe-commits
@@ -4643,6 +4643,12 @@ def PtrauthAuthAndResign : Builtin { let Prototype = "void*(void*,int,void*,int,void*)"; } +def PtrauthAuthLoadRelativeAndSign : Builtin { + let Spellings = ["__builtin_ptrauth_auth_load_relative_and_sign"]; + let Attributes = [CustomTypeChecking, No

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-07-30 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > Oh excuse me, there's currently no target-specific behaviour. I missed the > HasFallback in HasFallback only applies to the two-argument form. I don't have a strong opinion about the names. The whole "fallback behavior" thing was written back in the early

[clang] [llvm] [CodeGen][AArch64] ptrauth intrinsic to safely construct relative ptr (PR #142047)

2025-07-30 Thread Abhay Kanhere via cfe-commits
@@ -259,78 +284,6 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t; /* The value is ptrauth_string_discriminator("init_fini") */ #define __ptrauth_init_fini_discriminator 0xd9d4 -#else - -#define ptrauth_strip(__value, __key) \

[clang] [Clang][Driver] Revise Cygwin ToolChain to call linker directly (PR #147960)

2025-07-30 Thread via cfe-commits
@@ -107,3 +110,282 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +void cygwin::Linker::Constru

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Sirui Mu (Lancern) Changes This patch adds CIRGen support for `cir.unreachable` and `cir.trap`. It also adds missing LLVM lowering code for `cir.unreachable`. --- Full diff: https://github.com/llvm/llvm-project/pull/151363.diff 6 File

[clang] [CIR] Add CIRGen for cir.unreachable and cir.trap (PR #151363)

2025-07-30 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/151363 This patch adds CIRGen support for `cir.unreachable` and `cir.trap`. It also adds missing LLVM lowering code for `cir.unreachable`. >From 22fd4328f0b5695de47e001f135a92416c38bfbf Mon Sep 17 00:00:00 2001 From:

[clang] [llvm] [CodeGen][AArch64] ptrauth intrinsic to safely construct relative ptr (PR #142047)

2025-07-30 Thread Abhay Kanhere via cfe-commits
https://github.com/AbhayKanhere updated https://github.com/llvm/llvm-project/pull/142047 >From c9d478a056fae873fd925f4df76189c4158fee8c Mon Sep 17 00:00:00 2001 From: Abhay Kanhere Date: Wed, 28 May 2025 16:35:05 -0700 Subject: [PATCH 1/2] [CodeGen][AArch64] ptrauth intrinsic to safely construc

[clang] [CIR] Add vptr type and generate vptr field when needed (PR #151377)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes This adds a new CIR type, cir.vptr, and generates a field of that type when a record is declared that requires a vptr member. --- Full diff: https://github.com/llvm/llvm-project/pull/151377.diff 4 Files

[clang] [CIR] Add vptr type and generate vptr field when needed (PR #151377)

2025-07-30 Thread Andy Kaylor via cfe-commits
andykaylor wrote: Corresponding changes at https://github.com/llvm/clangir/pull/1745 show how I intend to use this type. https://github.com/llvm/llvm-project/pull/151377 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [CIR] Add vptr type and generate vptr field when needed (PR #151377)

2025-07-30 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/151377 This adds a new CIR type, cir.vptr, and generates a field of that type when a record is declared that requires a vptr member. >From e6a0352f42818a13ece66f505d6cb107cb3dea0e Mon Sep 17 00:00:00 2001 From: And

[clang] [Clang] disallow # operators in attribute argument lists (PR #147308)

2025-07-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > 1 nit on the release note, else this LGTM. > > We still need to let Aaron decide how long we are going to give WG21 a chance > to change this :) CC @hubert-reinterpretcast for other opinions. My reading of the CWG thread is that Core seems to think this should be rejecte

[clang] [Sema] Fix -Wunreachable-code false negative when operands differ only by implicit casts (PR #149972)

2025-07-30 Thread M. Zeeshan Siddiqui via cfe-commits
https://github.com/codemzs edited https://github.com/llvm/llvm-project/pull/149972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix -Wunreachable-code false negative when operands differ only by implicit casts (PR #149972)

2025-07-30 Thread M. Zeeshan Siddiqui via cfe-commits
codemzs wrote: > > @AaronBallman @yronglin Thank you for the review. I don't have write > > permissions, can one of you please sign-off and push the change for me? > > Thanks! > > Sure! Could you add a release notes(in clang/docs/ReleaseNotes.rst Bug Fixes > in This Version section)? You can

[clang-tools-extra] [clang-tidy] Add modernize-make-direct check (PR #118120)

2025-07-30 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,46 @@ +.. title:: clang-tidy - modernize-make-direct + +modernize-make-direct += + +Replaces ``std::make_*`` function calls with direct constructor calls using class template +argument deduction (CTAD). + +==

[clang] [analyzer] Fix getElementRegion to retain address space information (PR #151249)

2025-07-30 Thread via cfe-commits
https://github.com/vabridgers dismissed https://github.com/llvm/llvm-project/pull/151249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix getElementRegion to retain address space information (PR #151249)

2025-07-30 Thread via cfe-commits
https://github.com/vabridgers closed https://github.com/llvm/llvm-project/pull/151249 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -std=c++14 -verify %s gamesh411 wrote: Added versions from C++11 - C++20 https://github.com/llvm/llvm-project/pull/150417 ___

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/16] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -std=c++14 -verify %s + +// expected-no-diagnostics + +// In C++14 and before, when initializing a lambda, the statement given in the checkBind callback is not the whole DeclExpr, but the

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -29,11 +30,59 @@ class StoreToImmutableChecker : public Checker { void checkBind(SVal Loc, SVal Val, const Stmt *S, CheckerContext &C) const; private: + bool isInitializationContext(const Stmt *S, CheckerContext &C) const; bool isEffectivelyConstRegion(const MemRegio

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -11,6 +11,7 @@ // //===--===// +#include "clang/AST/ParentMap.h" gamesh411 wrote: Yeah, this was part of my attempt to use the structure of the AST to detect the lambda initialisation. R

[clang-tools-extra] Add clang tidy check performance constexpr non static in scope (PR #147809)

2025-07-30 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook edited https://github.com/llvm/llvm-project/pull/147809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ARM] Fix build failure in for __swp (PR #151354)

2025-07-30 Thread Victor Campos via cfe-commits
https://github.com/vhscampos approved this pull request. https://github.com/llvm/llvm-project/pull/151354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream support for function-level variable decompositions (PR #151073)

2025-07-30 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/151073 >From 22b36ac0fb0323f518de18fa4058f0c168c8d476 Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Tue, 29 Jul 2025 04:23:46 +0200 Subject: [PATCH 1/3] [CIR] Upstream support for function-level variable decompositio

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-07-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/136823 From 4ce7497bb0dc89de3b9f139177c295291e7d3e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 17 Apr 2025 17:36:03 +0200 Subject: [PATCH 1/9] [clang-tidy] Add check 'bugprone-inva

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-avoid-return-with-void-value` check in the codebase (PR #151356)

2025-07-30 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/151356 None >From 8dd39dd51cb3d199734defcb1c0626d608806812 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Wed, 30 Jul 2025 08:38:42 -0700 Subject: [PATCH] [clang-tidy][NFC] Enable `readability-avoid-return

[clang-tools-extra] [clang-tidy][NFC] Enable `readability-avoid-return-with-void-value` check in the codebase (PR #151356)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Victor Chernyakin (localspook) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/151356.diff 3 Files Affected: - (modified) clang-tools-extra/clang-tidy/.clang-tidy (-1) - (modified) clang-tools-extra/clang-tidy/b

[clang] [Sema] Fix -Wunreachable-code false negative when operands differ only by implicit casts (PR #149972)

2025-07-30 Thread M. Zeeshan Siddiqui via cfe-commits
codemzs wrote: @AaronBallman @yronglin Thank you for the review. I don't have write permissions, can one of you please sign-off and push the change for me? Thanks! https://github.com/llvm/llvm-project/pull/149972 ___ cfe-commits mailing list cfe-commi

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 updated https://github.com/llvm/llvm-project/pull/150417 From 0630d81e544319a1a18798996760775d4a13f7ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Thu, 24 Jul 2025 14:49:14 +0200 Subject: [PATCH 01/15] [clang][analyzer] Add StoreToImmuta

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable -verify %s + +// Test basic functionality of StoreToImmutable checker for the C programming language. + +const int tentative_global_const; // expected-note {{Memory region is in immutabl

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { gamesh411 wrote: Simplified https://github.com/llvm/llvm-project/pull/150417 ___

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,187 @@ +//=== StoreToImmutableChecker.cpp - Store to immutable memory ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s gamesh411 wrote: Removed https://github.com/llvm/llvm-project/pull/150417 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; + +void test_global_const() { + *(int *)&global_const = 100; // warn: Writing to immutable memory +} + +// String literal +// NO

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Endre Fülöp via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; gamesh411 wrote: I have made the simplification, and it still has an example for a global and a local variable

[clang] [mlir] [OpenACC][CIR] Implement 'private' clause lowering. (PR #151360)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Erich Keane (erichkeane) Changes The private clause is the first with 'recipes', so a lot of infrastructure is included here, including some MLIR dialect changes that allow simple adding of a privatization. We'll likely get similar for

[clang] [mlir] [OpenACC][CIR] Implement 'private' clause lowering. (PR #151360)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-openacc Author: Erich Keane (erichkeane) Changes The private clause is the first with 'recipes', so a lot of infrastructure is included here, including some MLIR dialect changes that allow simple adding of a privatization. We'll likely get similar for

[clang] [Sema] Fix -Wunreachable-code false negative when operands differ only by implicit casts (PR #149972)

2025-07-30 Thread via cfe-commits
yronglin wrote: > @AaronBallman @yronglin Thank you for the review. I don't have write > permissions, can one of you please sign-off and push the change for me? > Thanks! Sure! https://github.com/llvm/llvm-project/pull/149972 ___ cfe-commits mailin

[clang] [mlir] [OpenACC][CIR] Implement 'private' clause lowering. (PR #151360)

2025-07-30 Thread Erich Keane via cfe-commits
erichkeane wrote: @razvanlupusoru and @clementval : Would love review of the ACC dialect changes, but also confirmation that I got the IR correct. Particularly the lack of copy or constructor-initialization, and general privatization appertainment. I realize this is going to change somewhat w

[clang] [mlir] [OpenACC][CIR] Implement 'private' clause lowering. (PR #151360)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-mlir-openacc Author: Erich Keane (erichkeane) Changes The private clause is the first with 'recipes', so a lot of infrastructure is included here, including some MLIR dialect changes that allow simple adding of a privatization. We'll likely get simila

[clang] [mlir] [OpenACC][CIR] Implement 'private' clause lowering. (PR #151360)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes The private clause is the first with 'recipes', so a lot of infrastructure is included here, including some MLIR dialect changes that allow simple adding of a privatization. We'll likely get similar for f

[clang] [Sema] Fix -Wunreachable-code false negative when operands differ only by implicit casts (PR #149972)

2025-07-30 Thread via cfe-commits
https://github.com/yronglin approved this pull request. https://github.com/llvm/llvm-project/pull/149972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][NEON] NEON intrinsic compilation error with -fno-lax-vector-conversion flag fix (PR #149329)

2025-07-30 Thread Amina Chabane via cfe-commits
Amichaxx wrote: I don't have merge access. All checks have passed now. https://github.com/llvm/llvm-project/pull/149329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver] Revise Cygwin ToolChain to call linker directly (PR #147960)

2025-07-30 Thread via cfe-commits
@@ -107,3 +110,282 @@ void Cygwin::AddClangSystemIncludeArgs(const ArgList &DriverArgs, addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/w32api"); } + +void cygwin::Linker::Constru

[clang] [analyzer] Conversion to CheckerFamily: StackAddrEscapeChecker (PR #151136)

2025-07-30 Thread LLVM Continuous Integration via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-hip-vega20` running on `hip-vega20-0` while building `clang` at step 3 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/243

[clang] 8a50337 - [NFC][analyzer] Conversion to CheckerFamily: CStringChecker (#150971)

2025-07-30 Thread via cfe-commits
Author: Donát Nagy Date: 2025-07-30T17:10:37+02:00 New Revision: 8a503378c9eb40bbcfe6fd8b6fe3c2f8f7e0ba3d URL: https://github.com/llvm/llvm-project/commit/8a503378c9eb40bbcfe6fd8b6fe3c2f8f7e0ba3d DIFF: https://github.com/llvm/llvm-project/commit/8a503378c9eb40bbcfe6fd8b6fe3c2f8f7e0ba3d.diff LO

[libclc] [libclc] Add an option to build SPIR-V targets with the LLVM backend (PR #151347)

2025-07-30 Thread Nikita Popov via cfe-commits
nikic wrote: > Note that the option is off by default as using the SPIR-V backend, at least > on my machine, uses a lot of memory and the process is often killed in a > parallelized build. It does complete, however. I see the same behavior, goes up to something like 30GB. The input is not par

[clang] [NFC][analyzer] Conversion to CheckerFamily: CStringChecker (PR #150971)

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

[clang] [HLSL][SPIRV] Add vk::binding attribute (PR #150957)

2025-07-30 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts commented: LGTM, question around the default value. Seems like sema makes the default value be 0 as expected, so maybe the second template arg is not in fact the default value? https://github.com/llvm/llvm-project/pull/150957 _

[clang] [HLSL][SPIRV] Add vk::binding attribute (PR #150957)

2025-07-30 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts edited https://github.com/llvm/llvm-project/pull/150957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add vk::binding attribute (PR #150957)

2025-07-30 Thread Nathan Gauër via cfe-commits
@@ -4894,6 +4894,14 @@ def HLSLSV_GroupIndex: HLSLAnnotationAttr { let Documentation = [HLSLSV_GroupIndexDocs]; } +def HLSLVkBinding : InheritableAttr { + let Spellings = [CXX11<"vk", "binding">]; + let Subjects = SubjectList<[HLSLBufferObj, ExternalGlobalVar], ErrorDiag>;

[clang] [Clang][AArch64] Remove unwarranted 'cannot be used in non-streaming mode' diagnostic. (PR #150592)

2025-07-30 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/31604

[clang] [NFC][analyzer] Update docs of CodeChecker --ctu-ast-mode (PR #144901)

2025-07-30 Thread Endre Fülöp via cfe-commits
https://github.com/gamesh411 approved this pull request. I can confirm that this is the most current version. https://github.com/llvm/llvm-project/pull/144901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [Sema] Fix -Wunreachable-code false negative when operands differ only by implicit casts (PR #149972)

2025-07-30 Thread via cfe-commits
yronglin wrote: LGTM! Could you add a release notes? https://github.com/llvm/llvm-project/pull/149972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

2025-07-30 Thread Donát Nagy via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.core.StoreToImmutable %s + +// Global const variable +const int global_const = 42; NagyDonat wrote: @steakhal You are right that globals and locals are handled differently _by the checker imple

[clang] [clang][analyzer] Add StoreToImmutable checker (PR #150417)

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

[clang] [LinkerWrapper] Fix -fsave-optimization-record default file (PR #149003)

2025-07-30 Thread Joel E. Denny via cfe-commits
https://github.com/jdenny-ornl edited https://github.com/llvm/llvm-project/pull/149003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 74e4a86 - [LinkerWrapper] Fix -fsave-optimization-record default file (#149003)

2025-07-30 Thread via cfe-commits
Author: Joel E. Denny Date: 2025-07-30T10:25:37-04:00 New Revision: 74e4a8645da91247dc8dc502771c2cc4d46f1f91 URL: https://github.com/llvm/llvm-project/commit/74e4a8645da91247dc8dc502771c2cc4d46f1f91 DIFF: https://github.com/llvm/llvm-project/commit/74e4a8645da91247dc8dc502771c2cc4d46f1f91.diff

[clang] [LinkerWrapper] Fix -fsave-optimization-record default file (PR #149003)

2025-07-30 Thread Joel E. Denny via cfe-commits
jdenny-ornl wrote: Thanks for the reviews. https://github.com/llvm/llvm-project/pull/149003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Fix -fsave-optimization-record default file (PR #149003)

2025-07-30 Thread Joel E. Denny via cfe-commits
https://github.com/jdenny-ornl closed https://github.com/llvm/llvm-project/pull/149003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Remove an unnecessary cast (NFC) (PR #151278)

2025-07-30 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata closed https://github.com/llvm/llvm-project/pull/151278 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] b90e1e1 - [AST] Remove an unnecessary cast (NFC) (#151278)

2025-07-30 Thread via cfe-commits
Author: Kazu Hirata Date: 2025-07-30T07:29:49-07:00 New Revision: b90e1e186b303b4a551c0fd7722be8f5f4ddbfcf URL: https://github.com/llvm/llvm-project/commit/b90e1e186b303b4a551c0fd7722be8f5f4ddbfcf DIFF: https://github.com/llvm/llvm-project/commit/b90e1e186b303b4a551c0fd7722be8f5f4ddbfcf.diff L

[clang] [llvm] [llvm] Enable LLVM_LINK_LLVM_DYLIB by default on non-Windows platforms (PR #138187)

2025-07-30 Thread via cfe-commits
Andarwinux wrote: What about LLVM_TOOL_LLVM_DRIVER_BUILD? Maybe consider enabling it by default on non-Windows platforms? https://github.com/llvm/llvm-project/pull/138187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [OpenMP] Add diagnostic for 'factor' width mismatch in 'unroll partial' (PR #139986)

2025-07-30 Thread Joseph Huber via cfe-commits
jhuber6 wrote: Is something preventing this from being merged? https://github.com/llvm/llvm-project/pull/139986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 83d3770 - [Clang][AArch64] Remove unwarranted 'cannot be used in non-streaming mode' diagnostic. (#150592)

2025-07-30 Thread via cfe-commits
Author: Sander de Smalen Date: 2025-07-30T15:34:23+01:00 New Revision: 83d3770d73fa6bd0b04228611b979bfa006a7b93 URL: https://github.com/llvm/llvm-project/commit/83d3770d73fa6bd0b04228611b979bfa006a7b93 DIFF: https://github.com/llvm/llvm-project/commit/83d3770d73fa6bd0b04228611b979bfa006a7b93.di

[clang] [Clang][AArch64] Remove unwarranted 'cannot be used in non-streaming mode' diagnostic. (PR #150592)

2025-07-30 Thread Sander de Smalen via cfe-commits
https://github.com/sdesmalen-arm closed https://github.com/llvm/llvm-project/pull/150592 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Add an option to build SPIR-V targets with the LLVM backend (PR #151347)

2025-07-30 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/151347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP] Add diagnostic for 'factor' width mismatch in 'unroll partial' (PR #139986)

2025-07-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Is something preventing this from being merged? https://github.com/llvm/llvm-project/pull/139986#issuecomment-2900974777 is unanswered. CC @alexey-bataev @shiltian https://github.com/llvm/llvm-project/pull/139986 ___ cfe-commit

[clang] [Sema] Fix -Wunreachable-code false negative when operands differ only by implicit casts (PR #149972)

2025-07-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I think this looks correct to me now, but I'd like to leave the final sign-off to @yronglin because they did the original review on #142897 https://github.com/llvm/llvm-project/pull/149972 ___ cfe-commits mai

[clang] [Clang][Basic] Enable `__has_feature(cfi)` (PR #151348)

2025-07-30 Thread via cfe-commits
https://github.com/moorabbit created https://github.com/llvm/llvm-project/pull/151348 Support `__has_feature(cfi)` to check for control flow integrity sanitizers. Fixes #151022 >From fe34b28a97875ed27ba768942d9624655950 Mon Sep 17 00:00:00 2001 From: moorabbit Date: Wed, 30 Jul 2025 10:50

[clang] [Clang][Basic] Enable `__has_feature(cfi)` (PR #151348)

2025-07-30 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (moorabbit) Changes Support `__has_feature(cfi)` to check for control flow integrity sanitizers. Fixes #151022 --- Full diff: https://github.com/llvm/llvm-project/pull/151348.diff 3 Files Affected: - (modified) clang/include/clang

[clang] [Clang][Basic] Enable `__has_feature(cfi)` (PR #151348)

2025-07-30 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] 56c93a4 - [Clang] NFC: Add missing REQUIRES to aarch64-sme-attrs-without-sve.cpp

2025-07-30 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2025-07-30T15:00:02Z New Revision: 56c93a47acfd0391da0ca8b9eb27c1568d37d051 URL: https://github.com/llvm/llvm-project/commit/56c93a47acfd0391da0ca8b9eb27c1568d37d051 DIFF: https://github.com/llvm/llvm-project/commit/56c93a47acfd0391da0ca8b9eb27c1568d37d051.diff L

[clang] [Clang] Take libstdc++ into account during GCC detection (PR #145056)

2025-07-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > This looks quite good. I'm curious if others have any feedback. No additional feedback from me, but this is far enough outside of my wheelhouse that I don't feel my LG should be enough to land it on. https://github.com/llvm/llvm-project/pull/145056 ___

[clang] 254bfe2 - [Clang][AArch64] Expect valid FunctionDecl in IsArmStreamingFunction

2025-07-30 Thread Sander de Smalen via cfe-commits
Author: Sander de Smalen Date: 2025-07-30T15:04:47Z New Revision: 254bfe23e3174d5695f4e35212ff352082f05ae4 URL: https://github.com/llvm/llvm-project/commit/254bfe23e3174d5695f4e35212ff352082f05ae4 DIFF: https://github.com/llvm/llvm-project/commit/254bfe23e3174d5695f4e35212ff352082f05ae4.diff L

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-07-30 Thread Donát Nagy via cfe-commits
@@ -124,6 +124,12 @@ New checks pointer and store it as class members without handle the copy and move constructors and the assignments. +- New :doc:`bugprone-invalid-enum-default-initialization NagyDonat wrote: > LLVM documentation (https://llvm.org/docs

[clang] [analyzer] Retain address space information in getElementRegion (PR #151370)

2025-07-30 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/151370 The factory method `MemRegionManager::getElementRegion()` is the main way of constructing `ElementRegion` objects, which are widespread in the analysis and may represent array elements (as lvalues), pointer a

[clang] [CIR] Upstream MulOp for ComplexType (PR #150834)

2025-07-30 Thread Amr Hesham via cfe-commits
@@ -0,0 +1,325 @@ +// complex-range basic +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -complex-range=basic -Wno-unused-value -fclangir -emit-cir -mmlir --mlir-print-ir-before=cir-canonicalize -o %t.cir %s 2>&1 | FileCheck --check-prefix=CIR-BEFORE-BASIC %s +/

[clang-tools-extra] [clang-tidy] Add modernize-make-direct check (PR #118120)

2025-07-30 Thread Carlos Galvez via cfe-commits
@@ -0,0 +1,46 @@ +.. title:: clang-tidy - modernize-make-direct + +modernize-make-direct += + +Replaces ``std::make_*`` function calls with direct constructor calls using class template +argument deduction (CTAD). + +==

  1   2   3   4   >