[clang] [Clang][Sema] Fix -Whigher-precision-for-complex-division (PR #131477)

2025-04-08 Thread Mészáros Gergely via cfe-commits
@@ -10685,6 +10724,7 @@ QualType Sema::CheckMultiplyDivideOperands(ExprResult &LHS, ExprResult &RHS, if (compType.isNull() || !compType->isArithmeticType()) return InvalidOperands(Loc, LHS, RHS); if (IsDiv) { +DetectPrecisionLossInComplexDivision(*this, RHS.get()->

[clang] [clang-format][NFC] Add FormatToken::is(tok::ObjCKeywordKind) (PR #134973)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes This allows simplification of code that checks if a token is an Objective-C keyword. Also, delete the following in UnwrappedLineParser::parseStructuralElement(): - an else-after-break in the tok::at case -

[clang] [clang-format][NFC] Add FormatToken::is(tok::ObjCKeywordKind) (PR #134973)

2025-04-08 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/134973 This allows simplification of code that checks if a token is an Objective-C keyword. Also, delete the following in UnwrappedLineParser::parseStructuralElement(): - an else-after-break in the tok::at case - the c

[clang] Fileequality bugfix (PR #133253)

2025-04-08 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/133253 >From e8bf3b6f08f0e0030ea36fe8c42fcde166ad27e3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 19 Dec 2024 16:22:04 +0100 Subject: [PATCH 01/10] [libclang/python] Add equality comparison operators

[clang] [Clang][OpenCL][AMDGPU] Use `byref` for OpenCL kernel arguments (PR #134892)

2025-04-08 Thread Shilei Tian via cfe-commits
shiltian wrote: > The question isn't byval or byref, we already don't use byval. The important > ABI piece is the alignment of a pointer value passed indirectly. > > We lose all parameter attributes by going through indirect passing, but some > of those can be recovered by putting the metadata

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-08 Thread via cfe-commits
https://github.com/irymarchyk updated https://github.com/llvm/llvm-project/pull/134337 >From df25a8bbfd827085265c51a44bedbf38deebbab4 Mon Sep 17 00:00:00 2001 From: Ivan Rymarchyk <> Date: Sat, 29 Mar 2025 13:54:32 -0700 Subject: [PATCH 1/4] [clang-format]: Add `Custom` to `ShortFunctionStyle`;

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-08 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-08 Thread Younan Zhang via cfe-commits
@@ -18,19 +18,19 @@ int D = 1; #pragma data_seg(".data") int a = 1; extern const Mutable mutable_custom_section; -const Mutable mutable_custom_section; // expected-warning {{`#pragma const_seg` for section ".my_const" will not apply to 'mutable_custom_section' due to the pres

[clang] [clang] consistently quote expressions in diagnostics (PR #134769)

2025-04-08 Thread Younan Zhang via cfe-commits
@@ -143,8 +143,8 @@ def note_constexpr_null_subobject : Note< "access array element of|perform pointer arithmetic on|" "access real component of|" "access imaginary component of}0 null pointer">; -def note_constexpr_null_callee : Note< - "'%0' evaluates to a null functio

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-08 Thread David Rivera via cfe-commits
RiverDave wrote: > We should fix `IgnoreSingleElementAggregates` instead. Just to be clear, I suppose we're looking to fix `std::array` + `IgnoreSingleElementAggregates = false` as It's the only problematic combination I could analyze. The fixit this check provides on aggregate types with a

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/134362 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Fangrui Song via cfe-commits
@@ -7,35 +7,106 @@ !! LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, use !! resource_dir_with_per_target_subdir as inputs. -! Check powerpc64-ibm-aix 64-bit linking to static flang-rt +! Check powerpc64-ibm-aix 64-bit linking to static flang-rt by default ! RUN: %flang %s -### 2>&1

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Fangrui Song via cfe-commits
@@ -7,35 +7,106 @@ !! LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON, use !! resource_dir_with_per_target_subdir as inputs. -! Check powerpc64-ibm-aix 64-bit linking to static flang-rt +! Check powerpc64-ibm-aix 64-bit linking to static flang-rt by default ! RUN: %flang %s -### 2>&1

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Fangrui Song via cfe-commits
@@ -850,6 +852,21 @@ void ToolChain::addFortranRuntimeLibraryPath(const llvm::opt::ArgList &Args, CmdArgs.push_back(Args.MakeArgString("-L" + DefaultLibPath)); } +void ToolChain::addFlangRTLibPath(const ArgList &Args, + llvm::opt::ArgStrin

[clang] [llvm] [Clang][NVVM] Support `-f[no-]cuda-prec-sqrt` and propagate precision flag to `NVVMReflect` (PR #134244)

2025-04-08 Thread via cfe-commits
Lai-YT wrote: Got it. I did come across `nvptx-prec-sqrtf32`, but since _NVVMReflect_ makes the decision earlier by selecting the intrinsic in _libdevice_, I figured I couldn't rely on it. I completely agree that unifying the behavior would be ideal moving forward. Thanks so much for the insig

[clang] [SYCL] Basic code generation for SYCL kernel caller offload entry point functions. (PR #133030)

2025-04-08 Thread Tom Honermann via cfe-commits
https://github.com/tahonermann commented: Thank you for the review @erichkeane! I believe I have addressed or responded to each of your comments. https://github.com/llvm/llvm-project/pull/133030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [libcxx] [clang] fix diagnostic printing of expressions ignoring LangOpts (PR #134693)

2025-04-08 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov updated https://github.com/llvm/llvm-project/pull/134693 >From 302fc36812e5ddcbf856732d65ba7516e05ca1e3 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 7 Apr 2025 13:08:52 -0300 Subject: [PATCH] [clang] fix diagnostic printing of expressions ignoring LangO

[clang] [OpenACC][CIR] Initial patch to do OpenACC->IR lowering (PR #134936)

2025-04-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/134936 >From b843c0c8655fba8ce6d858d37c753bf0dbe304ee Mon Sep 17 00:00:00 2001 From: erichkeane Date: Tue, 8 Apr 2025 11:53:03 -0700 Subject: [PATCH 1/2] [OpenACC][CIR] Initial patch to do OpenACC->IR lowering This

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-08 Thread David Rivera via cfe-commits
RiverDave wrote: > We should fix `IgnoreSingleElementAggregates` instead. Very good observation I didn't get this detail when investigating this bug. indeed, we shouldn't warn when the 3 conditions you previously mentioned: > 1) the class is an aggregate and 2) it contains only one member and

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he edited https://github.com/llvm/llvm-project/pull/134489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-08 Thread via cfe-commits
@@ -1893,6 +1938,8 @@ FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) { } else { ChromiumStyle.AllowAllParametersOfDeclarationOnNextLine = false; ChromiumStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; +ChromiumStyle.AllowShortF

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-08 Thread via cfe-commits
@@ -1907,6 +1954,8 @@ FormatStyle getMozillaStyle() { FormatStyle MozillaStyle = getLLVMStyle(); MozillaStyle.AllowAllParametersOfDeclarationOnNextLine = false; MozillaStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; + MozillaStyle.AllowShortFunctionsOnA

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-08 Thread via cfe-commits
@@ -1501,6 +1536,8 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.AllowShortCompoundRequirementOnASingleLine = true; LLVMStyle.AllowShortEnumsOnASingleLine = true; LLVMStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All; + LLVMStyl

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-08 Thread via cfe-commits
@@ -1472,6 +1483,30 @@ static void expandPresetsSpacesInParens(FormatStyle &Expanded) { Expanded.SpacesInParensOptions = {}; } +static void expandPresetsShortFunctionsOnSingleLine(FormatStyle &Expanded) { + if (Expanded.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-08 Thread via cfe-commits
@@ -871,13 +871,81 @@ struct FormatStyle { /// void f() { bar(); } /// \endcode SFS_All, +/// Configure merge behavior using AllowShortFunctionsOnASingleLineOptions +SFS_Custom, }; /// Dependent on the value, ``int f() { return 0; }`` can be put on

[clang-tools-extra] [clang-tidy] Avoid diagnosing std::array initializations for modernize-use-designated-initializers (PR #134774)

2025-04-08 Thread David Rivera via cfe-commits
https://github.com/RiverDave edited https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format]: Add `Custom` to `ShortFunctionStyle`; add new AllowShortFunctionsOnASingleLineOptions for granular setup (PR #134337)

2025-04-08 Thread via cfe-commits
@@ -1500,7 +1523,10 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.AllowShortCaseLabelsOnASingleLine = false; LLVMStyle.AllowShortCompoundRequirementOnASingleLine = true; LLVMStyle.AllowShortEnumsOnASingleLine = true; - LLVMStyle.AllowShortF

[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of globals and global constants (PR #134399)

2025-04-08 Thread Alex Voicu via cfe-commits
@@ -37,8 +37,8 @@ static const unsigned SPIRDefIsPrivMap[] = { 0, // cuda_device 0, // cuda_constant 0, // cuda_shared -// SYCL address space values for this map are dummy -0, // sycl_global +// Most SYCL address space values for this map are dummy -

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Deric C. via cfe-commits
https://github.com/Icohedron approved this pull request. https://github.com/llvm/llvm-project/pull/134171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 11fdea9 - [clang] NFC: remove trailing whitespaces from clang/test/CXX/temp/temp.decls/temp.class.spec/p6.cpp

2025-04-08 Thread Matheus Izvekov via cfe-commits
Author: Matheus Izvekov Date: 2025-04-08T15:10:33-03:00 New Revision: 11fdea984dc6777ba4f4b7e516c2938083b34ddb URL: https://github.com/llvm/llvm-project/commit/11fdea984dc6777ba4f4b7e516c2938083b34ddb DIFF: https://github.com/llvm/llvm-project/commit/11fdea984dc6777ba4f4b7e516c2938083b34ddb.dif

[clang] [clang][bytecode] Fix various issues with multidimensional arrays (PR #134628)

2025-04-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/134628 >From fff8b1346f0ad80db78be7abb7fa1bca151fc33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 6 Apr 2025 13:15:43 +0200 Subject: [PATCH] [clang][bytecode] Fix various issues with multid

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-08 Thread Deric C. via cfe-commits
@@ -188,6 +188,13 @@ void ModuleShaderFlags::initialize(Module &M, DXILResourceTypeMap &DRTM, continue; } + // Set UseNativeLowPrecision using dx.nativelowprec module metadata + if (auto *NativeLowPrec = mdconst::extract_or_null( + M.getMo

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/134333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] ccf2284 - [CIR] Add if statement support (#134333)

2025-04-08 Thread via cfe-commits
Author: Andres-Salamanca Date: 2025-04-08T17:50:53-07:00 New Revision: ccf22848da9f050e00f23c5d4bc412ab19e81645 URL: https://github.com/llvm/llvm-project/commit/ccf22848da9f050e00f23c5d4bc412ab19e81645 DIFF: https://github.com/llvm/llvm-project/commit/ccf22848da9f050e00f23c5d4bc412ab19e81645.di

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-08 Thread Austin Schuh via cfe-commits
@@ -2,6 +2,170 @@ // RUN: %clang_cc1 -triple nvptx64-unknown-unknown -fcuda-is-device -O3 -o - %s -emit-llvm | FileCheck %s #include "Inputs/cuda.h" +struct char1 { AustinSchuh wrote: OK, newest patch should do what you suggested, thanks for the help! https

[clang] [Clang] [NFC] Tablegen component diags headers (PR #134777)

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

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -1098,12 +1098,39 @@ static TypeSourceInfo *getTypeSourceInfoForStdAlignValT(Sema &S, return S.Context.getTrivialTypeSourceInfo(StdAlignValDecl); } +// When searching for custom allocators on the PromiseType we want to +// warn that we will ignore type aware allocators.

[clang] [CIR] Upstream support for address of and dereference (PR #134317)

2025-04-08 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/134317 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Jan Svoboda via cfe-commits
@@ -237,6 +237,17 @@ class ASTReaderListener { return true; } + /// Overloaded member function of \c visitInputFile that should + /// be defined when the input file contains both the virtual and external + /// paths, for example when deserializing input files from AST

[clang] [HLSL] Handle incomplete array types (PR #133508)

2025-04-08 Thread Chris B via cfe-commits
@@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) { } } } - -static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E, -llvm::SmallVectorImpl &List, -llvm::SmallVectorImpl &Des

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-08 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. https://github.com/llvm/llvm-project/pull/134758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -135,6 +135,55 @@ mlir::Location CIRGenFunction::getLoc(mlir::Location lhs, mlir::Location rhs) { return mlir::FusedLoc::get(locs, metadata, &getMLIRContext()); } +bool CIRGenFunction::containsLabel(const Stmt *s, bool ignoreCaseStmts) { + // Null statement, not a label

[clang] 8d90a54 - [clang] Add comment about misleading alloc_size argument names (#134899)

2025-04-08 Thread via cfe-commits
Author: Jann Date: 2025-04-08T14:18:24-06:00 New Revision: 8d90a541537fbed7d8c2a759b4ff46192a2c436e URL: https://github.com/llvm/llvm-project/commit/8d90a541537fbed7d8c2a759b4ff46192a2c436e DIFF: https://github.com/llvm/llvm-project/commit/8d90a541537fbed7d8c2a759b4ff46192a2c436e.diff LOG: [cl

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-04-08 Thread Dan Liew via cfe-commits
@@ -186,4 +218,188 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +static void EmitIncompleteCountedByPointeeNotes(Sema &S, +const CountAttributedType *CATy, +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-04-08 Thread Dan Liew via cfe-commits
@@ -186,4 +218,188 @@ bool Sema::CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, return false; } +static void EmitIncompleteCountedByPointeeNotes(Sema &S, +const CountAttributedType *CATy, +

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2025-04-08 Thread Dan Liew via cfe-commits
https://github.com/delcypher updated https://github.com/llvm/llvm-project/pull/106321 >From f5b291e55859265c227427d0d630f8f698320a84 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Thu, 15 Aug 2024 16:33:04 -0700 Subject: [PATCH] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on po

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -7353,6 +7354,69 @@ void Sema::CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record) { else if (Record->hasAttr()) checkCUDADeviceBuiltinTextureClassTemplate(*this, Record); } + + llvm::SmallVector TypeAwareNewDecls; + llvm::SmallVector TypeAwareDeleteDecls;

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/134171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-08 Thread Austin Schuh via cfe-commits
https://github.com/AustinSchuh updated https://github.com/llvm/llvm-project/pull/134758 >From 1e6367407a4b23b2a85f088ba4b66a0c0afc8faa Mon Sep 17 00:00:00 2001 From: Austin Schuh Date: Mon, 7 Apr 2025 17:18:38 -0700 Subject: [PATCH 1/2] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA Sig

[clang] [Clang][OpenCL][AMDGPU] Use `byref` for OpenCL kernel arguments (PR #134892)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Shilei Tian (shiltian) Changes Due to a previous workaround allowing kernels to be called from other functions, Clang currently doesn't use the `byref` attribute for aggregate kernel arguments. The issue was recently resolved in htt

[clang] [CIR][NFC] Upstream LValueBaseInfo handling (PR #134928)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -27,7 +27,8 @@ using namespace cir; /// Given an expression of pointer type, try to /// derive a more accurate bound on the alignment of the pointer. -Address CIRGenFunction::emitPointerWithAlignment(const Expr *expr) { +Address CIRGenFunction::emitPointerWithAlignment(cons

[clang] [llvm] [Clang][NVVM] Support `-f[no-]cuda-prec-sqrt` and propagate precision flag to `NVVMReflect` (PR #134244)

2025-04-08 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: It seems like we already have perhaps too many mechanisms to control how sqrt gets lowered. There is the `__nv_sqrtf` libdevice function which chooses between specific (1:1 to PTX) intrinsics based on NVVMReflect and then there is also `llvm.sqrt` and `nvvm.sqrt.f` which are

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Recognize mutableCopy from literal as +1 (PR #132350)

2025-04-08 Thread Ryosuke Niwa via cfe-commits
@@ -97,3 +97,13 @@ void create_member_init() { RetainPtr return_bridge_cast() { return bridge_cast(create_cf_array()); } + +void mutable_copy() { + RetainPtr mutableArray = adoptNS(@{ +@"Content-Type": @"text/html", + }.mutableCopy); +} + +void string_copy(NSString *str

[clang] [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (PR #132237)

2025-04-08 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida closed https://github.com/llvm/llvm-project/pull/132237 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 1365b5b - [clang][DependencyScanning] Track dependencies from prebuilt modules to determine IsInStableDir (#132237)

2025-04-08 Thread via cfe-commits
Author: Cyndy Ishida Date: 2025-04-08T15:48:25-07:00 New Revision: 1365b5b1ad5d09a738dbe97b5a72902186e24d80 URL: https://github.com/llvm/llvm-project/commit/1365b5b1ad5d09a738dbe97b5a72902186e24d80 DIFF: https://github.com/llvm/llvm-project/commit/1365b5b1ad5d09a738dbe97b5a72902186e24d80.diff

[clang] [CLANG-CL] ignores Wpadded (PR #134426)

2025-04-08 Thread Theo de Magalhaes via cfe-commits
=?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes ,Theo de Magalhaes , =?utf-8?q?Théo?= De Mag

[clang] [clang] Add comment about misleading alloc_size argument names (PR #134899)

2025-04-08 Thread via cfe-commits
thejh wrote: cc @gburgessiv who originally introduced the attribute in https://github.com/llvm/llvm-project/commit/e37633713d93b21533d8699d0b5cf4703e3f4039 https://github.com/llvm/llvm-project/pull/134899 ___ cfe-commits mailing list cfe-commits@lists

[clang] [HLSL] Handle incomplete array types (PR #133508)

2025-04-08 Thread Sarah Spall via cfe-commits
@@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) { } } } - -static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E, -llvm::SmallVectorImpl &List, -llvm::SmallVectorImpl &Des

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread via cfe-commits
https://github.com/Andres-Salamanca updated https://github.com/llvm/llvm-project/pull/134333 >From a91edc37387fb6babceee62bbdd97fca003fad5a Mon Sep 17 00:00:00 2001 From: Andres Salamanca Date: Thu, 3 Apr 2025 12:07:25 -0500 Subject: [PATCH 1/4] [CIR] Add if statement support Upstream if statem

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-08 Thread Austin Schuh via cfe-commits
https://github.com/AustinSchuh updated https://github.com/llvm/llvm-project/pull/134758 >From 1e6367407a4b23b2a85f088ba4b66a0c0afc8faa Mon Sep 17 00:00:00 2001 From: Austin Schuh Date: Mon, 7 Apr 2025 17:18:38 -0700 Subject: [PATCH 1/2] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA Sig

[clang] cuda clang: Move nvptx-surface.cu test to CodeGenCUDA (PR #134758)

2025-04-08 Thread Artem Belevich via cfe-commits
https://github.com/Artem-B approved this pull request. LGTM. Thank you! https://github.com/llvm/llvm-project/pull/134758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. lgtm Thanks for working on this! https://github.com/llvm/llvm-project/pull/134333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [OpenACC][CIR] Initial patch to do OpenACC->IR lowering (PR #134936)

2025-04-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangir Author: Erich Keane (erichkeane) Changes This patch adds some lowering code for Compute Constructs, plus the infrastructure to someday do clauses. Doing this requires adding the dialect to the CIRGenerator. This patch does not however implemen

[clang] [OpenACC][CIR] Initial patch to do OpenACC->IR lowering (PR #134936)

2025-04-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/134936 This patch adds some lowering code for Compute Constructs, plus the infrastructure to someday do clauses. Doing this requires adding the dialect to the CIRGenerator. This patch does not however implement/co

[clang-tools-extra] Enforce SL.con.3: Add check to replace operator[] with at() [Cont.] (PR #95220)

2025-04-08 Thread Baranov Victor via cfe-commits
=��___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -16327,79 +16531,181 @@ static CanQualType RemoveAddressSpaceFromPtr(Sema &SemaRef, PtrTy->getPointeeType().getUnqualifiedType(), PtrQuals))); } -static inline bool -CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl, -C

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-08 Thread Farzon Lotfi via cfe-commits
@@ -190,6 +190,32 @@ const inline float dot2add(half2 A, half2 B, float C) { return __detail::dot2add_impl(A, B, C); } +//===--===// +// dst builtins +//===---

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Recognize mutableCopy from literal as +1 (PR #132350)

2025-04-08 Thread Rashmi Mudduluru via cfe-commits
@@ -97,3 +97,13 @@ void create_member_init() { RetainPtr return_bridge_cast() { return bridge_cast(create_cf_array()); } + +void mutable_copy() { + RetainPtr mutableArray = adoptNS(@{ +@"Content-Type": @"text/html", + }.mutableCopy); +} + +void string_copy(NSString *str

[clang] [OpenACC][CIR] Basic infrastructure for OpenACC lowering (PR #134717)

2025-04-08 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lldb-aarch64-windows` running on `linaro-armv8-windows-msvc-05` while building `clang` at step 6 "test". Full details are available at: https://lab.llvm.org/buildbot/#/builders/141/builds/7716 Here is the relevant piece of

[clang] [alpha.webkit.RetainPtrCtorAdoptChecker] Recognize mutableCopy from literal as +1 (PR #132350)

2025-04-08 Thread Rashmi Mudduluru via cfe-commits
@@ -97,3 +97,13 @@ void create_member_init() { RetainPtr return_bridge_cast() { return bridge_cast(create_cf_array()); } + +void mutable_copy() { + RetainPtr mutableArray = adoptNS(@{ +@"Content-Type": @"text/html", + }.mutableCopy); +} t-rasmud wrote:

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -2709,14 +2831,63 @@ static bool resolveAllocationOverload( llvm_unreachable("Unreachable, bad result from BestViableFunction"); } -bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range, - AllocationFunctionScope N

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -9753,27 +9753,46 @@ def err_operator_new_delete_invalid_result_type : Error< def err_operator_new_delete_dependent_result_type : Error< "%0 cannot have a dependent return type; use %1 instead">; def err_operator_new_delete_too_few_parameters : Error< - "%0 must have at l

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -9753,27 +9753,46 @@ def err_operator_new_delete_invalid_result_type : Error< def err_operator_new_delete_dependent_result_type : Error< "%0 cannot have a dependent return type; use %1 instead">; def err_operator_new_delete_too_few_parameters : Error< - "%0 must have at l

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -16335,22 +16550,27 @@ CheckOperatorNewDeclaration(Sema &SemaRef, const FunctionDecl *FnDecl) { CanQualType SizeTy = SemaRef.Context.getCanonicalType(SemaRef.Context.getSizeType()); + unsigned MinimumNonDefaultArgs = 0; // C++ [basic.stc.dynamic.allocation]p1:

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -1866,13 +1959,13 @@ static UsualDeallocFnInfo resolveDeallocationOverload( BestFns->push_back(Info); continue; } - -if (Best.isBetterThan(Info, WantSize, WantAlign)) +int ComparisonResult = Best.Compare(S, Info, IDP); +if (ComparisonResult > 0)

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -16327,79 +16531,181 @@ static CanQualType RemoveAddressSpaceFromPtr(Sema &SemaRef, PtrTy->getPointeeType().getUnqualifiedType(), PtrQuals))); } -static inline bool -CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl, -C

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -2627,16 +2731,21 @@ static bool resolveAllocationOverload( // FIXME: Find out how this interacts with the std::align_val_t fallback // once MSVC implements it. if (R.getLookupName().getCXXOverloadedOperator() == OO_Array_New && -S.Context.getLangOpts().M

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -477,6 +477,34 @@ class DeclarationName { return OO_None; } + bool isAnyOperatorNew() const { +if (getNameKind() != DeclarationName::CXXOperatorName) + return false; +switch (getCXXOverloadedOperator()) { +case OO_New: +case OO_Array_New: +

[clang] [RFC] Initial implementation of P2719 (PR #113510)

2025-04-08 Thread Oliver Hunt via cfe-commits
@@ -16421,33 +16715,70 @@ CheckOperatorDeleteDeclaration(Sema &SemaRef, FunctionDecl *FnDecl) { return true; auto *MD = dyn_cast(FnDecl); + auto ConstructDestroyingDeleteAddressType = [&]() { +assert(MD); +return SemaRef.Context.getCanonicalType(SemaRef.Context

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -110,6 +111,9 @@ struct MissingFeatures { static bool lvalueBaseInfo() { return false; } static bool alignCXXRecordDecl() { return false; } static bool setNonGC() { return false; } + static bool constantFoldsToSimpleInteger() { return false; } andykay

[clang] [CIR] Add if statement support (PR #134333)

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

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread Andy Kaylor via cfe-commits
@@ -1484,6 +1484,20 @@ mlir::Value ScalarExprEmitter::VisitUnaryLNot(const UnaryOperator *e) { return {}; } +/// If the specified expression does not fold +/// to a constant, or if it does but contains a label, return false. If it +/// constant folds return true and set th

[clang] [clang][PowerPC] Add flag to enable compatibility with GNU for complex arguments (PR #77732)

2025-04-08 Thread Kishan Parmar via cfe-commits
Long5hot wrote: > Has the patch been fixed Yess, Works expected as gnu! https://github.com/llvm/llvm-project/pull/77732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][MicrosoftMangle] Implement mangling for ConstantMatrixType (PR #134930)

2025-04-08 Thread via cfe-commits
https://github.com/Losy001 edited https://github.com/llvm/llvm-project/pull/134930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add if statement support (PR #134333)

2025-04-08 Thread via cfe-commits
https://github.com/Andres-Salamanca updated https://github.com/llvm/llvm-project/pull/134333 >From a91edc37387fb6babceee62bbdd97fca003fad5a Mon Sep 17 00:00:00 2001 From: Andres Salamanca Date: Thu, 3 Apr 2025 12:07:25 -0500 Subject: [PATCH 1/3] [CIR] Add if statement support Upstream if statem

[clang] [HLSL] Handle incomplete array types (PR #133508)

2025-04-08 Thread Sarah Spall via cfe-commits
@@ -0,0 +1,53 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -finclude-default-header -verify -Wdouble-promotion -Wconversion %s + spall wrote: Maybe you should add a test case for an array of arrays, like 'int2[2][]' https://github.com/llvm/llvm

[clang] [CLANG-CL] ignores Wpadded (PR #134426)

2025-04-08 Thread Theo de Magalhaes via cfe-commits
=?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes , =?utf-8?q?Théo?= De Magalhaes ,Theo de Magalhaes , =?utf-8?q?Théo?= De Mag

[clang] [llvm] [Clang][OpenMP] Support for dispatch construct (Sema & Codegen) support (PR #131838)

2025-04-08 Thread Alexey Bataev via cfe-commits
@@ -4528,6 +4528,115 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *getInitialExprFromCapturedExpr(Expr *Cond) { alexey-bataev wrote: It means, the context (capturedstmt) does not know a

[clang] [llvm] [fatlto] Add coroutine passes when using FatLTO with ThinLTO (PR #134434)

2025-04-08 Thread Vitaly Buka via cfe-commits
@@ -1692,6 +1692,19 @@ PassBuilder::buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO, if (ThinLTO && PGOOpt && PGOOpt->Action == PGOOptions::SampleUse) MPM.addPass(buildThinLTODefaultPipeline(Level, /*ImportSummary=*/nullptr)); else { +// ModuleSimp

[clang] [llvm] [DirectX] Implement UseNativeLowPrecision shader flag analysis (PR #134288)

2025-04-08 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,45 @@ +; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s +; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC + +target triple = "dxil-pc-shadermodel6.7-library" + +;CHECK: ; Combined Shader Flags for Module +;CHECK-NEXT: ;

[clang] [Clang][OpenCL][AMDGPU] Use `byref` for OpenCL kernel arguments (PR #134892)

2025-04-08 Thread Shilei Tian via cfe-commits
https://github.com/shiltian edited https://github.com/llvm/llvm-project/pull/134892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR][NFC] Upstream LValueBaseInfo handling (PR #134928)

2025-04-08 Thread Amr Hesham via cfe-commits
@@ -27,7 +27,8 @@ using namespace cir; /// Given an expression of pointer type, try to /// derive a more accurate bound on the alignment of the pointer. -Address CIRGenFunction::emitPointerWithAlignment(const Expr *expr) { +Address CIRGenFunction::emitPointerWithAlignment(cons

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor closed https://github.com/llvm/llvm-project/pull/134889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

2025-04-08 Thread Amr Hesham via cfe-commits
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/134536 >From 81e1cd76594d3eaeda67d5888e5e5daa63fb0e12 Mon Sep 17 00:00:00 2001 From: AmrDeveloper Date: Sun, 6 Apr 2025 14:31:35 +0200 Subject: [PATCH 1/6] [CIR] Upstream ArraySubscriptExpr for fixed size array -

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-08 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl approved this pull request. https://github.com/llvm/llvm-project/pull/133828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement the dst HLSL Function (PR #133828)

2025-04-08 Thread Farzon Lotfi via cfe-commits
@@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.2-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s + + +// CHECK-LABEL: define {{.*}} <4 x float> @{{[A-Za-z1-9_]+}}dst_impl{{[A-Za-z1-9_]*}}( +//

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Kaitlin Peng via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected=note + +float4 test_double_inputs(double p0, double p1, double p2) { + retur

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng edited https://github.com/llvm/llvm-project/pull/134171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement the `lit` intrinsic (PR #134171)

2025-04-08 Thread Kaitlin Peng via cfe-commits
https://github.com/kmpeng updated https://github.com/llvm/llvm-project/pull/134171 >From d87804880ceee63329761178e780bd301b3e50f6 Mon Sep 17 00:00:00 2001 From: kmpeng Date: Thu, 27 Mar 2025 14:39:27 -0700 Subject: [PATCH 01/13] finished lit implementation, added codegen and sema tests --- .

[clang] [CIR] Handle NullStmt (PR #134889)

2025-04-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/134889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >