[clang] [clang-tools-extra] [libcxx] [clang] improved preservation of template keyword (PR #133610)

2025-04-07 Thread Devon Loehr via cfe-commits
DKLoehr wrote: I ended up with the following reproducer: ``` template struct S { template using Arg = T::template Arg; void f(Arg); void f(Arg); }; ``` Running this with `clang++ repro.cc -fsyntax-only -std=c++20` yields ``` repro.cc:5:8: error: class member cannot be redeclared

[clang-tools-extra] [clang-doc][NFC] refactor out file helpers (PR #134298)

2025-04-07 Thread Paul Kirth via cfe-commits
@@ -0,0 +1,72 @@ +//===-- FileHelpersClangDoc.cpp - File Helpers ---*- C++-*-===// ilovepi wrote: Apparently, we don't use that line anymore. https://llvm.org/docs/CodingStandards.html#file-headers Was brought up here when I saw this the first

[clang-tools-extra] [clang-doc][NFC] refactor out file helpers (PR #134298)

2025-04-07 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi edited https://github.com/llvm/llvm-project/pull/134298 ___ 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-07 Thread Ashley Coleman 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: linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl8__detail8dst

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

2025-04-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/134717 >From 0c0892e5142e2d0f687c091cb55ea14c97c975eb Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 7 Apr 2025 08:07:18 -0700 Subject: [PATCH 1/3] [OpenACC][CIR] Basic infrastructure for OpenACC lowering Thi

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

2025-04-07 Thread Deric C. via cfe-commits
Icohedron wrote: In my opinion, we should just define `lit` without templates, thereby following Clang's overload resolution rules and allowing implicit vector truncation. Overload resolution and implicit vector truncation are behaviors that should be consistent across the language. To me, it

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

2025-04-07 Thread Deric C. via cfe-commits
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); } _DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp) _DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp) +//===--===// +// lit builtins overloa

[clang] [clang][modules] Name the module map files on PCM file conflict (PR #134475)

2025-04-07 Thread Cyndy Ishida via cfe-commits
@@ -6067,14 +6062,21 @@ llvm::Error ASTReader::ReadSubmoduleBlock(ModuleFile &F, if (OptionalFileEntryRef CurFile = CurrentModule->getASTFile()) { // Don't emit module relocation error if we have -fno-validate-pch if (!bool(PP.getPreprocessorOpts().D

[clang] Move CodeGen cuda.h to Inputs from include (PR #134706)

2025-04-07 Thread via cfe-commits
github-actions[bot] wrote: @calewis Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-07 Thread Sirui Mu via cfe-commits
https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/134673 This PR upstreams initial support for making function calls in CIR. Function arguments and return values are not included to keep the patch small for review. Related to #132487 >From 82f6ce93ca22dd778173100231

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-07 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,78 @@ +//===- OffloadArch.cpp - list available GPUs *- 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: Apa

[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

2025-04-07 Thread via cfe-commits
github-actions[bot] wrote: @lalaniket8 Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a bui

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

[clang] [CodeGen] Change placeholder from `undef` to `poison` (PR #134731)

2025-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Pedro Lobo (pedroclobo) Changes Fill default values of a map with `poison` instead of `undef`. There should be no functional difference as the default values are overridden later. --- Full diff: https://github.com/llvm/llvm-projec

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

2025-04-07 Thread via cfe-commits
https://github.com/metkarpoonam edited 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] [llvm] [DirectX] Use scalar arguments for @llvm.dx.dot intrinsics (PR #134570)

2025-04-07 Thread Farzon Lotfi via cfe-commits
@@ -185,8 +186,14 @@ static Value *expandFloatDotIntrinsic(CallInst *Orig, Value *A, Value *B) { /* gen_crash_diag=*/false); return nullptr; } - return Builder.CreateIntrinsic(ATy->getScalarType(), DotIntrinsic, - ArrayRef{A, B},

[clang] [llvm] [NVPTX] Add builtins and intrinsics for conversions of new FP types (PR #134345)

2025-04-07 Thread Srinivasa Ravi via cfe-commits
@@ -580,6 +580,15 @@ def __nvvm_f2bf16_rz : NVPTXBuiltinSMAndPTX<"__bf16(float)", SM_80, PTX70>; def __nvvm_f2bf16_rz_relu : NVPTXBuiltinSMAndPTX<"__bf16(float)", SM_80, PTX70>; def __nvvm_f2tf32_rna : NVPTXBuiltinSMAndPTX<"int32_t(float)", SM_80, PTX70>; +def __nvvm_f2tf32_

[clang] [llvm] [NVPTX] Add builtins and intrinsics for conversions of new FP types (PR #134345)

2025-04-07 Thread Srinivasa Ravi via cfe-commits
https://github.com/Wolfram70 edited https://github.com/llvm/llvm-project/pull/134345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Add builtins and intrinsics for conversions of new FP types (PR #134345)

2025-04-07 Thread Srinivasa Ravi via cfe-commits
@@ -703,6 +703,53 @@ let hasSideEffects = false in { defm CVT_to_tf32_rz_satf : CVT_TO_TF32<"rz.satfinite", [hasPTX<86>, hasSM<100>]>; defm CVT_to_tf32_rn_relu_satf : CVT_TO_TF32<"rn.relu.satfinite", [hasPTX<86>, hasSM<100>]>; defm CVT_to_tf32_rz_relu_satf : CVT_TO_TF

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

2025-04-07 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] [CIR] Upstream ArraySubscriptExpr for fixed size array (PR #134536)

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

[clang] [CodeGen] Change placeholder from `undef` to `poison` (PR #134731)

2025-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Pedro Lobo (pedroclobo) Changes Fill default values of a map with `poison` instead of `undef`. There should be no functional difference as the default values are overridden later. --- Full diff: https://github.com/llvm/llvm-project/pull/1

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

2025-04-07 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt edited https://github.com/llvm/llvm-project/pull/113510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-04-07 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin closed https://github.com/llvm/llvm-project/pull/133310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/134713 >From e44db82f3abe7c1d23c2b49094c92a890127ffc7 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 7 Apr 2025 14:37:22 -0500 Subject: [PATCH 1/6] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-ar

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

2025-04-07 Thread via cfe-commits
Author: Timm Baeder Date: 2025-04-08T05:48:55+02:00 New Revision: bdd087023f02fb377302595bf7f61e9cae8adb71 URL: https://github.com/llvm/llvm-project/commit/bdd087023f02fb377302595bf7f61e9cae8adb71 DIFF: https://github.com/llvm/llvm-project/commit/bdd087023f02fb377302595bf7f61e9cae8adb71.diff L

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,78 @@ +//===- OffloadArch.cpp - list available GPUs *- 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: Apa

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

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/134628 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-07 Thread via cfe-commits
https://github.com/Sirraide created https://github.com/llvm/llvm-project/pull/134777 The component diagnostic headers (i.e. `DiagnosticAST.h` and friends) all follow the same format, and there’s enough of them (and in them) to where updating all of them has become rather tedious (at least it w

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

2025-04-07 Thread via cfe-commits
Sirraide wrote: > ⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️ > > You can test this locally with the following command: > View the diff from clang-format here. clang-format seems to be having a stroke here. It’s suggesting indenting `namespace clang {` and everything in

[clang] [Clang][CodeGen] Respect -fwrapv-pointer when emitting struct GEPs (PR #134269)

2025-04-07 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: This makes sense to me but this is not my area. https://github.com/llvm/llvm-project/pull/134269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fb9915a - [clang][bytecode] Fix emitDestruction() for dummy descriptors (#134665)

2025-04-07 Thread via cfe-commits
Author: Timm Baeder Date: 2025-04-08T06:00:35+02:00 New Revision: fb9915a3918e3a9659a7f2825ee35bada3a2baf1 URL: https://github.com/llvm/llvm-project/commit/fb9915a3918e3a9659a7f2825ee35bada3a2baf1 DIFF: https://github.com/llvm/llvm-project/commit/fb9915a3918e3a9659a7f2825ee35bada3a2baf1.diff L

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -198,6 +198,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { return create(loc, cir::BinOpKind::Div, lhs, rhs); } + + /// Create a cir.ptr_stride operation to get access to an array element. + /// idx is the index of the element to access, shouldDecay is

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-07 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/134713 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-07 Thread Finn Plummer via cfe-commits
@@ -89,37 +88,178 @@ bool RootSignatureParser::parseDescriptorTableClause() { CurToken.TokKind == TokenKind::kw_UAV || CurToken.TokKind == TokenKind::kw_Sampler) && "Expects to only be invoked starting at given keyword"); + TokenKind ParamKind = Cu

[clang] [HLSL] Desugar ConstantArrayType when calculating cbuffer field layout (PR #134683)

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

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-07 Thread Owen Pan via cfe-commits
owenca wrote: > > I feel like there are more places where this needs to be addressed if we > > are going to add it. > > I added support in language detection for OpenCL in > [88c1174](https://github.com/llvm/llvm-project/commit/88c11747fcc8db1921dfd8f73c9330c662f7fd91). > It returns C languag

[clang-tools-extra] [clang-tidy] Use --match-full-lines instead of --strict-whitespace in check_clang_tidy (PR #133756)

2025-04-07 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank closed https://github.com/llvm/llvm-project/pull/133756 ___ 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-07 Thread Deric C. via cfe-commits
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); } _DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp) _DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp) +//===--===// +// lit builtins overloa

[clang-tools-extra] [clang-doc][NFC] refactor out file helpers (PR #134298)

2025-04-07 Thread Daniel Thornburgh via cfe-commits
@@ -0,0 +1,72 @@ +//===-- FileHelpersClangDoc.cpp - File Helpers ---*- C++-*-===// mysterymath wrote: The filename in this comment should match the actual filename. https://github.com/llvm/llvm-project/pull/134298 ___

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-07 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,78 @@ +//===- OffloadArch.cpp - list available GPUs *- 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: Apa

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

2025-04-07 Thread Finn Plummer via cfe-commits
https://github.com/inbelic edited https://github.com/llvm/llvm-project/pull/134288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 5aae0ee - [clang-tidy] give dummy path when create ClangTidyContext (#134670)

2025-04-07 Thread via cfe-commits
Author: Congcong Cai Date: 2025-04-08T10:47:39+08:00 New Revision: 5aae0ee660ffdae057d7c5c0e851b5620586d042 URL: https://github.com/llvm/llvm-project/commit/5aae0ee660ffdae057d7c5c0e851b5620586d042 DIFF: https://github.com/llvm/llvm-project/commit/5aae0ee660ffdae057d7c5c0e851b5620586d042.diff

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

2025-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 commented: Thanks for working productively. https://github.com/llvm/llvm-project/pull/134769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add `__bf16` Type Support Macros With Literal Suffix Support (PR #134214)

2025-04-07 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/134214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add ext warning for missing return in 'main' for C89 mode (PR #134617)

2025-04-07 Thread Aaron Ballman via cfe-commits
@@ -16232,7 +16232,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. - if (FD->hasImplicitReturnZero() || FD->hasAttr()) +

[clang] [clang][doc]: Merge entries with duplicate content. (PR #134089)

2025-04-07 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Ugh, the issue was on my end. I downloaded the changes, rebuilt the documentation... and skipped the step where I rebuild clang-tblgen. When I do things properly, it works (shocking, I know). https://github.com/llvm/llvm-project/pull/134089 _

[clang] [clang][doc]: Merge entries with duplicate content. (PR #134089)

2025-04-07 Thread Erich Keane via cfe-commits
erichkeane wrote: Yeah, LGTM. Thank you! https://github.com/llvm/llvm-project/pull/134089 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-07 Thread Matt Arsenault via cfe-commits
@@ -0,0 +1,78 @@ +//===- OffloadArch.cpp - list available GPUs *- 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: Apa

[clang] [llvm] [HIP][HIPSTDPAR][NFC] Re-order & adapt `hipstdpar` specific passes (PR #134753)

2025-04-07 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: Needs test https://github.com/llvm/llvm-project/pull/134753 ___ 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-07 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida updated https://github.com/llvm/llvm-project/pull/132237 >From 3aaaf3371215de0f214836da32f862518f223760 Mon Sep 17 00:00:00 2001 From: Cyndy Ishida Date: Wed, 12 Mar 2025 21:26:36 -0700 Subject: [PATCH 1/2] [clang][DependencyScanning] Track dependencies from preb

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -198,6 +198,19 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy { return create(loc, cir::BinOpKind::Div, lhs, rhs); } + + /// Create a cir.ptr_stride operation to get access to an array element. + /// idx is the index of the element to access, shouldDecay is

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -157,6 +157,15 @@ class ScalarExprEmitter : public StmtVisitor { mlir::Value VisitCastExpr(CastExpr *e); + mlir::Value VisitArraySubscriptExpr(ArraySubscriptExpr *e) { +if (e->getBase()->getType()->isVectorType()) { + assert(!cir::MissingFeatures::scalableVect

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -29,8 +29,15 @@ int f[5] = {1, 2}; void func() { int arr[10]; - // CHECK: %[[ARR:.*]] = cir.alloca !cir.array, !cir.ptr>, ["arr"] + + int e = arr[1]; andykaylor wrote: Can you add a test case for `arr[0]`? That's a special case in terms of resultin

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

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

2025-04-07 Thread Andy Kaylor via cfe-commits
@@ -232,6 +233,161 @@ LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) { llvm_unreachable("Unknown unary operator kind!"); } +/// If the specified expr is a simple decay from an array to pointer, +/// return the array subexpression. +/// FIXME: this could be

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

2025-04-07 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] [CodeGen] Change placeholder from `undef` to `poison` (PR #134731)

2025-04-07 Thread Pedro Lobo via cfe-commits
https://github.com/pedroclobo created https://github.com/llvm/llvm-project/pull/134731 Fill default values of a map with `poison` instead of `undef`. There should be no functional difference as the default values are overridden later. >From de69ee35e12babf55f6a0212200431bf75340dc4 Mon Sep 17 0

[clang] [clang][doc]: Merge entries with duplicate content. (PR #134089)

2025-04-07 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! What do you think @erichkeane? https://github.com/llvm/llvm-project/pull/134089 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-07 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/134174 >From 5d81a4b7b034dd5999feb6ab37537270d6bae2a8 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Wed, 2 Apr 2025 12:04:18 -0700 Subject: [PATCH] compare unqualified canonical types and add an hlsl array rvalue cas

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-07 Thread Sarah Spall via cfe-commits
https://github.com/spall ready_for_review https://github.com/llvm/llvm-project/pull/134174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 15750a0 - [clang-tidy] Use --match-full-lines instead of --strict-whitespace in check_clang_tidy (#133756)

2025-04-07 Thread via cfe-commits
Author: Nicolas van Kempen Date: 2025-04-07T16:34:07-04:00 New Revision: 15750a0ab2356bea9544b70a72edce421060086e URL: https://github.com/llvm/llvm-project/commit/15750a0ab2356bea9544b70a72edce421060086e DIFF: https://github.com/llvm/llvm-project/commit/15750a0ab2356bea9544b70a72edce421060086e.

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

2025-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 edited https://github.com/llvm/llvm-project/pull/134769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] give dummy path when create ClangTidyContext (PR #134670)

2025-04-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 ready_for_review https://github.com/llvm/llvm-project/pull/134670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] give dummy path when create ClangTidyContext (PR #134670)

2025-04-07 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/134670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Guard against bad -fmodule-file mappings (#132059) (PR #133462)

2025-04-07 Thread Naveen Seth Hanig via cfe-commits
https://github.com/naveen-seth updated https://github.com/llvm/llvm-project/pull/133462 >From 957a45312767a40b513bfd4f545c23fda9c4866f Mon Sep 17 00:00:00 2001 From: naveen-seth Date: Tue, 8 Apr 2025 00:56:14 + Subject: [PATCH] [clang][modules] Guard against bad -fmodule-file mappings (#13

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

2025-04-07 Thread Tom Honermann via cfe-commits
@@ -12816,6 +12816,15 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) { if (!FD->doesThisDeclarationHaveABody()) return FD->doesDeclarationForceExternallyVisibleDefinition(); +// Function definitions with the sycl_kernel_entry_point attribute are +// req

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-07 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/134713 >From e44db82f3abe7c1d23c2b49094c92a890127ffc7 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 7 Apr 2025 14:37:22 -0500 Subject: [PATCH 1/2] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-ar

[clang] [OpenMP 6.0 ]Codegen for Reduction over private variables with reduction clause (PR #134709)

2025-04-07 Thread CHANDRA GHALE via cfe-commits
https://github.com/chandraghale edited https://github.com/llvm/llvm-project/pull/134709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-07 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/134529 >From ac389b8b92fbb77c8884515d8f7293b4af17dfa5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 6 Apr 2025 18:30:42 +0800 Subject: [PATCH 1/3] [clang-format] Add 'cl' to enable OpenCL kernel file formatting

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-07 Thread Wenju He via cfe-commits
wenju-he wrote: > > > I feel like there are more places where this needs to be addressed if we > > > are going to add it. > > > > > > I added support in language detection for OpenCL in > > [88c1174](https://github.com/llvm/llvm-project/commit/88c11747fcc8db1921dfd8f73c9330c662f7fd91). > > I

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

2025-04-07 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp requested changes to this pull request. We should fix `IgnoreSingleElementAggregates` instead. https://github.com/llvm/llvm-project/pull/134774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

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

2025-04-07 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Actually, it seems to me that `IgnoreSingleElementAggregates` should already be handling this situation. If it doesn't, there's a bug there that should be fixed, instead of patching it for `std::array`? https://github.com/llvm/llvm-project/pull/134774 _

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

2025-04-07 Thread Carlos Galvez via cfe-commits
@@ -119,13 +119,18 @@ UseDesignatedInitializersCheck::UseDesignatedInitializersCheck( void UseDesignatedInitializersCheck::registerMatchers(MatchFinder *Finder) { const auto HasBaseWithFields = hasAnyBase(hasType(cxxRecordDecl(has(fieldDecl(); + + // see #133715 +

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

2025-04-07 Thread Mészáros Gergely via cfe-commits
Maetveis wrote: Rebased to fix conflict. Ping @Sirraide https://github.com/llvm/llvm-project/pull/131477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add more tests for _Countof (PR #133333)

2025-04-07 Thread Aaron Ballman via cfe-commits
@@ -121,10 +150,14 @@ void test_typedefs() { static_assert(_Countof(*x) == 12); } -void test_zero_size_arrays() { +void test_zero_size_arrays(int n) { int array[0]; // expected-warning {{zero size arrays are an extension}} static_assert(_Countof(array) == 0); static

[clang] Add more tests for _Countof (PR #133333)

2025-04-07 Thread Aaron Ballman via cfe-commits
@@ -144,3 +177,13 @@ void test_compound_literals() { static_assert(_Countof((int[2]){}) == 2); static_assert(_Countof((int[]){1, 2, 3, 4}) == 4); } + +static int test_f1(); +static int test_f2(); // expected-warning {{never defined}} AaronBallman wrote:

[clang] [Clang] Use "syncscope" instead of "synchscope". NFC. (PR #134616)

2025-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Jay Foad (jayfoad) Changes This matches the spelling of the keyword in LLVM IR. --- Full diff: https://github.com/llvm/llvm-project/pull/134616.diff 6 Files Affected: - (modified) clang/include/clang/

[clang] [Clang][ARM] Ensure FPU Features are parsed when targeting `cc1as` (PR #134612)

2025-04-07 Thread Jack Styles via cfe-commits
https://github.com/Stylie777 edited https://github.com/llvm/llvm-project/pull/134612 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [ARM] Ensure FPU Features are collected when using the Clang Assembler (PR #134366)

2025-04-07 Thread Martin Storsjö via cfe-commits
@@ -0,0 +1,8 @@ +// Ensure that we can assemble NEON by just specifying an armv7 +// Apple or Windows target. + +// REQUIRES: arm-registered-target +// RUN: %clang -c -target armv7-apple-darwin -o /dev/null %s +// RUN: %clang -c -target armv7-windows -o /dev/null %s --

[clang] [Clang] [ARM] Ensure FPU Features are collected when using the Clang Assembler (PR #134366)

2025-04-07 Thread Jack Styles via cfe-commits
@@ -0,0 +1,8 @@ +// Ensure that we can assemble NEON by just specifying an armv7 +// Apple or Windows target. + +// REQUIRES: arm-registered-target +// RUN: %clang -c -target armv7-apple-darwin -o /dev/null %s +// RUN: %clang -c -target armv7-windows -o /dev/null %s --

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

2025-04-07 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/113510 ___ 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-07 Thread Daniel Chen via cfe-commits
DanielCChen wrote: > I would generally prefer if we could avoid having driver behavior depend on > the existance of files, but the linker would also pick an existing file as > well. Agreed. The `if (static exists) - else if (shared exists)` logic in this PR is temporary until we have the comp

[clang] [clang][driver] Suppress gnu-line-marker when saving temps (PR #134621)

2025-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (macurtis-amd) Changes When passing `-save-temps` to clang, the generated preprocessed output uses gnu line markers. This unexpectedly triggers gnu-line-marker warnings when used with `-Weverything` or `-pedantic`. Even worse, compil

[clang] [Clang][ARM] Ensure FPU Features are parsed when targeting `cc1as` (PR #134612)

2025-04-07 Thread David Spickett via cfe-commits
@@ -679,20 +679,17 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D, CPUArgFPUKind != llvm::ARM::FK_INVALID ? CPUArgFPUKind : ArchArgFPUKind; (void)llvm::ARM::getFPUFeatures(FPUKind, Features); } else { -bool Generic = true; -if (!ForAS) {

[clang] [Clang] add ext warning for missing return in 'main' for C89 mode (PR #134617)

2025-04-07 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/134617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] add ext warning for missing return in 'main' for C89 mode (PR #134617)

2025-04-07 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,6 @@ +/* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -pedantic -Wno-strict-prototypes %s AaronBallman wrote: Can you also add RUN lines for: `-Wmain-return-type` (enables diagnostic), `-pedantic -Wno-main-return-type` (disables diagnostic), and ``

[clang] [clang][CodeComplete] Use HeuristicResolver in getAsRecordDecl() (PR #130473)

2025-04-07 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 approved this pull request. https://github.com/llvm/llvm-project/pull/130473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix RecursiveASTVisitor traversal from type to decl (PR #132551)

2025-04-07 Thread Andrey Ali Khan Bolshakov via cfe-commits
bolshakov-a wrote: Thanks, it becomes now clearer for me. However, I'm still not succeeded in making this code really working, because the default version of `TraverseDecltypeType` doesn't traverse the underlying desugared type: https://github.com/llvm/llvm-project/blob/be6ccc98f38227db02164f17

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

2025-04-07 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl 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] [C23] Implement WG14 N3037 (PR #132939)

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

[clang] [C23] Implement WG14 N3037 (PR #132939)

2025-04-07 Thread Erich Keane via cfe-commits
@@ -450,6 +453,41 @@ class StmtComparer { }; } // namespace +static bool +CheckStructurallyEquivalentAttributes(StructuralEquivalenceContext &Context, + const Decl *D1, const Decl *D2, + const Decl *Prim

[clang] [Clang] add ext warning for missing return in 'main' for C89 mode (PR #134617)

2025-04-07 Thread Oleksandr T. via cfe-commits
@@ -16232,7 +16232,9 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If the function implicitly returns zero (like 'main') or is naked, // don't complain about missing return statements. - if (FD->hasImplicitReturnZero() || FD->hasAttr()) +

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

2025-04-07 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/134628 >From 150ff13e9336aaeffa38804037ac99ea8ba71e3e 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] Ensure FPU Features are parsed when targeting `cc1as` (PR #134612)

2025-04-07 Thread Jack Styles via cfe-commits
https://github.com/Stylie777 created https://github.com/llvm/llvm-project/pull/134612 Previously, `cc1as` did not consider the Features that can be included from a target's FPU. This could lead to a situation where assembly files could not compile as cc1as did not know if a feature was support

[clang] Ensure FPU Features are parsed when targeting `cc1as` (PR #134612)

2025-04-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-arm Author: Jack Styles (Stylie777) Changes Previously, `cc1as` did not consider the Features that can be included from a target's FPU. This could lead to a situation where assembly files could not compile as cc1as did not know if a feature was

[clang] [Clang] [ARM] Ensure FPU Features are collected when using the Clang Assembler (PR #134366)

2025-04-07 Thread Jack Styles via cfe-commits
Stylie777 wrote: I have created https://github.com/llvm/llvm-project/pull/134612 so I will now close this PR. @DavidSpickett your comments for the Release Notes have been worked on in the new PR. https://github.com/llvm/llvm-project/pull/134366 ___

  1   2   3   4   >