[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Devajith (devajithvs) Changes This fixes an issue introduced by llvm/llvm-project@4b70d17, where failing to pop compound scope, function scope info, and decl context after a failed statement could lead to an inconsistent internal state.

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-23 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 01/19] Initial implementation --- .../bugprone/unchecked-option

[clang] [analyzer] Fix assertion failed caused by non standard strnlen function (PR #150222)

2025-07-23 Thread via cfe-commits
https://github.com/flovent created https://github.com/llvm/llvm-project/pull/150222 Fix assertion failed and avoid further model non standard `strnlen` like this: ``` char* strnlen(const char*, size_t) ``` Fixes #149757. >From cec3aa7177075962f1980fa8787debc79afe7fe9 Mon Sep 17 00:00:00 200

[clang] 933ba27 - Fix implicit vector conversion (#149970)

2025-07-23 Thread via cfe-commits
Author: Martin Wehking Date: 2025-07-23T15:44:46+01:00 New Revision: 933ba273063f5a4289f0fce109f8f8c17124aa41 URL: https://github.com/llvm/llvm-project/commit/933ba273063f5a4289f0fce109f8f8c17124aa41 DIFF: https://github.com/llvm/llvm-project/commit/933ba273063f5a4289f0fce109f8f8c17124aa41.diff

[clang] Fix implicit vector conversion (PR #149970)

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

[clang] [llvm] [NFC][AMDGPU] Rename "amdgpu-as" to "amdgpu-synchronize-as" (PR #148627)

2025-07-23 Thread Shilei Tian via cfe-commits
https://github.com/shiltian approved this pull request. https://github.com/llvm/llvm-project/pull/148627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev approved this pull request. LGTM! @devajithvs, do you have commit access or should I merge? https://github.com/llvm/llvm-project/pull/150215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread via cfe-commits
devajithvs wrote: I don't have commit access. It'd be great if you can merge. https://github.com/llvm/llvm-project/pull/150215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0623389 - [Driver] Default to -mv8plus on 32-bit Solaris/SPARC (#150176)

2025-07-23 Thread via cfe-commits
Author: Rainer Orth Date: 2025-07-23T17:03:34+02:00 New Revision: 06233892e84f96a3b4e05338cd4f6c12b8f5a185 URL: https://github.com/llvm/llvm-project/commit/06233892e84f96a3b4e05338cd4f6c12b8f5a185 DIFF: https://github.com/llvm/llvm-project/commit/06233892e84f96a3b4e05338cd4f6c12b8f5a185.diff L

[clang] [Driver] Default to -mv8plus on 32-bit Solaris/SPARC (PR #150176)

2025-07-23 Thread Rainer Orth via cfe-commits
https://github.com/rorth closed https://github.com/llvm/llvm-project/pull/150176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread Vassil Vassilev via cfe-commits
https://github.com/vgvassilev closed https://github.com/llvm/llvm-project/pull/150215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 38a977d - [clang-repl] Always clean up scope and context for TopLevelStmtDecl (#150215)

2025-07-23 Thread via cfe-commits
Author: Devajith Date: 2025-07-23T17:03:07+02:00 New Revision: 38a977d00c4e22f4a2a21e5f577c57df2053872e URL: https://github.com/llvm/llvm-project/commit/38a977d00c4e22f4a2a21e5f577c57df2053872e DIFF: https://github.com/llvm/llvm-project/commit/38a977d00c4e22f4a2a21e5f577c57df2053872e.diff LOG:

[clang] 97eec75 - [CIR] Add support for binary operations on bitfield members (#149676)

2025-07-23 Thread via cfe-commits
Author: Andres-Salamanca Date: 2025-07-23T10:03:41-05:00 New Revision: 97eec759e69e7534e020b4e2ad1858842eec50ee URL: https://github.com/llvm/llvm-project/commit/97eec759e69e7534e020b4e2ad1858842eec50ee DIFF: https://github.com/llvm/llvm-project/commit/97eec759e69e7534e020b4e2ad1858842eec50ee.di

[clang] [CIR] Add support for binary operations on bitfield members (PR #149676)

2025-07-23 Thread via cfe-commits
https://github.com/Andres-Salamanca closed https://github.com/llvm/llvm-project/pull/149676 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Speed up `misc-header-include-cycle` (PR #148757)

2025-07-23 Thread Piotr Zegar via cfe-commits
https://github.com/PiotrZSL updated https://github.com/llvm/llvm-project/pull/148757 >From 7cab196f263cc4d1787fe74ae49d4340fcb88624 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Sun, 13 Jul 2025 11:30:49 -0700 Subject: [PATCH 1/2] [clang-tidy] Speed up `misc-header-include-cycle` ---

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Tom Honermann via cfe-commits
@@ -476,6 +476,47 @@ The SYCL kernel in the previous code sample meets these expectations. }]; } +def SYCLExternalDocs : Documentation { + let Category = DocCatFunction; + let Heading = "sycl_external"; + let Content = [{ +The ``sycl_external`` attribute indicates that a

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-23 Thread Sean McBride via cfe-commits
seanm wrote: I've just tried VTK again, and seems there's only one compiler error now: ```diff - operator bool() const noexcept { return this->InT >= 0.0 && this->OutT >= 0.0; } + operator constexpr bool() const noexcept { return this->InT >= 0.0 && this->OutT >= 0.0; } ``` ``` VTK/Filters/

[clang] [clang][ExprConst] Consider integer pointers of value 0 nullptr (PR #150164)

2025-07-23 Thread Eli Friedman via cfe-commits
@@ -27,12 +27,6 @@ template void f(); // CHECK: define weak_odr void @_Z1fIXtl1BLPKi32vv( // MSABI: define {{.*}} @"??$f@$2UB@@PEBH0CA@H0AYAXXZ" template void f(); -#ifndef _WIN32 efriedma-quic wrote: This specific test is fine, I think: if we know the

[clang] [llvm] [FMV][AArch64] Allow user to override version priority. (PR #150267)

2025-07-23 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/150267 Implements https://github.com/ARM-software/acle/pull/404 This allows the user to specify "priority=[1-32];featA+featB" where priority=31 means highest priority. If the explicit priority string is omitted then

[clang] [llvm] [FMV][AArch64] Allow user to override version priority. (PR #150267)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-arm Author: Alexandros Lamprineas (labrinea) Changes Implements https://github.com/ARM-software/acle/pull/404 This allows the user to specify "priority=[1-32];featA+featB" where priority=31 means highest priority. If the explicit priority strin

[clang] [llvm] [FMV][AArch64] Allow user to override version priority. (PR #150267)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-transforms Author: Alexandros Lamprineas (labrinea) Changes Implements https://github.com/ARM-software/acle/pull/404 This allows the user to specify "priority=[1-32];featA+featB" where priority=31 means highest priority. If the explicit priority s

[clang] [llvm] [FMV][AArch64] Allow user to override version priority. (PR #150267)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-analysis Author: Alexandros Lamprineas (labrinea) Changes Implements https://github.com/ARM-software/acle/pull/404 This allows the user to specify "priority=[1-32];featA+featB" where priority=31 means highest priority. If the explicit priority str

[clang] [llvm] Implement `preserve_none` for 32-bit x86 (PR #150106)

2025-07-23 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: For "nest", we can forbid combining it with the preserves_none calling convention, probably, as long as we can detect it and error out. There's no reason anyone would combine the two. For the base pointer, you also need to worry about the callee-save register list: I don

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Tom Honermann via cfe-commits
@@ -1641,6 +1641,13 @@ def DeviceKernel : DeclOrTypeAttr { }]; } +def SYCLExternal : InheritableAttr { + let Spellings = [Clang<"sycl_external">]; tahonermann wrote: We use the `Clang` spelling for `sycl_kernel_entry_point`, what would be the reason for doi

[clang] [llvm] [FMV][AArch64] Allow user to override version priority. (PR #150267)

2025-07-23 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 HEAD~1 HEAD --extensions h,c,cpp,inc -- clang/test/CodeGen/AArch64/fmv-explicit-prior

[clang] [llvm] [llvm] Add CalleeTypeIds field to CallSiteInfo (PR #87574)

2025-07-23 Thread Prabhu Rajasekaran via cfe-commits
https://github.com/Prabhuk closed https://github.com/llvm/llvm-project/pull/87574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Erich Keane via cfe-commits
@@ -1641,6 +1641,13 @@ def DeviceKernel : DeclOrTypeAttr { }]; } +def SYCLExternal : InheritableAttr { + let Spellings = [Clang<"sycl_external">]; erichkeane wrote: > We use the `Clang` spelling for `sycl_kernel_entry_point`, what would be the > reason for

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread Kajetan Puchalski via cfe-commits
https://github.com/mrkajetanp created https://github.com/llvm/llvm-project/pull/150269 Both clang and gfortran support the -fopenmp-simd flag, which enables OpenMP support only for simd constructs, while disabling the rest of OpenMP. Add a new SimdOnly flang OpenMP IR pass which rewrites gener

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-flang-openmp Author: Kajetan Puchalski (mrkajetanp) Changes Both clang and gfortran support the -fopenmp-simd flag, which enables OpenMP support only for simd constructs, while disabling the rest of OpenMP. Add a new SimdOnly flang OpenMP IR pass which

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Kajetan Puchalski (mrkajetanp) Changes Both clang and gfortran support the -fopenmp-simd flag, which enables OpenMP support only for simd constructs, while disabling the rest of OpenMP. Add a new SimdOnly

[clang] [llvm] [llvm] Extract and propagate callee_type metadata (PR #87575)

2025-07-23 Thread Prabhu Rajasekaran via cfe-commits
https://github.com/Prabhuk edited https://github.com/llvm/llvm-project/pull/87575 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [WebAssembly,clang] Add __builtin_wasm_test_function_pointer_signature (PR #150201)

2025-07-23 Thread Hood Chatham via cfe-commits
hoodmane wrote: I'm neutral on the name, happy to change it if you prefer. https://github.com/llvm/llvm-project/pull/150201 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [FMV][AArch64] Allow user to override version priority. (PR #150267)

2025-07-23 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/150267 >From 9ee152339007481a813f61ebfd1393c7bfa879e5 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Thu, 26 Jun 2025 15:52:11 +0100 Subject: [PATCH 1/2] [FMV][AArch64] Allow user to override version prior

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Tom Honermann via cfe-commits
@@ -12908,6 +12908,14 @@ def err_sycl_special_type_num_init_method : Error< "types with 'sycl_special_class' attribute must have one and only one '__init' " "method defined">; +// SYCL external attribute diagnostics +def err_sycl_attribute_invalid_linkage : Error< + "'sy

[clang] [clang][ExprConst] Consider integer pointers of value 0 nullptr (PR #150164)

2025-07-23 Thread Richard Smith via cfe-commits
@@ -27,12 +27,6 @@ template void f(); // CHECK: define weak_odr void @_Z1fIXtl1BLPKi32vv( // MSABI: define {{.*}} @"??$f@$2UB@@PEBH0CA@H0AYAXXZ" template void f(); -#ifndef _WIN32 zygoloid wrote: It should not, in general. Whether reinterpret_cast maps

[clang] [clang-repl] Always clean up scope and context for TopLevelStmtDecl (PR #150215)

2025-07-23 Thread Vassil Vassilev via cfe-commits
@@ -18,4 +18,12 @@ extern "C" int printf(const char *, ...); int i = 42; auto r1 = printf("i = %d\n", i); // CHECK: i = 42 + +1aap = 42; // expected-error {{intended to fail the -verify test}} vgvassilev wrote: Can we spell out the actual diagnostic here? htt

[clang] [clang][StaticAnalyzer] Fix crash in SimpleSValBuilder with unsigned __int128 and negative literals (PR #150225)

2025-07-23 Thread Cả thế giới là Rust via cfe-commits
https://github.com/naoNao89 created https://github.com/llvm/llvm-project/pull/150225 ## Summary This PR fixes a crash in the Clang static analyzer when processing overflow builtins like `__builtin_mul_overflow` with `unsigned __int128` and negative literal operands. ## Problem The issue was

[clang] [clang][StaticAnalyzer] Fix crash in SimpleSValBuilder with unsigned __int128 and negative literals (PR #150225)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Cả thế giới là Rust (naoNao89) Changes ## Summary This PR fixes a crash in the Clang static analyzer when processing overflow builtins like `__builtin_mul_overflow` with `unsigned __int128` and negative literal operands

[clang] [clang][StaticAnalyzer] Fix crash in SimpleSValBuilder with unsigned __int128 and negative literals (PR #150225)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Cả thế giới là Rust (naoNao89) Changes ## Summary This PR fixes a crash in the Clang static analyzer when processing overflow builtins like `__builtin_mul_overflow` with `unsigned __int128` and negative literal operands. ## Problem The

[clang] [clang][StaticAnalyzer] Fix crash in SimpleSValBuilder with unsigned __int128 and negative literals (PR #150225)

2025-07-23 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] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-23 Thread Vassil Vassilev via cfe-commits
vgvassilev wrote: > Here is the error I got on my local machine. (I use the latest commit on the > master so I could be a different PR that cause the buildbot fail) > > ``` > TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED > > Exit Code: 1 > Comman

[clang] [Clang]Throw frontend error for target feature mismatch when using `flatten` attribute (PR #150044)

2025-07-23 Thread Abhishek Kaushik via cfe-commits
@@ -5232,9 +5232,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, // since otherwise we could be making a conditional call after a check for // the proper cpu features (and it won't cause code generation issues due to // function based code g

[clang] [Clang]Throw frontend error for target feature mismatch when using `flatten` attribute (PR #150044)

2025-07-23 Thread Abhishek Kaushik via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -verify -o - + +typedef double __v2df __attribute__((__vector_size__(16))); + +__v2df __attribute__((target("sse4.1"))) foo() { +__v2df v = {0.0, 0.0}; +return __builtin_ia32_roundpd(v, 2); +} + +__v2df __

[clang] [llvm] [llvm] Add CalleeTypeIds field to CallSiteInfo (PR #87574)

2025-07-23 Thread Paul Kirth via cfe-commits
ilovepi wrote: LGTM w/ the improved/reduced tests. https://github.com/llvm/llvm-project/pull/87574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-23 Thread Morris Hafner via cfe-commits
https://github.com/mmha updated https://github.com/llvm/llvm-project/pull/149142 >From 9814dc290952184c3a1080ea49ddd29b603ecdae Mon Sep 17 00:00:00 2001 From: Morris Hafner Date: Wed, 16 Jul 2025 18:48:52 +0200 Subject: [PATCH 1/6] [CIR] Add support for array constructors This patch upstreams s

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-23 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,93 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir -mmlir --mlir-print-ir-before=cir-lowering-prepare %s -o - 2>&1 | FileCheck --check-prefixes=CIR-BEFORE-LPP %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-u

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-23 Thread Morris Hafner via cfe-commits
@@ -0,0 +1,93 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-unused-value -fclangir -emit-cir -mmlir --mlir-print-ir-before=cir-lowering-prepare %s -o - 2>&1 | FileCheck --check-prefixes=CIR-BEFORE-LPP %s +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -Wno-u

[clang] [analyzer] Eliminate unique release point assertion (PR #150240)

2025-07-23 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat created https://github.com/llvm/llvm-project/pull/150240 MallocChecker.cpp has a complex heuristic that supresses reports where the memory release happens during the release of a reference-counted object (to suppress a significant amount of false positives). Previ

[clang] [analyzer] Eliminate unique release point assertion (PR #150240)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Donát Nagy (NagyDonat) Changes MallocChecker.cpp has a complex heuristic that supresses reports where the memory release happens during the release of a reference-counted object (to suppress a significant amount of false

[clang] [analyzer] Eliminate unique release point assertion (PR #150240)

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

[clang] [Interp] Mark the test unsupported with Asan (PR #150242)

2025-07-23 Thread Qinkun Bao via cfe-commits
https://github.com/qinkunbao created https://github.com/llvm/llvm-project/pull/150242 The test is very flaky with asan Fail: https://lab.llvm.org/buildbot/#/builders/52/builds/9890 Pass: https://lab.llvm.org/buildbot/#/builders/52/builds/9891 Fail again: https://lab.llvm.org/buildbot/#/builders/

[clang] [Interp] Mark the test unsupported with Asan (PR #150242)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qinkun Bao (qinkunbao) Changes The test is very flaky with asan Fail: https://lab.llvm.org/buildbot/#/builders/52/builds/9890 Pass: https://lab.llvm.org/buildbot/#/builders/52/builds/9891 Fail again: https://lab.llvm.org/buildbot/#/builders

[clang] [Interp] Mark the test unsupported with Asan (PR #150242)

2025-07-23 Thread Qinkun Bao via cfe-commits
https://github.com/qinkunbao edited https://github.com/llvm/llvm-project/pull/150242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Erich Keane via cfe-commits
@@ -12251,6 +12264,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (NewFD->hasAttr()) SYCL().CheckSYCLEntryPointFunctionDecl(NewFD); + if (NewFD->hasAttr()) +SYCL().CheckSYCLExternalFunctionDecl(NewFD); erichkeane wrote:

[clang] [llvm] Implement `preserve_none` for 32-bit x86 (PR #150106)

2025-07-23 Thread Brandt Bucher via cfe-commits
brandtbucher wrote: Okay. Both of those concerns already apply to the existing 64-bit flavor, right? Would you prefer to see them addressed here, or in a dedicated follow-up? > For "nest", we can forbid combining it with the preserves_none calling > convention, probably, as long as we can dete

[clang] [llvm] Implement `preserve_none` for 32-bit x86 (PR #150106)

2025-07-23 Thread Brandt Bucher via cfe-commits
brandtbucher wrote: How about we add the base pointers to both clobber lists here and leave the nest parameter as a future improvement for another PR? The calling convention is ABI-unstable, so we can always tweak it later. https://github.com/llvm/llvm-project/pull/150106 _

[clang-tools-extra] [clang-tidy] add modernize-use-constexpr check (PR #146553)

2025-07-23 Thread via cfe-commits
@@ -142,6 +142,11 @@ New checks Finds unscoped (non-class) ``enum`` declarations and suggests using ``enum class`` instead. +- New :doc:`modernize-use-constexpr EugeneZelenko wrote: Please rebase from `main`. https://github.com/llvm/llvm-project/pull/146

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Tom Honermann via cfe-commits
@@ -16275,6 +16297,13 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, } } + if (FD && !FD->isInvalidDecl() && FD->hasAttr()) { +SYCLExternalAttr *SEAttr = FD->getAttr(); +if (FD->isDeletedAsWritten()) tahonermann wrote: Sindhu an

[clang] [WebAssembly,clang] Add __builtin_wasm_test_function_pointer_signature (PR #150201)

2025-07-23 Thread Hood Chatham via cfe-commits
hoodmane wrote: I'd also like to add `__builtin_wasm_nontrapping_call(&success, func, a, b, c)` which tries to call func with 3, 2, 1, and 0 arguments. https://github.com/llvm/llvm-project/pull/150201 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Erich Keane via cfe-commits
@@ -12937,6 +12937,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) { if (D->hasAttr()) return false; + if (LangOpts.SYCLIsDevice && !D->hasAttr() && + !D->hasAttr()) erichkeane wrote: Hmmm... this skips quite a bit which causes obvious dis

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Tom Honermann via cfe-commits
@@ -12251,6 +12264,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, if (NewFD->hasAttr()) SYCL().CheckSYCLEntryPointFunctionDecl(NewFD); + if (NewFD->hasAttr()) +SYCL().CheckSYCLExternalFunctionDecl(NewFD); tahonermann wrote:

[clang-tools-extra] [clang-tidy] modernize-use-std-print, format: Fix checks with Abseil functions (PR #142312)

2025-07-23 Thread Baranov Victor via cfe-commits
vbvictor wrote: Could you rebase from latest main? After ReleaseNotes were cleared, there are merge conflicts almost every PR..:( https://github.com/llvm/llvm-project/pull/142312 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread Tarun Prabhu via cfe-commits
@@ -952,6 +954,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, << A->getSpelling() << A->getValue(); break; } + } else { +Args.AddLastArg(CmdArgs, options::OPT_fopenmp_simd, tarunprabhu wrote: If I understand this c

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/150269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread Tarun Prabhu via cfe-commits
@@ -3706,14 +3706,19 @@ def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">, def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">, Group, Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>; -def fope

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks. The frontend parts of it look fine. I haven't looked too closely at the core OpenMP changes. https://github.com/llvm/llvm-project/pull/150269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Tom Honermann via cfe-commits
@@ -1641,6 +1641,13 @@ def DeviceKernel : DeclOrTypeAttr { }]; } +def SYCLExternal : InheritableAttr { + let Spellings = [Clang<"sycl_external">]; tahonermann wrote: Ok, I'm fine with dropping the GNU spelling. But in that case, we should also change the `s

[clang] [CIR] Add support for array constructors (PR #149142)

2025-07-23 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/149142 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Erich Keane via cfe-commits
@@ -1641,6 +1641,13 @@ def DeviceKernel : DeclOrTypeAttr { }]; } +def SYCLExternal : InheritableAttr { + let Spellings = [Clang<"sycl_external">]; erichkeane wrote: > Ok, I'm fine with dropping the GNU spelling. But in that case, we should also > change the

[clang] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
@@ -235,46 +247,93 @@ void CIRGenFunction::LexicalScope::cleanup() { (void)emitReturn(*returnLoc); } - mlir::Block *curBlock = builder.getBlock(); - if (isGlobalInit() && !curBlock) -return; - if (curBlock->mightHaveTerminator() && curBlock->getTerminator()) -

[clang] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,71 @@ +//===--- CIRGenCleanup.cpp - Bookkeeping and code emission for cleanups ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,100 @@ +//===-- EHScopeStack.h - Stack for cleanup CIR generation ---*- 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] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,100 @@ +//===-- EHScopeStack.h - Stack for cleanup CIR generation ---*- 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] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
@@ -0,0 +1,71 @@ +//===--- CIRGenCleanup.cpp - Bookkeeping and code emission for cleanups ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
@@ -369,6 +369,19 @@ void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args) { s->getStmtClassName()); } +void CIRGenFunction::destroyCXXObject(CIRGenFunction &cgf, Address addr, + QualType typ

[clang] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko edited https://github.com/llvm/llvm-project/pull/149948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
https://github.com/xlauko approved this pull request. lgtm, besides nits https://github.com/llvm/llvm-project/pull/149948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add support for normal cleanups (PR #149948)

2025-07-23 Thread Henrich Lauko via cfe-commits
@@ -369,6 +369,19 @@ void CIRGenFunction::emitImplicitAssignmentOperatorBody(FunctionArgList &args) { s->getStmtClassName()); } +void CIRGenFunction::destroyCXXObject(CIRGenFunction &cgf, Address addr, + QualType typ

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

2025-07-23 Thread M. Zeeshan Siddiqui via cfe-commits
@@ -1160,8 +1160,11 @@ class CFGBuilder { return {}; // Check that it is the same variable on both sides. -if (!Expr::isSameComparisonOperand(DeclExpr1, DeclExpr2)) - return {}; +if (!Expr::isSameComparisonOperand(DeclExpr1, DeclExpr2)) { + if (!Exp

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Tom Honermann via cfe-commits
@@ -12937,6 +12937,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) { if (D->hasAttr()) return false; + if (LangOpts.SYCLIsDevice && !D->hasAttr() && + !D->hasAttr()) tahonermann wrote: I mentioned global variables are just one example; we

[clang] 45d99c2 - [clang][OpenMP] In 6.0, can omit length in array section (#148048)

2025-07-23 Thread via cfe-commits
Author: David Pagan Date: 2025-07-23T10:53:38-07:00 New Revision: 45d99c26c3513945a454e90b69d48257886f8284 URL: https://github.com/llvm/llvm-project/commit/45d99c26c3513945a454e90b69d48257886f8284 DIFF: https://github.com/llvm/llvm-project/commit/45d99c26c3513945a454e90b69d48257886f8284.diff L

[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

2025-07-23 Thread Erich Keane via cfe-commits
@@ -12937,6 +12937,10 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) { if (D->hasAttr()) return false; + if (LangOpts.SYCLIsDevice && !D->hasAttr() && + !D->hasAttr()) erichkeane wrote: I understood what you meant, and strongly disagree. Th

[clang] [clang][OpenMP] In 6.0, can omit length in array section (PR #148048)

2025-07-23 Thread David Pagan via cfe-commits
https://github.com/ddpagan closed https://github.com/llvm/llvm-project/pull/148048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread Kajetan Puchalski via cfe-commits
@@ -952,6 +954,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA, << A->getSpelling() << A->getValue(); break; } + } else { +Args.AddLastArg(CmdArgs, options::OPT_fopenmp_simd, mrkajetanp wrote: Yes, that's correct. If

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

2025-07-23 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] [flang] [flang][OpenMP] Add -f[no]-openmp-simd (PR #150269)

2025-07-23 Thread Kajetan Puchalski via cfe-commits
@@ -3706,14 +3706,19 @@ def fopenmp_relocatable_target : Flag<["-"], "fopenmp-relocatable-target">, def fnoopenmp_relocatable_target : Flag<["-"], "fnoopenmp-relocatable-target">, Group, Flags<[NoArgumentUnused, HelpHidden]>, Visibility<[ClangOption, CC1Option]>; -def fope

[clang] [CIR] Upstream Unary Plus & Minus op for ComplexType (PR #150281)

2025-07-23 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/150281 This change adds support for Unary Plus & Minus op for ComplexType https://github.com/llvm/llvm-project/issues/141365 >From 19a9d55e62b829de872c152c40f41a4459bc8c45 Mon Sep 17 00:00:00 2001 From: AmrDevelo

[clang] [CIR] Upstream Unary Plus & Minus op for ComplexType (PR #150281)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Amr Hesham (AmrDeveloper) Changes This change adds support for Unary Plus & Minus op for ComplexType https://github.com/llvm/llvm-project/issues/141365 --- Full diff: https://github.com/llvm/llvm-project/pull/150281.diff 3 Files Affec

[clang] [CIR] Upstream Unary Plus & Minus op for ComplexType (PR #150281)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Amr Hesham (AmrDeveloper) Changes This change adds support for Unary Plus & Minus op for ComplexType https://github.com/llvm/llvm-project/issues/141365 --- Full diff: https://github.com/llvm/llvm-project/pull/150281.diff 3 Files Affecte

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Sirui Mu (Lancern) Changes This patch adds folders for the bit manipulation operations, namely: `clrsb`, `clz`, `ctz`, `parity`, `popcount`, `bitreverse`, `byte_swap`, and `rotate`. --- Full diff: https://github.com/llvm/llvm-project/pu

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-23 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Sirui Mu (Lancern) Changes This patch adds folders for the bit manipulation operations, namely: `clrsb`, `clz`, `ctz`, `parity`, `popcount`, `bitreverse`, `byte_swap`, and `rotate`. --- Full diff: https://github.com/llvm/llvm-project/pull

[clang] [CIR] Add folders for bit manipulation operations (PR #150235)

2025-07-23 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/150235 This patch adds folders for the bit manipulation operations, namely: `clrsb`, `clz`, `ctz`, `parity`, `popcount`, `bitreverse`, `byte_swap`, and `rotate`. >From 7b5e3cd1c293b1d5f64672e2f008f3e6918e680c Mon Sep

[clang] [llvm] [Clang][OpenMP] Capture mapped pointers on `target` by reference. (PR #145454)

2025-07-23 Thread Abhinav Gaba via cfe-commits
abhinavgaba wrote: > I have one big question - why do we need this? If pointer is mapped > explicitly, it becomes an attached pointer, which cannot be modified in > target region. How we capture/process it, byref or byval, does not matter, we > can do whatever is better. So, why do we need to

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-23 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 01/16] Initial implementation --- .../bugprone/unchecked-option

[clang] [clang][ExprConst] Consider integer pointers of value 0 nullptr (PR #150164)

2025-07-23 Thread Timm Baeder via cfe-commits
@@ -27,12 +27,6 @@ template void f(); // CHECK: define weak_odr void @_Z1fIXtl1BLPKi32vv( // MSABI: define {{.*}} @"??$f@$2UB@@PEBH0CA@H0AYAXXZ" template void f(); -#ifndef _WIN32 tbaederr wrote: Not sure I understand, with this patch, `template void

[clang] [clang][ExprConst] Consider integer pointers of value 0 nullptr (PR #150164)

2025-07-23 Thread Richard Smith via cfe-commits
@@ -27,12 +27,6 @@ template void f(); // CHECK: define weak_odr void @_Z1fIXtl1BLPKi32vv( // MSABI: define {{.*}} @"??$f@$2UB@@PEBH0CA@H0AYAXXZ" template void f(); -#ifndef _WIN32 zygoloid wrote: We should ensure we still have a test for mangling in th

[clang] [llvm] [SimplifyCFG] Extend jump-threading to allow live local defs (PR #135079)

2025-07-23 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/135079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP 6.0] Allow only byref arguments with `need_device_addr` modifier on `adjust_args` clause (PR #149586)

2025-07-23 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. https://github.com/llvm/llvm-project/pull/149586 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-23 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 01/18] Initial implementation --- .../bugprone/unchecked-option

[clang] [clang-repl] Lay the basic infrastructure for pretty printing of types (PR #148701)

2025-07-23 Thread Qinkun Bao via cfe-commits
qinkunbao wrote: Here is the error I got on my local machine. (I use the latest commit on the master so I could be a different PR that cause the buildbot fail) ``` TEST 'Clang :: Interpreter/pretty-print.cpp' FAILED Exit Code: 1 Command Output (stderr)

  1   2   3   4   5   >