[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread Baranov Victor via cfe-commits
@@ -39,6 +39,30 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +bool isWithinImplicitTemplateInstantiation(const TypeLoc *MatchedTypeLoc, vbvictor wrote: Could you please elaborate what is this function for? I deleted

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread Baranov Victor via cfe-commits
@@ -39,6 +39,30 @@ AST_MATCHER(clang::ParmVarDecl, isArgvOfMain) { return FD ? FD->isMain() : false; } +bool isWithinImplicitTemplateInstantiation(const TypeLoc *MatchedTypeLoc, vbvictor wrote: Also, if this function is still needed, we should move it to ma

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread Baranov Victor via cfe-commits
https://github.com/vbvictor edited https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-doc] Add start and end line numbers (PR #137732)

2025-04-28 Thread Petr Hosek via cfe-commits
@@ -795,43 +787,52 @@ emitInfo(const CXXMethodDecl *D, const FullComment *FC, int LineNumber, } std::pair, std::unique_ptr> -emitInfo(const TypedefDecl *D, const FullComment *FC, int LineNumber, - StringRef File, bool IsFileInRootDir, bool PublicOnly) { - TypedefInfo

[clang-tools-extra] [clang-doc] Add start and end line numbers (PR #137732)

2025-04-28 Thread Petr Hosek via cfe-commits
https://github.com/petrhosek approved this pull request. https://github.com/llvm/llvm-project/pull/137732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] default clause replaced by otherwise clause for metadirective in OpenMP 5.2 (PR #128640)

2025-04-28 Thread Alexey Bataev via cfe-commits
@@ -2,21 +2,50 @@ // RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -verify -fopenmp-simd -x c++ -std=c++14 -fexceptions -fcxx-exceptions %s +// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -verify=expected,omp52 -fopenmp -fopenmp-version=52 -ferror-limit 100 -o - %s -Wuninitia

[clang] default clause replaced by otherwise clause for metadirective in OpenMP 5.2 (PR #128640)

2025-04-28 Thread Alexey Bataev via cfe-commits
@@ -1660,6 +1660,10 @@ def err_omp_expected_colon : Error<"missing ':' in %0">; def err_omp_missing_comma : Error< "missing ',' after %0">; def err_omp_expected_context_selector : Error<"expected valid context selector in %0">; +def err_omp_unknown_clause +: Error<"expe

[clang] default clause replaced by otherwise clause for metadirective in OpenMP 5.2 (PR #128640)

2025-04-28 Thread Alexey Bataev via cfe-commits
@@ -0,0 +1,198 @@ +// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s alexey-bataev wrote: Add serialization/deserialization tests https://github.com/llvm/llvm-project/pull/128640 __

[clang] default clause replaced by otherwise clause for metadirective in OpenMP 5.2 (PR #128640)

2025-04-28 Thread Alexey Bataev via cfe-commits
@@ -117,9 +45,66 @@ void func3() { // CHECK-NEXT:[[TMP1:%.*]] = load i32, ptr [[I]], align 4 // CHECK-NEXT:[[INC:%.*]] = add nsw i32 [[TMP1]], 1 // CHECK-NEXT:store i32 [[INC]], ptr [[I]], align 4 -// CHECK-NEXT:br label [[FOR_COND:%.*]] +// CHECK-NEXT:br la

[clang] default clause replaced by otherwise clause for metadirective in OpenMP 5.2 (PR #128640)

2025-04-28 Thread Alexey Bataev via cfe-commits
@@ -1,105 +1,33 @@ -// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s -// expected-no-diagnostics - +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=52 -DOMP52 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCh

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-28 Thread Finn Plummer via cfe-commits
https://github.com/inbelic created https://github.com/llvm/llvm-project/pull/137690 - Defines a new declaration node `HLSLRootSignature` in `DeclNodes.td` that will hold a reference to an in-memory construction of the root signature, namely an array of `hlsl::rootsig::RootElement`s - Defines

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-28 Thread Sam Elliott via cfe-commits
lenary wrote: Sorry! I will look at it today. I'll push an xfail in the meantime, to get it green again. https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] f9ee5ce - [clang][SPIR-V] Fix OpenCL addrspace mapping when using non-zero default AS (#137187)

2025-04-28 Thread via cfe-commits
Author: Nick Sarnie Date: 2025-04-28T19:26:01Z New Revision: f9ee5ce605f94d905d3112fd0923a5fd23e48dd3 URL: https://github.com/llvm/llvm-project/commit/f9ee5ce605f94d905d3112fd0923a5fd23e48dd3 DIFF: https://github.com/llvm/llvm-project/commit/f9ee5ce605f94d905d3112fd0923a5fd23e48dd3.diff LOG: [

[clang] [clang][SPIR-V] Fix OpenCL addrspace mapping when using non-zero default AS (PR #137187)

2025-04-28 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/137187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Retain type information for Unused enum (PR #137682)

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

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

2025-04-28 Thread Filip Milosevic via cfe-commits
@@ -4471,6 +4471,14 @@ struct FormatStyle { /// \version 4 bool SpaceAfterTemplateKeyword; + /// If \c true, a space will be inserted after the ``operator`` keyword. + /// \code + ///true:false: + ///bool operator == (int a)

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

2025-04-28 Thread Filip Milosevic via cfe-commits
@@ -17630,6 +17630,13 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("int x = int (y);", SomeSpace2); verifyFormat("auto lambda = []() { return 0; };", SomeSpace2); + FormatStyle SpaceAfterOperatorKeyword = getLLVMStyle(); + SpaceAfterOperatorKeyword

[clang] [clang] Remove FEM_Indeterminable (PR #137661)

2025-04-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Ah, slot FLT_EVAL_METHOD is used in source as well, in that case I think the fix is to make signed options an option (pun intended) https://github.com/llvm/llvm-project/pull/137661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-28 Thread via cfe-commits
YexuanXiao wrote: > Hey, chiming in here since I've been silently following this thread and I > think you've been doing great. The conversation might seem intimidating but > once we converge on an approach, the code change should be straightforward. > Don't question your own capabilities. I

[clang] [HLSL] Treat classes and structs as packed by default (PR #137391)

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

[clang] [clang] Remove FEM_Indeterminable (PR #137661)

2025-04-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: although, what happens currently? Per the warning we should be producing the wrong value if there's a direct enum value to code visible value mapping https://github.com/llvm/llvm-project/pull/137661 ___ cfe-commits mailing list cfe-commi

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-28 Thread Andy Kaylor via cfe-commits
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface emitCallLikeOp(CIRGenFunction &cgf, assert(builder.getInsertionBlock() && "expected valid basic block"); assert(!cir::MissingFeatures::opCallIndirect()); - return builder.createCallOp(callLoc, directFuncOp); + return b

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-28 Thread Sam Elliott via cfe-commits
lenary wrote: I pushed an xfail as `31bd7a507152` and will look into the failures now. https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Retain type information for nested unused enum (PR #137682)

2025-04-28 Thread via cfe-commits
https://github.com/ykhatav updated https://github.com/llvm/llvm-project/pull/137682 >From 0647828990d9ec89554c016e4e016f28b9a2931d Mon Sep 17 00:00:00 2001 From: "Khatavkar, Yashasvi" Date: Mon, 28 Apr 2025 10:53:53 -0700 Subject: [PATCH 1/4] Retain unused nested enum type information --- cla

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Jon Chesterfield via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tahiti -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu bonaire -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu carrizo -S -verify

[clang] e12ff33 - [CIR] Standardize element type name between Array and Vector Types (#137465)

2025-04-28 Thread via cfe-commits
Author: Amr Hesham Date: 2025-04-28T22:50:48+02:00 New Revision: e12ff331f14c766904c930054bcc94527f220212 URL: https://github.com/llvm/llvm-project/commit/e12ff331f14c766904c930054bcc94527f220212 DIFF: https://github.com/llvm/llvm-project/commit/e12ff331f14c766904c930054bcc94527f220212.diff LO

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tahiti -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu bonaire -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu carrizo -S -verify

[clang] [CIR] Standardize element type name between Array and Vector Types (PR #137465)

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

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137234 >From 56a3f3cd282e9bd5ef9014e4125380e0d9685121 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 24 Apr 2025 14:17:42 -0400 Subject: [PATCH 01/14] [C] Diagnose use of C++ keywords in C This adds a ne

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
@@ -6107,6 +6109,43 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +constexpr unsigned countCPlusPlusKeywords() { + unsigned Ret = 0; +#define MODULES_KEYWORD(NAME) +#define KEYWORD(NAME, FLAGS) ++Ret; +

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread kadir çetinkaya via cfe-commits
@@ -9125,9 +9126,25 @@ bool LValueExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) { assert((!Info.getLangOpts().CPlusPlus || E->isFileScope()) && "lvalue compound literal in c++?"); - // Defer visiting the literal until the lvalue-to-rvalue con

[clang] [Clang][NFC] Const correctness fix for range based for loop (PR #137431)

2025-04-28 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik closed https://github.com/llvm/llvm-project/pull/137431 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] a6f4a54 - [Clang][NFC] Const correctness fix for range based for loop (#137431)

2025-04-28 Thread via cfe-commits
Author: Shafik Yaghmour Date: 2025-04-28T08:27:19-07:00 New Revision: a6f4a54891979c7c6d3c9e01598827da8b413f4f URL: https://github.com/llvm/llvm-project/commit/a6f4a54891979c7c6d3c9e01598827da8b413f4f DIFF: https://github.com/llvm/llvm-project/commit/a6f4a54891979c7c6d3c9e01598827da8b413f4f.dif

[clang] [clang][bytecode] Check live-ness when calling dtors (PR #137645)

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

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-04-28 Thread Younan Zhang via cfe-commits
@@ -4368,15 +4385,63 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, // Produce a placeholder value if the specialization is dependent. if (Template->getDeclContext()->isDependentContext() || TemplateSpecializationType::anyDependent

[clang] [Clang] Consider preferred_type in bitfield warnings (#116760) (PR #116785)

2025-04-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: Warning fix is tracked by https://github.com/llvm/llvm-project/pull/137661 https://github.com/llvm/llvm-project/pull/116785 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang-tools-extra] [clangd] Add CodePatterns config option under Completion (PR #137613)

2025-04-28 Thread via cfe-commits
https://github.com/Noustaa updated https://github.com/llvm/llvm-project/pull/137613 >From 57cee19260072db6bbabb1cf7d52cf6da6c3 Mon Sep 17 00:00:00 2001 From: Noustaa Date: Mon, 28 Apr 2025 12:38:36 +0200 Subject: [PATCH] [clangd] Add CodePatterns config option under Completion Allows enabl

[clang] [CIR] Upstream global initialization for VectorType (PR #137511)

2025-04-28 Thread Andy Kaylor via cfe-commits
@@ -299,6 +299,94 @@ void ConstArrayAttr::print(AsmPrinter &printer) const { printer << ">"; } +//===--===// +// CIR ConstVectorAttr +//===

[clang] [CIR] Upstream global initialization for VectorType (PR #137511)

2025-04-28 Thread Andy Kaylor via cfe-commits
@@ -373,8 +373,27 @@ mlir::Attribute ConstantEmitter::tryEmitPrivate(const APValue &value, elements, typedFiller); } case APValue::Vector: { -cgm.errorNYI("ConstExprEmitter::tryEmitPrivate vector"); -return {}; +const QualType eleme

[clang] [CIR] Upstream global initialization for VectorType (PR #137511)

2025-04-28 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good to me once the parsing test is added. https://github.com/llvm/llvm-project/pull/137511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [CIR] Upstream global initialization for VectorType (PR #137511)

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

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-28 Thread Yuxuan Chen via cfe-commits
yuxuanchen1997 wrote: > The anticipated implementation from the discussion is beyond my capabilities. Hey, chiming in here since I've been silently following this thread and I think you've been doing great. The conversation might seem intimidating but once we converge on an approach, the code

[clang] [llvm] [mlir] [OMPIRBuilder] Don't discard the debug record from entry block. (PR #135161)

2025-04-28 Thread Abid Qadeer via cfe-commits
abidh wrote: We can test this functionality now as https://github.com/llvm/llvm-project/pull/136016 has been merged. I have added a test and updated relevant clang tests. https://github.com/llvm/llvm-project/pull/135161 ___ cfe-commits mailing list

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [clang] Add `__ptrauth_restricted_intptr` qualifier (PR #137580)

2025-04-28 Thread Oliver Hunt via cfe-commits
ojhunt wrote: > Perhaps silly initial question: why do we need a whole different qualifier > for this? Why can you not write `__ptrauth uintptr_t foo`? Not a silly question, back when first implemented we spent time thinking about this. The concern was basically `T* __ptrauth(...)` can repres

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-28 Thread Tom Eccles via cfe-commits
tblah wrote: The test failures look unrelated to my patch. https://github.com/llvm/llvm-project/pull/137193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

2025-04-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137668 This PR makes it so that `CompilerInvocation` needs to be provided to `CompilerInstance` on construction. There are a couple of benefits in my view: * Making it impossible to mis-use some `CompilerInstance`

[clang] [HLSL] Allow non `.hlsl` files as source files (PR #137378)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes This PR makes it so that `CompilerInvocation` needs to be provided to `CompilerInstance` on construction. There are a couple of benefits in my view: * Making it impossible to mis-use some `CompilerInstanc

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd Author: Jan Svoboda (jansvoboda11) Changes This PR makes it so that `CompilerInvocation` needs to be provided to `CompilerInstance` on construction. There are a couple of benefits in my view: * Making it impossible to mis-use some `CompilerInstan

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Jan Svoboda (jansvoboda11) Changes This PR makes it so that `CompilerInvocation` needs to be provided to `CompilerInstance` on construction. There are a couple of benefits in my view: * Making it impossible to mis-use some `Com

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/7] add md node type filter, and test --- .../test/CodeGenHL

[clang] [clang-tools-extra] [lldb] [clang][frontend] Require invocation to construct `CompilerInstance` (PR #137668)

2025-04-28 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- clang-tools-extra/clang-include-fixer/IncludeFixer.

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/137234 >From 56a3f3cd282e9bd5ef9014e4125380e0d9685121 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 24 Apr 2025 14:17:42 -0400 Subject: [PATCH 01/13] [C] Diagnose use of C++ keywords in C This adds a ne

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-28 Thread Ricardo Jesus via cfe-commits
@@ -554,6 +554,22 @@ class VectorType : public Type { return VectorType::get(VTy->getElementType(), EltCnt * 2); } + /// This static method returns a VectorType with the same size-in-bits as + /// SizeTy but with an element type that matches the scalar type of EltTy. +

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-28 Thread Ricardo Jesus via cfe-commits
@@ -1168,6 +1168,15 @@ bool Function::nullPointerIsDefined() const { return hasFnAttribute(Attribute::NullPointerIsValid); } +unsigned Function::getVScaleValue() const { + Attribute Attr = getFnAttribute(Attribute::VScaleRange); + if (!Attr.isValid()) +return 0; + + u

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-28 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus commented: This looks good as far as I can see, but I don't feel qualified to approve it. FWIW it fixes a large regression on GROMACS with LLVM 20. https://github.com/llvm/llvm-project/pull/130973 ___ cfe-commits mailing lis

[clang] [llvm] [LLVM][SROA] Teach SROA how to "bitcast" between fixed and scalable vectors. (PR #130973)

2025-04-28 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/130973 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Shilei Tian via cfe-commits
shiltian wrote: Isn't it similar to what @krzysz00 is doing in another PR to some extent? https://github.com/llvm/llvm-project/pull/137678 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [HLSL] Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in own files (PR #137004)

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

[clang] [clang] Make the `AnalyzerOptions` reference count non-intrusive (PR #137680)

2025-04-28 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/137680 This PR makes `CompilerInvocation` the sole owner of the `AnalyzerOptions` instance. Clients can no longer become co-owners by doing something like this: ```c++ void shareOwnership(CompilerInvocation &CI)

[clang] [clang] Make the `AnalyzerOptions` reference count non-intrusive (PR #137680)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Jan Svoboda (jansvoboda11) Changes This PR makes `CompilerInvocation` the sole owner of the `AnalyzerOptions` instance. Clients can no longer become co-owners by doing something like this: ```c++ void shareOwnership(Comp

[clang] [clang] Make the `AnalyzerOptions` reference count non-intrusive (PR #137680)

2025-04-28 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jan Svoboda (jansvoboda11) Changes This PR makes `CompilerInvocation` the sole owner of the `AnalyzerOptions` instance. Clients can no longer become co-owners by doing something like this: ```c++ void shareOwnership(CompilerInvocation &CI

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-04-28 Thread Krzysztof Drewniak via cfe-commits
https://github.com/krzysz00 updated https://github.com/llvm/llvm-project/pull/137425 >From 96e94b5662c613fd80f712080751076254a73524 Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak Date: Sat, 26 Apr 2025 00:20:22 + Subject: [PATCH 1/2] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic This

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-28 Thread Andy Kaylor via cfe-commits
@@ -17,3 +17,15 @@ int f4() { // CHECK-LABEL: cir.func @f4() -> !s32i // CHECK: %[[#x:]] = cir.call @f3() : () -> !s32i // CHECK-NEXT:cir.store %[[#x]], %{{.+}} : !s32i, !cir.ptr + +int f5(int a, int *b, bool c); +int f6() { + int b = 1; + return f5(2, &b, false);

[clang] [llvm] [mlir] [AMDGPU] Add a new amdgcn.load.to.lds intrinsic (PR #137425)

2025-04-28 Thread Krzysztof Drewniak via cfe-commits
@@ -257,6 +257,7 @@ TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fadd_v2bf16, "V2sV2s*0V2s", "t", "at TARGET_BUILTIN(__builtin_amdgcn_global_atomic_fadd_v2bf16, "V2sV2s*1V2s", "t", "atomic-global-pk-add-bf16-inst") TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_fadd_v2bf16, "V2sV2s*

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Krzysztof Drewniak via cfe-commits
krzysz00 wrote: Semantically, seems fine, but I can't review meaningfully on the clang side https://github.com/llvm/llvm-project/pull/137678 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

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

2025-04-28 Thread via cfe-commits
Author: David Rivera Date: 2025-04-28T20:12:38+02:00 New Revision: 45411ac8953e61513bfe7767dc0fb34356f1fc33 URL: https://github.com/llvm/llvm-project/commit/45411ac8953e61513bfe7767dc0fb34356f1fc33 DIFF: https://github.com/llvm/llvm-project/commit/45411ac8953e61513bfe7767dc0fb34356f1fc33.diff

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

2025-04-28 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed 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] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
@@ -6107,6 +6109,43 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +constexpr unsigned countCPlusPlusKeywords() { + unsigned Ret = 0; +#define MODULES_KEYWORD(NAME) +#define KEYWORD(NAME, FLAGS) ++Ret; +

[clang] [driver] return immediately in `addArchSpecificRPath` and `getArchSpecificLibPaths` on AIX (PR #134520)

2025-04-28 Thread David Tenty via cfe-commits
https://github.com/daltenty approved this pull request. Change LGTM, but this really ought to have a test (or affect some existing test somehow) https://github.com/llvm/llvm-project/pull/134520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

2025-04-28 Thread Shilei Tian via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu tahiti -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu bonaire -S -verify -o - %s +// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu carrizo -S -verify

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
@@ -6107,6 +6109,43 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +constexpr unsigned countCPlusPlusKeywords() { + unsigned Ret = 0; +#define MODULES_KEYWORD(NAME) +#define KEYWORD(NAME, FLAGS) ++Ret; +

[clang] [driver] return immediately in `addArchSpecificRPath` and `getArchSpecificLibPaths` on AIX (PR #134520)

2025-04-28 Thread David Tenty via cfe-commits
@@ -1252,6 +1252,9 @@ void tools::addArchSpecificRPath(const ToolChain &TC, const ArgList &Args, options::OPT_fno_rtlib_add_rpath, false)) return; + if (TC.getTriple().isOSAIX()) // AIX doesn't support -rpath option. daltenty wrote:

[clang] [CIR] Upstream initial support for switch statements (PR #137106)

2025-04-28 Thread via cfe-commits
https://github.com/Andres-Salamanca updated https://github.com/llvm/llvm-project/pull/137106 >From f1f56e16d524783c69016867fcdf474ac3e4e09f Mon Sep 17 00:00:00 2001 From: Andres Salamanca Date: Tue, 22 Apr 2025 15:16:19 -0500 Subject: [PATCH 1/8] Add initial CIR support for switch operation --

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Aaron Ballman via cfe-commits
@@ -6107,6 +6109,43 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +constexpr unsigned countCPlusPlusKeywords() { + unsigned Ret = 0; +#define MODULES_KEYWORD(NAME) +#define KEYWORD(NAME, FLAGS) ++Ret; +

[clang] [NFC][analyzer] Document configuration options (PR #135169)

2025-04-28 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat updated https://github.com/llvm/llvm-project/pull/135169 From 705372a8a2f6e87f5fdf6b0e99bfa6a13408c5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Don=C3=A1t=20Nagy?= Date: Thu, 3 Apr 2025 20:13:04 +0200 Subject: [PATCH 1/4] [NFC][analyzer] Document configuration optio

[clang] [llvm] Unused enum type (PR #137682)

2025-04-28 Thread via cfe-commits
https://github.com/ykhatav created https://github.com/llvm/llvm-project/pull/137682 None >From 0647828990d9ec89554c016e4e016f28b9a2931d Mon Sep 17 00:00:00 2001 From: "Khatavkar, Yashasvi" Date: Mon, 28 Apr 2025 10:53:53 -0700 Subject: [PATCH 1/3] Retain unused nested enum type information --

[clang] [driver] return immediately in `addArchSpecificRPath` and `getArchSpecificLibPaths` on AIX (PR #134520)

2025-04-28 Thread Daniel Chen via cfe-commits
@@ -1252,6 +1252,9 @@ void tools::addArchSpecificRPath(const ToolChain &TC, const ArgList &Args, options::OPT_fno_rtlib_add_rpath, false)) return; + if (TC.getTriple().isOSAIX()) // AIX doesn't support -rpath option. DanielCChen wrote

[clang] [driver] return immediately in `addArchSpecificRPath` and `getArchSpecificLibPaths` on AIX (PR #134520)

2025-04-28 Thread Daniel Chen via cfe-commits
DanielCChen wrote: > Change LGTM, but this really ought to have a test (or affect some existing > test somehow) Agreed. Will add a test. https://github.com/llvm/llvm-project/pull/134520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread Eli Friedman via cfe-commits
@@ -4522,6 +4523,38 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, BaseVal = MTE->getOrCreateValue(false); assert(BaseVal && "got reference to unevaluated temporary"); + } else if (const CompoundLiteralExpr *CLE = +

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-28 Thread Finn Plummer via cfe-commits
https://github.com/inbelic updated https://github.com/llvm/llvm-project/pull/137690 >From 0ab73ae597164aa039be69534056edbe26e55243 Mon Sep 17 00:00:00 2001 From: Finn Plummer Date: Mon, 28 Apr 2025 18:42:10 + Subject: [PATCH 1/2] [HLSL][RootSignature] Define and integrate rootsig clang att

[clang] [clang][CompundLiteralExpr] Don't defer evaluation for CLEs (PR #137163)

2025-04-28 Thread Eli Friedman via cfe-commits
@@ -9125,9 +9126,25 @@ bool LValueExprEvaluator::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) { assert((!Info.getLangOpts().CPlusPlus || E->isFileScope()) && "lvalue compound literal in c++?"); - // Defer visiting the literal until the lvalue-to-rvalue con

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-28 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- clang/include/clang/AST/Decl.h clang/include/clang/

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread St. Muench via cfe-commits
https://github.com/stmuench updated https://github.com/llvm/llvm-project/pull/132924 >From 7f621bc7e169cf34d95ba34b0895c9fa75adb712 Mon Sep 17 00:00:00 2001 From: stmuench Date: Tue, 25 Mar 2025 12:38:53 +0100 Subject: [PATCH] [clang-tidy] do not diagn. array types in implicit templ. instantia

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread St. Muench via cfe-commits
@@ -92,3 +92,162 @@ const char name[] = "Some string"; void takeCharArray(const char name[]); // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: do not declare C-style arrays, use 'std::array' or 'std::vector' instead [modernize-avoid-c-arrays] + +namespace std { + template + str

[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

2025-04-28 Thread St. Muench via cfe-commits
stmuench wrote: @PiotrZSL if it suits your convenience, could you maybe have a look at this PR? Many thanks in advance. https://github.com/llvm/llvm-project/pull/132924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] clang-format: Add -disable-format option (PR #137617)

2025-04-28 Thread Björn Schäpers via cfe-commits
@@ -506,8 +512,11 @@ static bool format(StringRef FileName, bool ErrorOnIncompleteFormat = false) { // Get new affected ranges after sorting `#includes`. Ranges = tooling::calculateRangesAfterReplacements(Replaces, Ranges); FormattingAttemptStatus Status; - Replacements

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

2025-04-28 Thread Björn Schäpers via cfe-commits
@@ -17630,6 +17630,13 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) { verifyFormat("int x = int (y);", SomeSpace2); verifyFormat("auto lambda = []() { return 0; };", SomeSpace2); + FormatStyle SpaceAfterOperatorKeyword = getLLVMStyle(); + SpaceAfterOperatorKeyword

[clang] [clang-format] Add SpaceAfterOperatorKeyword option (PR #137610)

2025-04-28 Thread Björn Schäpers via cfe-commits
@@ -4471,6 +4471,14 @@ struct FormatStyle { /// \version 4 bool SpaceAfterTemplateKeyword; + /// If \c true, a space will be inserted after the ``operator`` keyword. + /// \code + ///true:false: + ///bool operator == (int a)

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-28 Thread Björn Schäpers via cfe-commits
@@ -83,8 +83,42 @@ FormatTokenLexer::FormatTokenLexer( ArrayRef FormatTokenLexer::lex() { assert(Tokens.empty()); assert(FirstInLineIndex == 0); + const llvm::Regex FormatOffRegex(Style.OneLineFormatOffRegex); + enum { FO_None, FO_CurrentLine, FO_NextLine } FormatOff = FO

[clang] [clang-format] Add OneLineFormatOffRegex option (PR #137577)

2025-04-28 Thread Björn Schäpers via cfe-commits
@@ -24954,6 +24954,82 @@ TEST_F(FormatTest, DisableRegions) { "// clang-format on"); } +TEST_F(FormatTest, OneLineFormatOffRegex) { + auto Style = getLLVMStyle(); + Style.OneLineFormatOffRegex = "// format off$"; + + verifyFormat("// format off\n" +

[clang] [C] Diagnose use of C++ keywords in C (PR #137234)

2025-04-28 Thread Eli Friedman via cfe-commits
@@ -6107,6 +6109,43 @@ static bool isFromSystemHeader(SourceManager &SM, const Decl *D) { SM.isInSystemMacro(D->getLocation()); } +constexpr unsigned countCPlusPlusKeywords() { + unsigned Ret = 0; +#define MODULES_KEYWORD(NAME) +#define KEYWORD(NAME, FLAGS) ++Ret; +

[clang] clang-format: Add -disable-format option (PR #137617)

2025-04-28 Thread Daan De Meyer via cfe-commits
https://github.com/DaanDeMeyer updated https://github.com/llvm/llvm-project/pull/137617 >From ab0fe63baf2044a4768835c359f7068dfba7d81d Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 28 Apr 2025 13:07:50 +0200 Subject: [PATCH] clang-format: Add -disable-format option When https://githu

[clang] [clang][headers][Apple] Don't include_next float.h to avoid an unnecessary module dependency (PR #137432)

2025-04-28 Thread Cyndy Ishida via cfe-commits
https://github.com/cyndyishida approved this pull request. AFAICT this seems like a good cleanup for detangling sdk dependencies where its safe to. https://github.com/llvm/llvm-project/pull/137432 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] [llvm] Retain type information for nested unused enum (PR #137682)

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

[clang] [llvm] Retain type information for nested unused enum (PR #137682)

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

[clang] [NFC][analyzer] Document configuration options (PR #135169)

2025-04-28 Thread Donát Nagy via cfe-commits
NagyDonat wrote: @steakhal I implemented most of your review suggestions (the only missing thing is that I'll set up a test to validate that this script can parse `AnalyzerOptions.def`). Please check the wording of the disclaimers added by https://github.com/llvm/llvm-project/pull/135169/comm

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -189,6 +201,9 @@ class DXILPrepareModule : public ModulePass { for (auto &BB : F) { IRBuilder<> Builder(&BB); for (auto &I : make_early_inc_range(BB)) { + + I.dropUnknownNonDebugMetadata(DXILCompatibleMDs); + if (I.getOpcode() == Ins

[clang] [clang] Remove FEM_Indeterminable (PR #137661)

2025-04-28 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > @zahiraam @AaronBallman a different option would be to add a signed vs > > unsigned storage option to the `OPTION` and `BENIGN_ENUM_LANGOPT` macros so > > we can store negative enumerations safely > > I think I would prefer this solution. We need to be able to set the

<    1   2   3   4   5   6   >