[clang] [Clang][AMDGPU] Defer amdgcn.*to_lds builtins size diagnostics (PR #160140)

2025-09-24 Thread Matt Arsenault via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= , Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= Message-ID: In-Reply-To: https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/160140 ___ cfe-commits mailing lis

[clang] [analyzer] CStringChecker: fix crash in `CheckOverlap` when arguments are not pointers (PR #160511)

2025-09-24 Thread Donát Nagy via cfe-commits
@@ -96,3 +96,19 @@ void test_snprintf6() { char b[4] = {0}; snprintf(a, sizeof(a), "%s", b); // no-warning } + + +void memcpy(int dst, int src, size_t size); // expected-warning{{incompatible redeclaration of library function 'memcpy'}} expected-note{{'memcpy' is a builti

[clang] [llvm] [AMDGPU] Add a new builtin type for image descriptor rsrc (PR #160258)

2025-09-24 Thread Rana Pratap Reddy via cfe-commits
https://github.com/ranapratap55 updated https://github.com/llvm/llvm-project/pull/160258 >From 2da220874eec49becbbdbfc0a346228d8e71e1a1 Mon Sep 17 00:00:00 2001 From: ranapratap55 Date: Tue, 23 Sep 2025 14:46:16 +0530 Subject: [PATCH 1/3] [AMDGPU] Add a new builtin type for image descriptor rsr

[clang] [clang] Fix -Wdouble-promotion in C++ list-initialization (PR #159992)

2025-09-24 Thread Marcel Jacobse via cfe-commits
https://github.com/mjacobse edited https://github.com/llvm/llvm-project/pull/159992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Oliver Hunt via cfe-commits
@@ -9744,6 +9744,16 @@ static void DiagnoseNarrowingInInitList(Sema &S, case NK_Constant_Narrowing: { // A constant value was narrowed. + +// Overflow behavior destination types with a 'wrap' kind can elide ojhunt wrote: No, you are misunderstanding

[clang] [clang]bytecode] Add degenerate pointers (PR #160086)

2025-09-24 Thread Shafik Yaghmour via cfe-commits
@@ -145,7 +153,11 @@ class Pointer { return Int.Value + (Offset * elemSize()); if (isFunctionPointer()) return Fn.getIntegerRepresentation() + Offset; -return reinterpret_cast(BS.Pointee) + Offset; +if (isDegenPointer()) shafik wrote: I

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,128 @@ +//===- LevelZeroArch.cpp - list installed Level Zero devices ---*- 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] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - add MMX/SSE/AVX/AVX512 PMULHRSW intrinsics to be used in constexpr (PR #160636)

2025-09-24 Thread Timm Baeder via cfe-commits
@@ -3311,6 +3311,20 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call, return LHS.isSigned() ? LHS.ssub_sat(RHS) : LHS.usub_sat(RHS); }); + + case clang::X86::BI__builtin_ia32_pmulhrsw128: + case clang::X86::BI__builtin_ia32_pmu

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Alex Duran via cfe-commits
adurang wrote: @sarnex @hansangbae @jhuber6 would you mind taking a look at this PR? https://github.com/llvm/llvm-project/pull/160570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] ce170d2 - [CIR] Implement Unary real & imag on scalar expr (#159916)

2025-09-24 Thread via cfe-commits
Author: Amr Hesham Date: 2025-09-24T20:15:59+02:00 New Revision: ce170d28ad4e90111abe0e4c16d4f7e716ae2256 URL: https://github.com/llvm/llvm-project/commit/ce170d28ad4e90111abe0e4c16d4f7e716ae2256 DIFF: https://github.com/llvm/llvm-project/commit/ce170d28ad4e90111abe0e4c16d4f7e716ae2256.diff LO

[clang] [clang] Accept empty enum in MSVC compatible C (PR #159981)

2025-09-24 Thread via cfe-commits
https://github.com/yicuixi updated https://github.com/llvm/llvm-project/pull/159981 >From 77fc06c7147e8eec1712f2c8babdb6fd8a48dd94 Mon Sep 17 00:00:00 2001 From: yicuixi Date: Sun, 21 Sep 2025 22:22:28 +0800 Subject: [PATCH 1/3] [clang] Accept empty enum in MSVC compatible C Signed-off-by: yic

[clang] [llvm] [IR] Allow fast math flags on fptosi, fptoui and sitofp (PR #160475)

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

[clang] [llvm] [IR] Allow fast math flags on fptosi, fptoui and sitofp (PR #160475)

2025-09-24 Thread Matt Arsenault via cfe-commits
arsenm wrote: > FoldIntToFPToInt I don't see this checking UnsafeFPMath now? https://github.com/llvm/llvm-project/pull/160475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][OpenACC] Reorder 'recipe' generation to be lexical (PR #160585)

2025-09-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes It was noticed on a previous patch that I could have emitted recipes in lexical order instead of reverse order, which would improve the readability of a lot of tests. This pat

[clang] [Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - add MMX/SSE/AVX/AVX512 PMULHRSW intrinsics to be used in constexpr (PR #160636)

2025-09-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Temperz87) Changes This PR resolves #155805 and updates the following builtins to handle constant expressions: ``` _mm_mulhrs_pi16 mm_mulhrs_epi16 mm256_mulhrs_epi16 mm512_mulhrs_epi16 ``` --- Full diff: https://github.com/llvm/ll

[clang] [alpha.webkit.NoUnretainedMemberChecker] Only check @property when @implementation is seen (PR #159947)

2025-09-24 Thread Ryosuke Niwa via cfe-commits
@@ -84,6 +84,21 @@ @interface AnotherObject : NSObject { @property(nonatomic, unsafe_unretained) NSString *prop_string3; // expected-warning@-1{{Property 'prop_string3' in 'AnotherObject' is a raw pointer to retainable type 'NSString'; member variables must be a RetainPtr}} @p

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`'s handling of lambdas (PR #160592)

2025-09-24 Thread Baranov Victor via cfe-commits
vbvictor wrote: Also, could you share how we traversed before the fix and now? (If you debugged it) Given the AST for `[] { throw 0; };` (stipped useless part): ``` `-LambdaExpr '(lambda at line:2:5)' |-CXXRecordDecl col:5 implicit class definition | |-CXXMethodDecl col:5 cons

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor edited https://github.com/llvm/llvm-project/pull/160002 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Refactor operator delete argument handling (PR #160554)

2025-09-24 Thread Oliver Hunt via cfe-commits
ojhunt wrote: This looks fine, but what is the reason for the rename? https://github.com/llvm/llvm-project/pull/160554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Add a new builtin type for image descriptor rsrc (PR #160258)

2025-09-24 Thread Matt Arsenault via cfe-commits
@@ -967,6 +967,7 @@ class AMDGPUDimProps enc, string name, string asmsuffix, bits<8> NumGradients = !size(GradientArgs); } +def AMDGPUImageDescRsrcTy : LLVMType; arsenm wrote: This is unrelated to the PR https://github.com/llvm/llvm-project/pull/160258 _

[clang] [clang] Implement __builtin_stdc_rotate_left, __builtin_stdc_rotate_right (PR #160259)

2025-09-24 Thread NagaChaitanya Vellanki via cfe-commits
https://github.com/chaitanyav updated https://github.com/llvm/llvm-project/pull/160259 >From 3fae000a82a85a8d9a137b128c781cbc1ef76964 Mon Sep 17 00:00:00 2001 From: NagaChaitanya Vellanki Date: Tue, 23 Sep 2025 02:17:49 -0700 Subject: [PATCH] [clang] Implement __builtin_stdc_rotate_{left,right}

[clang] [CIR] Implement Unary real & imag on scalar expr (PR #159916)

2025-09-24 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper closed https://github.com/llvm/llvm-project/pull/159916 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [darwin] Warn when using -fno-rtti with -fexceptions (PR #160622)

2025-09-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Akira Hatanaka (ahatanak) Changes On Darwin, this configuration can lead to runtime failures. clang emits RTTI objects that the exception-handling runtime treats as distinct from those emitted in system libraries. As a result, C++ catch h

[clang] [Headers][X86] VectorExprEvaluator::VisitCallExpr - allow SSE/AVX2/AVX512 pack intrinsics to be used in constexpr (PR #156003)

2025-09-24 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon approved this pull request. LGTM - cheers! https://github.com/llvm/llvm-project/pull/156003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IR] Allow fast math flags on fptosi, fptoui and sitofp (PR #160475)

2025-09-24 Thread via cfe-commits
paperchalice wrote: > > FoldIntToFPToInt > > I don't see this checking UnsafeFPMath now? Oops, it is `foldFPToIntToFP`, it currently depends on `DAG.getTarget().Options.NoSignedZerosFPMath` https://github.com/llvm/llvm-project/pull/160475 ___ cfe-co

[clang-tools-extra] [clang-tidy] New Option Invalid Enum Default Initialization (PR #159220)

2025-09-24 Thread Félix-Antoine Constantin via cfe-commits
https://github.com/felix642 updated https://github.com/llvm/llvm-project/pull/159220 From 8177f228f3d428336d802139eebff70426067b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix-Antoine=20Constantin?= Date: Tue, 16 Sep 2025 21:10:25 -0400 Subject: [PATCH 1/6] =?UTF-8?q?[clang-tidy]=C2=A0N

[clang] [clang] introduce constexpr step limit opt-out (PR #160440)

2025-09-24 Thread via cfe-commits
https://github.com/Tsche updated https://github.com/llvm/llvm-project/pull/160440 >From a9d97d453d6d6587ec28aee9381020b1cbd54412 Mon Sep 17 00:00:00 2001 From: Tsche Date: Wed, 24 Sep 2025 07:09:29 +0200 Subject: [PATCH 1/3] [clang] introduce constexpr step limit opt-out --- clang/docs/UsersM

[clang] [WebKit checkers] Treat the return value of an instance method as an unsafe pointer origin (PR #160569)

2025-09-24 Thread Ryosuke Niwa via cfe-commits
https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/160569 >From b43b17baebe66fe4714106061e56aac2ca8cae2a Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa Date: Wed, 24 Sep 2025 00:41:55 -0700 Subject: [PATCH 1/3] [WebKit checkers] Treat the return value of an instance method

[clang] [alpha.webkit.NoUnretainedMemberChecker] Only check @property when @implementation is seen (PR #159947)

2025-09-24 Thread Ryosuke Niwa via cfe-commits
@@ -84,6 +84,21 @@ @interface AnotherObject : NSObject { @property(nonatomic, unsafe_unretained) NSString *prop_string3; // expected-warning@-1{{Property 'prop_string3' in 'AnotherObject' is a raw pointer to retainable type 'NSString'; member variables must be a RetainPtr}} @p

[clang] [llvm] [LICM] Sink unused l-invariant loads in preheader. (PR #157559)

2025-09-24 Thread Vigneshwar Jayakumar via cfe-commits
https://github.com/VigneshwarJ edited https://github.com/llvm/llvm-project/pull/157559 ___ 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 readability-default-lambda-capture (PR #160150)

2025-09-24 Thread JJ Marr via cfe-commits
https://github.com/jjmarr-amd updated https://github.com/llvm/llvm-project/pull/160150 >From 35df1c6ea3af8dbaea2d7049ae79b14ce39f0774 Mon Sep 17 00:00:00 2001 From: JJ Marr Date: Fri, 11 Jul 2025 14:40:57 -0400 Subject: [PATCH 01/14] Bugprone-default-lambda-capture on-behalf-of: @AMD --- ...

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Joseph Huber via cfe-commits
@@ -1,8 +1,10 @@ set(LLVM_LINK_COMPONENTS Support) -add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp AMDGPUArchByHIP.cpp) +add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp + AMDGPUArchByHIP.cpp LevelZeroAr

[clang] [clang]bytecode] Add degenerate pointers (PR #160086)

2025-09-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I have no idea what is going on here... can we have an improved/descriptive commit message to help us out here? I'm really confused as to what is going on. https://github.com/llvm/llvm-project/pull/160086 ___

[clang] [clang]bytecode] Add degenerate pointers (PR #160086)

2025-09-24 Thread Shafik Yaghmour via cfe-commits
@@ -252,14 +264,19 @@ class Pointer { /// Checks if the pointer is null. bool isZero() const { -if (isBlockPointer()) +switch (StorageKind) { +case Storage::Int: + return Int.Value == 0 && Offset == 0; +case Storage::Block: return BS.Pointee ==

[clang] [clang]bytecode] Add degenerate pointers (PR #160086)

2025-09-24 Thread Shafik Yaghmour via cfe-commits
@@ -252,14 +264,19 @@ class Pointer { /// Checks if the pointer is null. bool isZero() const { -if (isBlockPointer()) +switch (StorageKind) { +case Storage::Int: + return Int.Value == 0 && Offset == 0; +case Storage::Block: return BS.Pointee ==

[clang] [clang] Implement __builtin_stdc_rotate_left, __builtin_stdc_rotate_right (PR #160259)

2025-09-24 Thread Eli Friedman via cfe-commits
@@ -3642,6 +3642,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, case Builtin::BI__builtin_rotateleft16: case Builtin::BI__builtin_rotateleft32: case Builtin::BI__builtin_rotateleft64: + case Builtin::BI__builtin_stdc_rotate_left: -

[clang] [clang] Support building native tools when cross-compiling standalone clang (PR #160605)

2025-09-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ross Burton (rossburton) Changes When cross-compiling the LLVM project as a whole (from llvm/), if it cannot find presupplied tools it will create a native build environment to build the tools it needs. However, when doing a standalone b

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Alex Duran via cfe-commits
https://github.com/adurang updated https://github.com/llvm/llvm-project/pull/160570 >From c15a1f18dad2a4ea880bf785f942d9a84be8364f Mon Sep 17 00:00:00 2001 From: Alex Duran Date: Wed, 24 Sep 2025 19:16:41 +0200 Subject: [PATCH 1/4] [clang][tools] Add LevelZero support to offload-arch --- clan

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Alex Duran via cfe-commits
https://github.com/adurang edited https://github.com/llvm/llvm-project/pull/160570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Alex Duran via cfe-commits
@@ -72,27 +83,20 @@ int main(int argc, char *argv[]) { return 0; } - // If this was invoked from the legacy symlinks provide the same behavior. - bool AMDGPUOnly = Only == VendorName::amdgpu || -sys::path::stem(argv[0]).starts_with("amdgpu-arch"); -

[clang] [clang][Sema] Fix incomplete C mode incompatible ExtInfo/ExtProtoInfo conversion diagnostic (PR #160477)

2025-09-24 Thread Bruno De Fraine via cfe-commits
@@ -9187,12 +9187,43 @@ static AssignConvertType checkPointerTypesForAssignment(Sema &S, return AssignConvertType::IncompatibleFunctionPointer; return AssignConvertType::IncompatiblePointer; } - bool DiscardingCFIUncheckedCallee, AddingCFIUncheckedCallee; - if (!

[clang] [clang][bytecode] Use in `Expr::tryEvaluateString` (PR #160118)

2025-09-24 Thread Shafik Yaghmour via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -45,3 +48,10 @@ void f2() { void test() { f(nullptr); } + +/// Arguments must be null terminated. +constexpr char K[] = {'a', 'b'}; shafik wrote: I think that is ok, we are just making we test both the ha

[clang] [flang] [llvm] [X86][AVX10] Remove EVEX512 and AVX10-256 implementations (PR #157034)

2025-09-24 Thread Arthur Eubanks via cfe-commits
aeubanks wrote: hi, we're running into a crash with the following IR that I bisected to this patch ``` $ cat /tmp/a.ll target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128" target triple = "i686-unknown-linux-android29" declare void @g()

[clang] [NFC][OpenACC][CIR] Extract 'base' class for Recipe generation (PR #160603)

2025-09-24 Thread Erich Keane via cfe-commits
erichkeane wrote: @bcardosolopes : Let me know if this is about what you had in mind/is acceptable. https://github.com/llvm/llvm-project/pull/160603 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [NFC][OpenACC][CIR] Extract 'base' class for Recipe generation (PR #160603)

2025-09-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Erich Keane (erichkeane) Changes It was brought up on a previous review that the CIRGenOpenACCRecipe.h file was getting too large. I noticed that the 'dependent on template argument' parts were actually quite small, so I extract a base

[clang] [CIR] Implement AtomicExpr for ComplexType (PR #160563)

2025-09-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/160563 ___ 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 readability-default-lambda-capture (PR #160150)

2025-09-24 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,43 @@ +.. title:: clang-tidy - readability-default-lambda-capture + +readability-default-lambda-capture +== + +Warns on default lambda captures (e.g. ``[&](){ ... }``, ``[=](){ ... }``) + +Default captures can lead to subtle bugs includ

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -424,6 +455,1006 @@ void CIRGenItaniumCXXABI::emitVirtualInheritanceTables( vtables.emitVTTDefinition(vtt, cgm.getVTableLinkage(rd), rd); } +namespace { +class CIRGenItaniumRTTIBuilder { + CIRGenModule &cgm; // Per-module state. + const CIRGenItaniumCXXA

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -424,6 +455,1006 @@ void CIRGenItaniumCXXABI::emitVirtualInheritanceTables( vtables.emitVTTDefinition(vtt, cgm.getVTableLinkage(rd), rd); } +namespace { +class CIRGenItaniumRTTIBuilder { + CIRGenModule &cgm; // Per-module state. + const CIRGenItaniumCXXA

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -2171,8 +2171,53 @@ mlir::Attribute CIRGenModule::getAddrOfRTTIDescriptor(mlir::Location loc, if (!shouldEmitRTTI(forEh)) return builder.getConstNullPtrAttr(builder.getUInt8PtrTy()); - errorNYI(loc, "getAddrOfRTTIDescriptor"); - return mlir::Attribute(); + if (for

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -2171,8 +2171,53 @@ mlir::Attribute CIRGenModule::getAddrOfRTTIDescriptor(mlir::Location loc, if (!shouldEmitRTTI(forEh)) return builder.getConstNullPtrAttr(builder.getUInt8PtrTy()); - errorNYI(loc, "getAddrOfRTTIDescriptor"); - return mlir::Attribute(); + if (for

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor commented: This is an awful lot of code, and a lot of it isn't covered by the test. Is it possible to strip this down to just the paths that are needed by the test and replace the rest with NYI markers? Also, throughout this PR there are a lot of places where our

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -424,6 +455,1006 @@ void CIRGenItaniumCXXABI::emitVirtualInheritanceTables( vtables.emitVTTDefinition(vtt, cgm.getVTableLinkage(rd), rd); } +namespace { +class CIRGenItaniumRTTIBuilder { + CIRGenModule &cgm; // Per-module state. + const CIRGenItaniumCXXA

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -424,6 +455,1006 @@ void CIRGenItaniumCXXABI::emitVirtualInheritanceTables( vtables.emitVTTDefinition(vtt, cgm.getVTableLinkage(rd), rd); } +namespace { +class CIRGenItaniumRTTIBuilder { + CIRGenModule &cgm; // Per-module state. + const CIRGenItaniumCXXA

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -424,6 +455,1006 @@ void CIRGenItaniumCXXABI::emitVirtualInheritanceTables( vtables.emitVTTDefinition(vtt, cgm.getVTableLinkage(rd), rd); } +namespace { +class CIRGenItaniumRTTIBuilder { + CIRGenModule &cgm; // Per-module state. + const CIRGenItaniumCXXA

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -0,0 +1,503 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir andykaylor wrote: Rather than introducing a new test, could you just remove the `-fno-rtti` option from the existing `vtt.cpp` test and add the new checks?

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -47,6 +47,49 @@ cir::RecordType CIRGenVTables::getVTableType(const VTableLayout &layout) { return cgm.getBuilder().getAnonRecordTy(tys, /*incomplete=*/false); } +/// At this point in the translation unit, does it appear that can we +/// rely on the vtable being defined e

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -2171,8 +2171,53 @@ mlir::Attribute CIRGenModule::getAddrOfRTTIDescriptor(mlir::Location loc, if (!shouldEmitRTTI(forEh)) return builder.getConstNullPtrAttr(builder.getUInt8PtrTy()); - errorNYI(loc, "getAddrOfRTTIDescriptor"); - return mlir::Attribute(); + if (for

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -250,6 +267,18 @@ class CIRGenModule : public CIRGenTypeCache { mlir::Attribute getAddrOfRTTIDescriptor(mlir::Location loc, QualType ty, bool forEH = false); + static mlir::SymbolTable::Visibility getCIRVisibility(Visibility v) {

[clang] [CIR] Upstream RTTI Builder & RTTI for VTable Definitions (PR #160002)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -2171,8 +2171,53 @@ mlir::Attribute CIRGenModule::getAddrOfRTTIDescriptor(mlir::Location loc, if (!shouldEmitRTTI(forEh)) return builder.getConstNullPtrAttr(builder.getUInt8PtrTy()); - errorNYI(loc, "getAddrOfRTTIDescriptor"); - return mlir::Attribute(); + if (for

[clang-tools-extra] [clang-tidy] Add readability-default-lambda-capture (PR #160150)

2025-09-24 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,34 @@ +//===--===// +// +// 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: Apac

[clang-tools-extra] [clang-tidy] Add readability-default-lambda-capture (PR #160150)

2025-09-24 Thread JJ Marr via cfe-commits
https://github.com/jjmarr-amd updated https://github.com/llvm/llvm-project/pull/160150 >From 35df1c6ea3af8dbaea2d7049ae79b14ce39f0774 Mon Sep 17 00:00:00 2001 From: JJ Marr Date: Fri, 11 Jul 2025 14:40:57 -0400 Subject: [PATCH 01/15] Bugprone-default-lambda-capture on-behalf-of: @AMD --- ...

[clang-tools-extra] [clang-tidy] Add readability-default-lambda-capture (PR #160150)

2025-09-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/160150 ___ 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 readability-default-lambda-capture (PR #160150)

2025-09-24 Thread Baranov Victor via cfe-commits
@@ -0,0 +1,43 @@ +.. title:: clang-tidy - readability-default-lambda-capture + +readability-default-lambda-capture +== + +Warns on default lambda captures (e.g. ``[&](){ ... }``, ``[=](){ ... }``) + +Default captures can lead to subtle bugs includ

[clang-tools-extra] [clang-tidy] Add readability-default-lambda-capture (PR #160150)

2025-09-24 Thread Baranov Victor via cfe-commits
@@ -15,6 +15,7 @@ add_clang_library(clangTidyReadabilityModule STATIC ContainerDataPointerCheck.cpp ContainerSizeEmptyCheck.cpp ConvertMemberFunctionsToStatic.cpp + DefaultLambdaCaptureCheck.cpp vbvictor wrote: I may say it should be "avoid-default-lamb

[clang-tools-extra] [clang-tidy] Add readability-default-lambda-capture (PR #160150)

2025-09-24 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor commented: I personally find it not very useful to have a check to just prohibit part of the language without providing immediate fixits/some deeper analysis. There are some ways to improve it: - check what variables are used in lambda and provide fixit with actual

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`'s handling of lambdas (PR #160592)

2025-09-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Victor Chernyakin (localspook) Changes Fixes #132605. --- Full diff: https://github.com/llvm/llvm-project/pull/160592.diff 3 Files Affected: - (modified) clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp (+5) - (modi

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`'s handling of lambdas (PR #160592)

2025-09-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Victor Chernyakin (localspook) Changes Fixes #132605. --- Full diff: https://github.com/llvm/llvm-project/pull/160592.diff 3 Files Affected: - (modified) clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp (+5) - (modified) c

[clang] [NFC][OpenACC] Reorder 'recipe' generation to be lexical (PR #160585)

2025-09-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/160585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Improve `bugprone-exception-escape`'s handling of lambdas (PR #160592)

2025-09-24 Thread Victor Chernyakin via cfe-commits
https://github.com/localspook created https://github.com/llvm/llvm-project/pull/160592 Fixes #132605. >From d9d55b575b9f79fca04363409bbbe35c7312a21c Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Wed, 24 Sep 2025 12:43:55 -0700 Subject: [PATCH] [clang-tidy] Improve `bugprone-exception-

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via cfe-commits
@@ -4043,6 +4043,33 @@ def note_cannot_use_trivial_abi_reason : Note< "it has a __weak field|it has a field of a non-trivial class type|" "it has an address-discriminated '__ptrauth' field}1">; +// OverflowBehavior attribute +def err_overflow_behavior_unknown_ident +:

[clang] [clang] Implement __builtin_stdc_rotate_left, __builtin_stdc_rotate_right (PR #160259)

2025-09-24 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. LGTM, but let's wait for one of the Clang people to take another look. https://github.com/llvm/llvm-project/pull/160259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [clang-shlib] Fix linking libclang-cpp on Haiku (PR #156401)

2025-09-24 Thread Brad Smith via cfe-commits
brad0 wrote: cc @DavidSpickett https://github.com/llvm/llvm-project/pull/156401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][OpenACC] Reorder 'recipe' generation to be lexical (PR #160585)

2025-09-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane auto_merge_enabled https://github.com/llvm/llvm-project/pull/160585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via cfe-commits
https://github.com/JustinStitt edited https://github.com/llvm/llvm-project/pull/148914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Alex Duran via cfe-commits
https://github.com/adurang created https://github.com/llvm/llvm-project/pull/160570 None >From c15a1f18dad2a4ea880bf785f942d9a84be8364f Mon Sep 17 00:00:00 2001 From: Alex Duran Date: Wed, 24 Sep 2025 19:16:41 +0200 Subject: [PATCH] [clang][tools] Add LevelZero support to offload-arch --- cl

[clang] [llvm] [LICM] Sink unused l-invariant loads in preheader. (PR #157559)

2025-09-24 Thread Vigneshwar Jayakumar via cfe-commits
https://github.com/VigneshwarJ updated https://github.com/llvm/llvm-project/pull/157559 >From 63d81f0c3e09d27cd048657d81f12a63bcb89796 Mon Sep 17 00:00:00 2001 From: vigneshwar jayakumar Date: Mon, 8 Sep 2025 16:24:50 -0500 Subject: [PATCH 1/4] [IndVarSimplify] Sink unused l-invariant loads in

[clang] [llvm] [LICM] Sink unused l-invariant loads in preheader. (PR #157559)

2025-09-24 Thread Vigneshwar Jayakumar via cfe-commits
https://github.com/VigneshwarJ edited https://github.com/llvm/llvm-project/pull/157559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [Clang] Introduce OverflowBehaviorType for fine-grained overflow control (PR #148914)

2025-09-24 Thread Justin Stitt via cfe-commits
@@ -9744,6 +9744,16 @@ static void DiagnoseNarrowingInInitList(Sema &S, case NK_Constant_Narrowing: { // A constant value was narrowed. + +// Overflow behavior destination types with a 'wrap' kind can elide JustinStitt wrote: Check out `OverflowBeha

[clang] [llvm] [mlir] fix(security): Address CodeQL Uncontrolled Data in Path Expression vulnerability (PR #160531)

2025-09-24 Thread MUSTAPHA BARKI via cfe-commits
https://github.com/aka76bm updated https://github.com/llvm/llvm-project/pull/160531 >From e28b543df69358dddef60dca110353227bced70f Mon Sep 17 00:00:00 2001 From: MUSTAPHA BARKI Date: Tue, 23 Sep 2025 02:52:03 +0100 Subject: [PATCH 01/10] [clang][AST] Add comment clarifying GNU inline visibilit

[clang] [clang] Fix -Wdouble-promotion in C++ list-initialization (PR #159992)

2025-09-24 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/159992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Build and ship OpenMP with LLVM releases (PR #160581)

2025-09-24 Thread Leandro Lupori via cfe-commits
https://github.com/luporl created https://github.com/llvm/llvm-project/pull/160581 Fixes #135021 Suggested-by: Kawashima Takahiro >From 459c213b8d6c51f10a9f7cb37b5b0707205a78b0 Mon Sep 17 00:00:00 2001 From: Leandro Lupori Date: Wed, 24 Sep 2025 18:23:25 + Subject: [PATCH] Build and shi

[clang] [llvm] [LICM] Sink unused l-invariant loads in preheader. (PR #157559)

2025-09-24 Thread Vigneshwar Jayakumar via cfe-commits
https://github.com/VigneshwarJ updated https://github.com/llvm/llvm-project/pull/157559 >From 63d81f0c3e09d27cd048657d81f12a63bcb89796 Mon Sep 17 00:00:00 2001 From: vigneshwar jayakumar Date: Mon, 8 Sep 2025 16:24:50 -0500 Subject: [PATCH 1/3] [IndVarSimplify] Sink unused l-invariant loads in

[clang] [clang] Fix -Wdouble-promotion in C++ list-initialization (PR #159992)

2025-09-24 Thread via cfe-commits
https://github.com/Sirraide auto_merge_enabled https://github.com/llvm/llvm-project/pull/159992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix -Wdouble-promotion in C++ list-initialization (PR #159992)

2025-09-24 Thread via cfe-commits
https://github.com/Sirraide approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/159992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add initial support for operator delete (PR #160574)

2025-09-24 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/160574 ___ 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 check performance-lost-std-move (PR #139525)

2025-09-24 Thread Vasiliy Kulikov via cfe-commits
https://github.com/segoon updated https://github.com/llvm/llvm-project/pull/139525 >From 3abbce9f817f6d09f9a5b7549a8122c80821eaf8 Mon Sep 17 00:00:00 2001 From: Vasily Kulikov Date: Mon, 12 May 2025 13:05:43 +0300 Subject: [PATCH 01/35] [clang-tidy] Add check performance-lost-std-move --- ...

[clang] [clang] Fix -Wdouble-promotion in C++ list-initialization (PR #159992)

2025-09-24 Thread Marcel Jacobse via cfe-commits
https://github.com/mjacobse updated https://github.com/llvm/llvm-project/pull/159992 >From 4f63f703b5bb56d2def94b99cd05212652605e42 Mon Sep 17 00:00:00 2001 From: mjacobse <44684927+mjaco...@users.noreply.github.com> Date: Sun, 21 Sep 2025 18:06:20 +0200 Subject: [PATCH 01/13] [clang] Fix -Wdoub

[clang] [CIR] Add initial support for operator delete (PR #160574)

2025-09-24 Thread Andy Kaylor via cfe-commits
@@ -210,6 +210,60 @@ RValue CIRGenFunction::emitCXXMemberOrOperatorCall( return emitCall(fnInfo, callee, returnValue, args, nullptr, loc); } +namespace { +/// The parameters to pass to a usual operator delete. +struct UsualDeleteParams { + TypeAwareAllocationMode typeAwareD

[clang] [clang][dataflow] Copy records relative to the destination type for c… (PR #160557)

2025-09-24 Thread Samira Bakon via cfe-commits
https://github.com/bazuzi updated https://github.com/llvm/llvm-project/pull/160557 >From e1f30ab5e9699f8bf476c89320e52350c76dffee Mon Sep 17 00:00:00 2001 From: Samira Bakon Date: Wed, 24 Sep 2025 12:46:15 -0400 Subject: [PATCH 1/2] [clang][dataflow] Copy records relative to the destination ty

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Joseph Huber via cfe-commits
@@ -1,8 +1,16 @@ set(LLVM_LINK_COMPONENTS Support) -add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp AMDGPUArchByHIP.cpp) +add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp + AMDGPUArchByHIP.cpp LevelZeroAr

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,128 @@ +//===- LevelZeroArch.cpp - list installed Level Zero devices ---*- 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][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Alex Duran via cfe-commits
@@ -1,8 +1,16 @@ set(LLVM_LINK_COMPONENTS Support) -add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp AMDGPUArchByHIP.cpp) +add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp + AMDGPUArchByHIP.cpp LevelZeroAr

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Alex Duran via cfe-commits
@@ -0,0 +1,128 @@ +//===- LevelZeroArch.cpp - list installed Level Zero devices ---*- 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][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,128 @@ +//===- LevelZeroArch.cpp - list installed Level Zero devices ---*- 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][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Nick Sarnie via cfe-commits
@@ -1,8 +1,16 @@ set(LLVM_LINK_COMPONENTS Support) -add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp AMDGPUArchByHIP.cpp) +add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp + AMDGPUArchByHIP.cpp LevelZeroAr

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Nick Sarnie via cfe-commits
@@ -1,8 +1,16 @@ set(LLVM_LINK_COMPONENTS Support) -add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp AMDGPUArchByHIP.cpp) +add_clang_tool(offload-arch OffloadArch.cpp NVPTXArch.cpp AMDGPUArchByKFD.cpp + AMDGPUArchByHIP.cpp LevelZeroAr

[clang] [clang-format] Add BreakAfterOpenBracket* and BreakBeforeCloseBracket* (PR #108332)

2025-09-24 Thread Gedare Bloom via cfe-commits
gedare wrote: rebased for release notes conflict. waiting on @mydeveloperday and @owenca https://github.com/llvm/llvm-project/pull/108332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

2025-09-24 Thread Joseph Huber via cfe-commits
@@ -73,15 +77,22 @@ int main(int argc, char *argv[]) { sys::path::stem(argv[0]).starts_with("amdgpu-arch"); bool NVIDIAOnly = Only == VendorName::nvptx || sys::path::stem(argv[0]).starts_with("nvptx-arch"); + bool IntelOnly = Only == V

  1   2   3   >