[clang] [Clang][CMake] respect LLVMConfig.cmake's LLVM_DEFINITIONS (PR #138587)

2025-05-06 Thread via cfe-commits
jeremyd2019 wrote: Also, should all of those projects be updated in one pull request, or do I need to open a half-dozen more? https://github.com/llvm/llvm-project/pull/138587 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[clang] [Clang][CMake] use CMakePushCheckState (PR #138783)

2025-05-06 Thread via cfe-commits
jeremyd2019 wrote: split from #138587 - requesting review from @petrhosek https://github.com/llvm/llvm-project/pull/138783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CMake] use CMakePushCheckState (PR #138783)

2025-05-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (jeremyd2019) Changes The previous approach of using list(REMOVE ...) would remove *all* occurences of the given item, not just the one appended above. --- Full diff: https://github.com/llvm/llvm-project/pull/138783.diff 1 Files Af

[clang-tools-extra] [clang-tools-extra] Remove redundant calls to std::unique_ptr::get (NFC) (PR #138774)

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

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -3332,6 +3388,39 @@ checkBuiltinTemplateIdType(Sema &SemaRef, BuiltinTemplateDecl *BTD, } return HasNoTypeMember; } + + case BTK__hlsl_spirv_type: { +assert(Converted.size() == 4); + +if (!Context.getTargetInfo().getTriple().isSPIRV()) { + SemaRef.Di

[clang] [clang-tools-extra] [lldb] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-05-06 Thread Michael Spencer via cfe-commits
https://github.com/Bigcheese closed https://github.com/llvm/llvm-project/pull/132853 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] 32fb8c5 - [clang][modules] Lazily load by name lookups in module maps (#132853)

2025-05-06 Thread via cfe-commits
Author: Michael Spencer Date: 2025-05-06T16:40:01-07:00 New Revision: 32fb8c5f5fdeb20de28846e2fe9e2c7525f62086 URL: https://github.com/llvm/llvm-project/commit/32fb8c5f5fdeb20de28846e2fe9e2c7525f62086 DIFF: https://github.com/llvm/llvm-project/commit/32fb8c5f5fdeb20de28846e2fe9e2c7525f62086.dif

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -0,0 +1,68 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ +// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \ +// RUN: -o - | FileCheck %s + +template +using Array = vk::SpirvOpaqueType>; + +template +using ArrayBuffer = Array, Size

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ +// RUN: dxil-pc-shadermodel6.0-compute %s \ +// RUN: -fsyntax-only -verify + +typedef vk::SpirvType<12, 2, 4, float> InvalidType1; // expected-error {{use of undeclared identifier 'vk'}} +vk::Li

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
cassiebeckley wrote: Done. https://github.com/llvm/llvm-project/pull/134034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
cassiebeckley wrote: Done. https://github.com/llvm/llvm-project/pull/134034 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ +// RUN: dxil-pc-shadermodel6.0-compute %s \ +// RUN: -fsyntax-only -verify + +typedef vk::SpirvType<12, 2, 4, float> InvalidType1; // expected-error {{use of undeclared identifier 'vk'}} +vk::Li

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -369,14 +369,102 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getOpenCLType(CodeGenModule &CGM, return nullptr; } +// Gets a spirv.IntegralConstant or spirv.Literal. If IntegralType is present, +// returns an IntegralConstant, otherwise returns a Literal. +static llvm::Ty

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -369,14 +369,102 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getOpenCLType(CodeGenModule &CGM, return nullptr; } +// Gets a spirv.IntegralConstant or spirv.Literal. If IntegralType is present, +// returns an IntegralConstant, otherwise returns a Literal. +static llvm::Ty

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -1832,6 +1832,48 @@ ExpectedType clang::ASTNodeImporter::VisitHLSLAttributedResourceType( ToWrappedType, ToContainedType, ToAttrs); } +ExpectedType clang::ASTNodeImporter::VisitHLSLInlineSpirvType( +const clang::HLSLInlineSpirvType *T) { + Error Err = Error::suc

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -877,6 +878,11 @@ bool CodeGenTypes::isZeroInitializable(QualType T) { if (const MemberPointerType *MPT = T->getAs()) return getCXXABI().isZeroInitializable(MPT); + // HLSL Inline SPIR-V types are non-zero-initializable. + if (T->getAs()) { +return false; + } -

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -5444,6 +5459,31 @@ QualType ASTContext::getHLSLAttributedResourceType( return QualType(Ty, 0); } + +QualType ASTContext::getHLSLInlineSpirvType(uint32_t Opcode, uint32_t Size, +uint32_t Alignment, +

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -11763,6 +11804,22 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer, return LHS; return {}; } + case Type::HLSLInlineSpirv: +const HLSLInlineSpirvType *LHSTy = LHS->castAs(); +const HLSLInlineSpirvType *RHSTy = RHS->cas

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -3228,6 +3228,62 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static bool isInVkNamespace(const RecordType *RT) { + DeclContext *DC = RT->getDecl()->getDeclContext(); + if (!DC) +return false; + + NamespaceDecl *ND = dyn_cast(D

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -3228,6 +3228,62 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static bool isInVkNamespace(const RecordType *RT) { + DeclContext *DC = RT->getDecl()->getDeclContext(); + if (!DC) +return false; + + NamespaceDecl *ND = dyn_cast(D

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -0,0 +1,28 @@ +//===- hlsl_spirv.h - HLSL definitions for SPIR-V target --===// +// +// 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] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -6165,6 +6254,18 @@ bool UnnamedLocalNoLinkageFinder::VisitHLSLAttributedResourceType( return Visit(T->getWrappedType()); } +bool UnnamedLocalNoLinkageFinder::VisitHLSLInlineSpirvType( +const HLSLInlineSpirvType *T) { + for (auto &Operand : T->getOperands()) { +

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -6330,6 +6331,140 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { findHandleTypeOnResource(const Type *RT); }; +/// Instances of this class represent operands to a SPIR-V type instruction. +class SpirvOperand { +public: + enum SpirvOpera

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -3332,6 +3388,39 @@ checkBuiltinTemplateIdType(Sema &SemaRef, BuiltinTemplateDecl *BTD, } return HasNoTypeMember; } + + case BTK__hlsl_spirv_type: { +assert(Converted.size() == 4); + +if (!Context.getTargetInfo().getTriple().isSPIRV()) { + SemaRef.Di

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -6330,6 +6331,140 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { findHandleTypeOnResource(const Type *RT); }; +/// Instances of this class represent operands to a SPIR-V type instruction. +class SpirvOperand { +public: + enum SpirvOpera

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
@@ -6330,6 +6331,140 @@ class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode { findHandleTypeOnResource(const Type *RT); }; +/// Instances of this class represent operands to a SPIR-V type instruction. +class SpirvOperand { +public: + enum SpirvOpera

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-05-06 Thread Cassandra Beckley via cfe-commits
https://github.com/cassiebeckley updated https://github.com/llvm/llvm-project/pull/134034 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,

[clang] [AArch64] Change the coercion type of structs with pointer members. (PR #135064)

2025-05-06 Thread Eli Friedman via cfe-commits
@@ -486,6 +486,39 @@ ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadicFn, } Size = llvm::alignTo(Size, Alignment); +// If the Aggregate is made up of pointers, use an array of pointers for the +// coerced type. This prevents having

[clang] [AArch64] Change the coercion type of structs with pointer members. (PR #135064)

2025-05-06 Thread Eli Friedman via cfe-commits
@@ -486,6 +486,39 @@ ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadicFn, } Size = llvm::alignTo(Size, Alignment); +// If the Aggregate is made up of pointers, use an array of pointers for the +// coerced type. This prevents having

[clang] [AArch64] Change the coercion type of structs with pointer members. (PR #135064)

2025-05-06 Thread Eli Friedman via cfe-commits
@@ -486,6 +486,39 @@ ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadicFn, } Size = llvm::alignTo(Size, Alignment); +// If the Aggregate is made up of pointers, use an array of pointers for the +// coerced type. This prevents having

[clang] [clang-tools-extra] [lldb] [clang][modules] Lazily load by name lookups in module maps (PR #132853)

2025-05-06 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Test change LGTM, I was probably trying to get to a minimal test-case and ended up with something that was relying on implementation details. https://github.com/llvm/llvm-project/pull/132853 ___ cfe-commits mailing list cfe-commits

[clang] [llvm] [sancov] Introduce optional callback for stack-depth tracking (PR #138323)

2025-05-06 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/138323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [StaticAnalyzer] Make it a noop when initializing a field of empty record (PR #138594)

2025-05-06 Thread Ziqing Luo via cfe-commits
https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/138594 >From 4e6f2ce82744322a35614532732281eacb2fe79a Mon Sep 17 00:00:00 2001 From: Ziqing Luo Date: Mon, 5 May 2025 14:27:48 -0700 Subject: [PATCH 1/2] [StaticAnalyzer] Make it a noop when initializing a field

[clang-tools-extra] [clang-doc] Add regression test for test comments in macros (PR #132510)

2025-05-06 Thread via cfe-commits
github-actions[bot] wrote: @ZhongUncle 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-tools-extra] a63fd59 - [clang-doc] Add regression test for test comments in macros (#132510)

2025-05-06 Thread via cfe-commits
Author: ZhongUncle Date: 2025-05-06T16:00:02-07:00 New Revision: a63fd59d95397d236b03e964287728a35efa296b URL: https://github.com/llvm/llvm-project/commit/a63fd59d95397d236b03e964287728a35efa296b DIFF: https://github.com/llvm/llvm-project/commit/a63fd59d95397d236b03e964287728a35efa296b.diff LO

[clang-tools-extra] [clang-doc] Add regression test for test comments in macros (PR #132510)

2025-05-06 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi closed https://github.com/llvm/llvm-project/pull/132510 ___ 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 regression test for test comments in macros (PR #132510)

2025-05-06 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. https://github.com/llvm/llvm-project/pull/132510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SYCL] Add AOT compilation support for Intel GPUs in clang-sycl-linker (PR #133194)

2025-05-06 Thread Justin Cai via cfe-commits
@@ -338,6 +382,87 @@ static Error runSPIRVCodeGen(StringRef File, const ArgList &Args, return Error::success(); } +/// Run AOT compilation for Intel CPU. +/// Calls opencl-aot tool to generate device code for Intel CPU backend. jzc wrote: Changed to `Calls

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya edited https://github.com/llvm/llvm-project/pull/138773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tools-extra] Remove redundant calls to std::unique_ptr::get (NFC) (PR #138774)

2025-05-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clangd Author: Kazu Hirata (kazutakahirata) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/138774.diff 2 Files Affected: - (modified) clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp (+3-4) - (modified) clang-tools-ex

[clang-tools-extra] [clang-tools-extra] Remove redundant calls to std::unique_ptr::get (NFC) (PR #138774)

2025-05-06 Thread Kazu Hirata via cfe-commits
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/138774 None >From a524a8098d5a513259d0d82b262d4b5a769d4d1f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 6 May 2025 15:20:38 -0700 Subject: [PATCH] [clang-tools-extra] Remove redundant calls to std::un

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Thurston Dang via cfe-commits
https://github.com/thurstond updated https://github.com/llvm/llvm-project/pull/138577 >From 1cb28ef0b3313c3fd60667cc7928f0fed8d1838a Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Mon, 5 May 2025 20:11:09 + Subject: [PATCH 1/9] [sanitizer] Add plumbing for -fsanitize-add-pseudo-functio

[clang] [clang-sycl-linker] Add AOT compilation support for Intel GPUs/CPUs (PR #133194)

2025-05-06 Thread Justin Cai via cfe-commits
https://github.com/jzc edited https://github.com/llvm/llvm-project/pull/133194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][SYCL] Add AOT compilation support for Intel GPUs in clang-sycl-linker (PR #133194)

2025-05-06 Thread Justin Cai via cfe-commits
@@ -440,9 +570,15 @@ int main(int argc, char **argv) { DryRun = Args.hasArg(OPT_dry_run); SaveTemps = Args.hasArg(OPT_save_temps); - OutputFile = "a.out"; - if (Args.hasArg(OPT_o)) -OutputFile = Args.getLastArgValue(OPT_o); + IsAOTCompileNeeded = IsIntelOffloadArch(

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Tomohiro Kashiwada (kikairoya) Changes MinGW-GCC and MinGW-Clang exports these symbols. Cygwin-GCC also exports them, so Cygwin-Clang should do so. Some of tests have new DAG pattern because i686-cygwin don't use __thiscall but __cdecl fo

[clang] [Cygwin] Export global symbols, template instantiations, RTTI and VTable are exported correctly (PR #138773)

2025-05-06 Thread Tomohiro Kashiwada via cfe-commits
https://github.com/kikairoya created https://github.com/llvm/llvm-project/pull/138773 MinGW-GCC and MinGW-Clang exports these symbols. Cygwin-GCC also exports them, so Cygwin-Clang should do so. Some of tests have new DAG pattern because i686-cygwin don't use __thiscall but __cdecl for member

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-06 Thread Oleksandr T. via cfe-commits
a-tarasyuk wrote: > So I don't believe this is correct either. We want it to always say the > namespace. So clang::unknown will diagnose as unknown attribute > 'clang::unknown' ignored @erichkeane @AaronBallman Thanks for the feedback. I've made changes to include the _scope_ in the diagnost

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk deleted https://github.com/llvm/llvm-project/pull/138519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-05-06 Thread Alexey Bataev via cfe-commits
@@ -4529,6 +4529,191 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *replaceWithNewTraitsOrDirectCall(CapturedDecl *CDecl, + Expr *NewExpr) { + Expr *CurrentCa

[clang] [Clang][CMake] respect LLVMConfig.cmake's LLVM_DEFINITIONS (PR #138587)

2025-05-06 Thread via cfe-commits
jeremyd2019 wrote: > I agree that the second change, that is using `LLVMConfig.cmake`'s > `LLVM_DEFINITIONS`, should be applied to other projects that support > standalone builds like LLD. Is there a list somewhere or do I just rely on my grep-foo? * bolt * clang * flang * lld * lldb * mlir g

[clang] [Clang] diagnose unknown attribute namespaces (PR #138519)

2025-05-06 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/138519 >From cbbca4d26b8d00eb103f110c2341fab2e4a2e40d Mon Sep 17 00:00:00 2001 From: Oleksandr Tarasiuk Date: Mon, 5 May 2025 15:30:14 +0300 Subject: [PATCH] [Clang] diagnose unknown attribute namespaces --- clang

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Thurston Dang via cfe-commits
thurstond wrote: > Thanks for making changes. I have some very minor suggestions but I'll > approve now and you can decide if it's worth making my suggested changes. Thanks, I like your wording improvements! I've modified the HelpText and comment. https://github.com/llvm/llvm-project/pull/138

[clang] Suppress errors from well-formed-testing type traits in SFINAE contexts (PR #135390)

2025-05-06 Thread Aaron Puchert via cfe-commits
aaronpuchert wrote: Could also add this under "Bug Fixes to C++ Support". The entries about type traits [don't seem to be consistently categorized](https://releases.llvm.org/19.1.0/tools/clang/docs/ReleaseNotes.html#bug-fixes-in-this-version), but I think this is all C++-only. https://github.

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

2025-05-06 Thread kadir çetinkaya via cfe-commits
kadircet wrote: ping @AaronBallman @efriedma-quic if you don't have more concerns here, I'd like to move forward with this patch https://github.com/llvm/llvm-project/pull/137163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

2025-05-06 Thread Erich Keane via cfe-commits
@@ -12464,7 +12487,7 @@ static void AnalyzeImplicitConversions( << OrigE->getSourceRange() << T->isBooleanType() << FixItHint::CreateReplacement(UO->getBeginLoc(), "!"); - if (const auto *BO = dyn_cast(SourceExpr)) + if (auto *BO = dyn_cast(SourceExpr)) -

[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

2025-05-06 Thread Erich Keane via cfe-commits
@@ -11647,6 +11647,29 @@ static void DiagnoseFloatingImpCast(Sema &S, Expr *E, QualType T, } } +static void CheckCommaOperand(Sema &S, Expr *E, QualType T, SourceLocation CC, + bool Check) { erichkeane wrote: `Check` is pretty

[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

2025-05-06 Thread Erich Keane via cfe-commits
@@ -11647,6 +11647,29 @@ static void DiagnoseFloatingImpCast(Sema &S, Expr *E, QualType T, } } +static void CheckCommaOperand(Sema &S, Expr *E, QualType T, SourceLocation CC, + bool Check) { + E = E->IgnoreParenImpCasts(); + AnalyzeImplicitCon

[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

2025-05-06 Thread Erich Keane via cfe-commits
@@ -11647,6 +11647,29 @@ static void DiagnoseFloatingImpCast(Sema &S, Expr *E, QualType T, } } +static void CheckCommaOperand(Sema &S, Expr *E, QualType T, SourceLocation CC, + bool Check) { + E = E->IgnoreParenImpCasts(); + AnalyzeImplicitCon

[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

2025-05-06 Thread Erich Keane via cfe-commits
@@ -11647,6 +11647,29 @@ static void DiagnoseFloatingImpCast(Sema &S, Expr *E, QualType T, } } +static void CheckCommaOperand(Sema &S, Expr *E, QualType T, SourceLocation CC, + bool Check) { + E = E->IgnoreParenImpCasts(); + AnalyzeImplicitCon

[clang] Suppress errors from well-formed-testing type traits in SFINAE contexts (PR #135390)

2025-05-06 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert updated https://github.com/llvm/llvm-project/pull/135390 >From d8bc5ebd7976d25e800987b3c95057364dc1c07c Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Fri, 11 Apr 2025 13:47:02 +0200 Subject: [PATCH] Suppress errors from well-formed-testing type traits in SF

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-06 Thread via cfe-commits
Andres-Salamanca wrote: > @bcardosolopes Adding a test for C++ -> CIR depends on #138003 which adds > lowering for `?:`, `&&` and `||`. Since this one's ready to be merged apart > from your remark IMO I'd add that test in #138003 I think you're referring to this PR: https://github.com/llvm/ll

[clang] [clang][ptrauth] Add support for querying the ptrauth schema of a type (PR #138482)

2025-05-06 Thread Oliver Hunt via cfe-commits
https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/138482 >From ecea44f2965cda3a4e6e1ccec096066830ddfa41 Mon Sep 17 00:00:00 2001 From: Oliver Hunt Date: Sun, 4 May 2025 21:07:33 -0700 Subject: [PATCH] [clang][ptrauth] Add support for querying the ptrauth schema of a t

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-06 Thread Andy Kaylor via cfe-commits
@@ -96,3 +96,36 @@ void foo2(vi4 p) {} // OGCG: %[[VEC_A:.*]] = alloca <4 x i32>, align 16 // OGCG: store <4 x i32> %{{.*}}, ptr %[[VEC_A]], align 16 + +void foo3() { + vi4 a = { 1, 2, 3, 4 }; + int e = a[1]; +} andykaylor wrote: Can you add a test where th

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

2025-05-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good to me, with a small request. https://github.com/llvm/llvm-project/pull/138413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [CIR] Upstream extract op for VectorType (PR #138413)

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

[clang] [CIR] Cleanup support for C functions (PR #136854)

2025-05-06 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @el-ev Can you rebase this now that the call args change has landed? Thanks! https://github.com/llvm/llvm-project/pull/136854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [Clang] Ignore -fchar8_t in C (PR #138716)

2025-05-06 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/138716 >From cb8c80432affae6182e995a546c941b3b6afb8b0 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue, 6 May 2025 18:18:06 +0200 Subject: [PATCH 1/2] [Clang] Ignore -fchar8_t in C In C, char8_t is an alias to

[clang] [Clang] Ignore -fchar8_t in C (PR #138716)

2025-05-06 Thread via cfe-commits
@@ -5,6 +5,7 @@ // RUN: %clang_cc1 -std=c++17 -verify %s // RUN: %clang_cc1 -std=c++17 -verify %s -fno-char8_t // RUN: %clang_cc1 -std=c++20 -verify %s -fno-char8_t +// RUN: %clang_cc1 -x c -verify %s -fchar8_t cor3ntin wrote: `ShouldParseIf` seems never to di

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

2025-05-06 Thread Alexey Bataev via cfe-commits
@@ -4529,6 +4529,191 @@ void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { emitMaster(*this, S); } +static Expr *replaceWithNewTraitsOrDirectCall(CapturedDecl *CDecl, + Expr *NewExpr) { + Expr *CurrentCa

[clang] [APINotes] Add support for SWIFT_RETURED_AS_UNRETAINED_BY_DEFAULT (PR #138699)

2025-05-06 Thread via cfe-commits
@@ -624,6 +624,13 @@ class TagTableInfo ReleaseOpLength - 1); Data += ReleaseOpLength - 1; } +unsigned DefaultOwnershipLength = +endian::readNext(Data); +if (DefaultOwnershipLength > 0) { fahadna

[clang] [Clang] Ignore -fchar8_t in C (PR #138716)

2025-05-06 Thread Aaron Ballman via cfe-commits
@@ -5,6 +5,7 @@ // RUN: %clang_cc1 -std=c++17 -verify %s // RUN: %clang_cc1 -std=c++17 -verify %s -fno-char8_t // RUN: %clang_cc1 -std=c++20 -verify %s -fno-char8_t +// RUN: %clang_cc1 -x c -verify %s -fchar8_t AaronBallman wrote: Shouldn't this generate a dia

[clang] [Clang] Ignore -fchar8_t in C (PR #138716)

2025-05-06 Thread Aaron Ballman via cfe-commits
@@ -317,6 +317,8 @@ Modified Compiler Flags - The ``-mexecute-only`` and ``-mpure-code`` flags are now accepted for AArch64 targets. (#GH125688) +- The ``-fchar8_t`` flag is no longer consider in non-C++ languages modes. (#GH55373) AaronBallman wrote: ```s

[clang] [Clang][CMake] respect LLVMConfig.cmake's LLVM_DEFINITIONS (PR #138587)

2025-05-06 Thread Martin Storsjö via cfe-commits
mstorsjo wrote: > If this is right, it should probably be done to other standalone-capable > projects' CMakeLists.txt also (LLD in particular, for my interests). > Actually, it seems there's nothing in LLD that requires _GNU_SOURCE on > Cygwin... Yep, indeed. I guess the main question is who

[clang] [Clang] Ignore -fchar8_t in C (PR #138716)

2025-05-06 Thread via cfe-commits
cor3ntin wrote: This is part of the problem, yes. we also do not support char16_t/char32_t as keywords in C and u8 behaves differently. And of course, there is no way to use it with the standard library or... any library? Moreover we have 0 tests for C so I don't think we can claim to support

[clang] [clang][Index] Add comment about out-of-line defaulted destructor (PR #138640)

2025-05-06 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 updated https://github.com/llvm/llvm-project/pull/138640 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial

[clang] [CIR] Upstream support for switch statements case kinds (PR #138003)

2025-05-06 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor approved this pull request. Looks good to me! https://github.com/llvm/llvm-project/pull/138003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Ignore -fchar8_t in C (PR #138716)

2025-05-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thank you for the explanation, that makes sense https://github.com/llvm/llvm-project/pull/138716 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Add cir-simplify pass (PR #138317)

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

[clang] [clang-repl] Disable EmulatedTLS on Windows for interpreter executor (PR #127468)

2025-05-06 Thread via cfe-commits
mcbarton wrote: @bellenot ping https://github.com/llvm/llvm-project/pull/127468 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose invalid function types in dependent contexts (PR #138731)

2025-05-06 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/138731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] cf9b4d1 - [Clang] Diagnose invalid function types in dependent contexts (#138731)

2025-05-06 Thread via cfe-commits
Author: cor3ntin Date: 2025-05-06T22:51:04+02:00 New Revision: cf9b4d1e7961214deabd99a9fc3b1d4c9e78a71f URL: https://github.com/llvm/llvm-project/commit/cf9b4d1e7961214deabd99a9fc3b1d4c9e78a71f DIFF: https://github.com/llvm/llvm-project/commit/cf9b4d1e7961214deabd99a9fc3b1d4c9e78a71f.diff LOG:

[clang] [CIR] Add cir-simplify pass (PR #138317)

2025-05-06 Thread Morris Hafner via cfe-commits
mmha wrote: @bcardosolopes Adding a test for C++ -> CIR depends on #138003 which adds lowering for `?:`, `&&` and `||`. Since this one's ready to be merged apart from your remark IMO I'd add that test in #138003 https://github.com/llvm/llvm-project/pull/138317 _

[clang] 25af0ae - [clang][Index] Add comment about out-of-line defaulted destructor (#138640)

2025-05-06 Thread via cfe-commits
Author: Nathan Ridge Date: 2025-05-06T16:48:04-04:00 New Revision: 25af0ae8efa90610af114dfe0eea8f7f14462cc2 URL: https://github.com/llvm/llvm-project/commit/25af0ae8efa90610af114dfe0eea8f7f14462cc2 DIFF: https://github.com/llvm/llvm-project/commit/25af0ae8efa90610af114dfe0eea8f7f14462cc2.diff

[clang] [clang][Index] Add comment about out-of-line defaulted destructor (PR #138640)

2025-05-06 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 closed https://github.com/llvm/llvm-project/pull/138640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CIR] Unblock simple C++ structure support (PR #138368)

2025-05-06 Thread Andy Kaylor via cfe-commits
@@ -365,10 +365,15 @@ mlir::Attribute ConstantEmitter::tryEmitPrivateForVarInit(const VarDecl &d) { if (!d.hasLocalStorage()) { QualType ty = cgm.getASTContext().getBaseElementType(d.getType()); if (ty->isRecordType()) - if (d.getInit() && isa(d.getInit())) { -

[clang] [AMDGPU] Remove unused argument in builtins-amdgcn-gfx950.cl. NFC. (PR #138753)

2025-05-06 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec created https://github.com/llvm/llvm-project/pull/138753 None >From 7aad45e6bb65f6378abb4f76052dab283a9b3f93 Mon Sep 17 00:00:00 2001 From: Stanislav Mekhanoshin Date: Tue, 6 May 2025 13:10:15 -0700 Subject: [PATCH] [AMDGPU] Remove unused argument in builtins-amdgcn

[clang] [AMDGPU] Remove unused argument in builtins-amdgcn-gfx950.cl. NFC. (PR #138753)

2025-05-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Stanislav Mekhanoshin (rampitec) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/138753.diff 1 Files Affected: - (modified) clang/test/CodeGenOpenCL/builtins-amdgcn-gfx950.cl (+1-3) ``diff diff --git a/clang

[clang] [mlir] [OpenACC] Implement tile/collapse lowering (PR #138576)

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

[clang] bb09f79 - [OpenACC] Implement tile/collapse lowering (#138576)

2025-05-06 Thread via cfe-commits
Author: Erich Keane Date: 2025-05-06T13:11:49-07:00 New Revision: bb09f79f0f2b8e0cc3ed01d19ae49afbda8f82d2 URL: https://github.com/llvm/llvm-project/commit/bb09f79f0f2b8e0cc3ed01d19ae49afbda8f82d2 DIFF: https://github.com/llvm/llvm-project/commit/bb09f79f0f2b8e0cc3ed01d19ae49afbda8f82d2.diff L

[clang] [AMDGPU] Remove unused argument in builtins-amdgcn-gfx950.cl. NFC. (PR #138753)

2025-05-06 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec ready_for_review https://github.com/llvm/llvm-project/pull/138753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Remove unused argument in builtins-amdgcn-gfx950.cl. NFC. (PR #138753)

2025-05-06 Thread Stanislav Mekhanoshin via cfe-commits
rampitec wrote: * **#138753** https://app.graphite.dev/github/pr/llvm/llvm-project/138753?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/138

[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

2025-05-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes In C++, the type of an enumerator is the type of the enumeration, whereas in C, the type of the enumerator is 'int'. The type of a comma operator is the type of the right-hand operand, which means you

[clang] [C] Add new -Wimplicit-int-enum-cast to -Wc++-compat (PR #137658)

2025-05-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman If you try to compile the following c program after this patch > > ``` > void free (); > typedef enum {REG_EESCAPE} reg_errcode_t; > typedef struct {int *stack;} compile_stack_type; > reg_errcode_t byte_regex_compile () { > compile_stack_type compile_stack;

[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

2025-05-06 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/138752 In C++, the type of an enumerator is the type of the enumeration, whereas in C, the type of the enumerator is 'int'. The type of a comma operator is the type of the right-hand operand, which means you can

[clang] [sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (PR #138577)

2025-05-06 Thread Florian Mayer via cfe-commits
https://github.com/fmayer requested changes to this pull request. Seems like the fsanitize test is failing now https://github.com/llvm/llvm-project/pull/138577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [AMDGPU] Fix gfx1201 check line in the amdgpu-features.cl. NFC. (PR #138743)

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

[clang] [AMDGPU] Change -cl-std to CL2.0 in builtins-amdgcn-gfx950.cl. NFC. (PR #138745)

2025-05-06 Thread Stanislav Mekhanoshin via cfe-commits
https://github.com/rampitec closed https://github.com/llvm/llvm-project/pull/138745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Change -cl-std to CL2.0 in builtins-amdgcn-gfx950.cl. NFC. (PR #138745)

2025-05-06 Thread Stanislav Mekhanoshin via cfe-commits
rampitec wrote: Closing in favor of downstream change. https://github.com/llvm/llvm-project/pull/138745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Change -cl-std to CL2.0 in builtins-amdgcn-gfx950.cl. NFC. (PR #138745)

2025-05-06 Thread Stanislav Mekhanoshin via cfe-commits
rampitec wrote: > > > Why? This just adds more intermediate IR and makes the output bigger. If > > > anything we should switch any tests unnecessarily using CL2.0 to use CL1.2 > > > > > > It is like that everywhere, and that eliminates huge delta to downstream > > branch. > > Fix the downstr

[clang] [clang][NFC] Fix some more incorrectly formatted comments (PR #138342)

2025-05-06 Thread Nick Sarnie via cfe-commits
@@ -4911,8 +4911,8 @@ std::optional Type::getNullability() const { bool Type::canHaveNullability(bool ResultIfUnknown) const { QualType type = getCanonicalTypeInternal(); + // We'll only see canonical types here. sarnex wrote: done in latest commit, thank

  1   2   3   4   >