[clang] [Clang] Prevent potential null pointer dereferences (PR #117176)

2024-11-21 Thread Mariya Podchishchaeva via cfe-commits
@@ -627,7 +627,7 @@ class Analyzer { IsNoexcept = isNoexcept(FD); } else if (auto *BD = dyn_cast(D)) { if (auto *TSI = BD->getSignatureAsWritten()) { -auto *FPT = TSI->getType()->getAs(); +auto *FPT = TSI->getType()->castAs();

[clang] Added more descriptive message (issue 116808) (PR #117201)

2024-11-21 Thread via cfe-commits
https://github.com/tlemy created https://github.com/llvm/llvm-project/pull/117201 The dialogue messages were changed to be more descriptive. #116808 >From 99f9b957a5b82c532e97b08b9a45ddf2a2918b68 Mon Sep 17 00:00:00 2001 From: ted Date: Thu, 21 Nov 2024 13:04:05 -0500 Subject: [PATCH] Added mo

[clang] Added more descriptive message (issue 116808) (PR #117201)

2024-11-21 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] Added more descriptive message (issue 116808) (PR #117201)

2024-11-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (tlemy) Changes The dialogue messages were changed to be more descriptive. #116808 --- Full diff: https://github.com/llvm/llvm-project/pull/117201.diff 1 Files Affected: - (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td

[clang] [llvm] Codegen changes for strict modifier with grainsize/num_tasks of taskloop construct (PR #117196)

2024-11-21 Thread CHANDRA GHALE via cfe-commits
https://github.com/chandraghale created https://github.com/llvm/llvm-project/pull/117196 Initial parsing/sema for 'strict' modifier with 'num_tasks' and ‘grainsize’ clause is present in these commits [grainsize_parsing](https://github.com/llvm/llvm-project/commit/ab9eac762c35068e77f57795e660d0

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-21 Thread Florian Hahn via cfe-commits
@@ -230,6 +232,11 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { ->getString(); TyName = Name; } else { + // Be conservative if the type a MemberPointerType. Those would require + // stripping const-qualifiers inside the typ

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread via cfe-commits
https://github.com/joaosaffran edited https://github.com/llvm/llvm-project/pull/116699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [XRay] Add `-fxray-default-options` to pass build-time defined XRay options (PR #116878)

2024-11-21 Thread Min-Yih Hsu via cfe-commits
https://github.com/mshockwave updated https://github.com/llvm/llvm-project/pull/116878 >From 95ee4bd09aa48d4f0c2c4f5fc1e81e20cd57c7e2 Mon Sep 17 00:00:00 2001 From: Min-Yih Hsu Date: Mon, 11 Nov 2024 11:40:43 -0800 Subject: [PATCH 1/2] [XRay] Add `-fxray-default-options` to pass build-time def

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/116699 >From c3b3c87db9b6a47bea9ed69575d4a9a728d1b154 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Sat, 9 Nov 2024 01:34:16 + Subject: [PATCH 1/7] adding definition --- clang/lib/Sema/HLSLExternalSemaSou

[clang] decb874 - [TBAA] Only emit pointer tbaa metedata for record types. (#116991)

2024-11-21 Thread via cfe-commits
Author: Florian Hahn Date: 2024-11-21T20:01:06Z New Revision: decb87452d8e3b93b21ab9e4c3dd03d85cbebfa5 URL: https://github.com/llvm/llvm-project/commit/decb87452d8e3b93b21ab9e4c3dd03d85cbebfa5 DIFF: https://github.com/llvm/llvm-project/commit/decb87452d8e3b93b21ab9e4c3dd03d85cbebfa5.diff LOG:

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-21 Thread Florian Hahn via cfe-commits
https://github.com/fhahn closed https://github.com/llvm/llvm-project/pull/116991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Add v_smfmac_i32_16x16x128_i8 for gfx950 (PR #117213)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/117213 >From 61ec4b1cec91e20c42140c6fb20a83d2caeb2cc3 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 2 Feb 2024 15:52:26 +0530 Subject: [PATCH] AMDGPU: Add v_smfmac_i32_16x16x128_i8 for gfx950 --- clang/incl

[clang] [llvm] AMDGPU: Add v_smfmac_f32_16x16x128_bf8_bf8 for gfx950 (PR #117232)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/117232 >From a8894cf9efa88e985bc2da60056ac113c7c1f658 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 2 Feb 2024 21:37:17 +0530 Subject: [PATCH] AMDGPU: Add v_smfmac_f32_16x16x128_bf8_bf8 for gfx950 --- clang

[clang] eaa0a21 - Limit symbol versioning in clang-cpp to Linux for now

2024-11-21 Thread Aaron Puchert via cfe-commits
Author: Aaron Puchert Date: 2024-11-21T23:53:11+01:00 New Revision: eaa0a21d21962280dc2c03a09152510f6162a576 URL: https://github.com/llvm/llvm-project/commit/eaa0a21d21962280dc2c03a09152510f6162a576 DIFF: https://github.com/llvm/llvm-project/commit/eaa0a21d21962280dc2c03a09152510f6162a576.diff

[clang] [llvm] AMDGPU: Add v_smfmac_i32_32x32x64_i8 for gfx950 (PR #117214)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/117214 >From 7f204424e335e92473cca792fe02063ce62d5188 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 2 Feb 2024 20:15:33 +0530 Subject: [PATCH] AMDGPU: Add v_smfmac_i32_32x32x64_i8 for gfx950 --- clang/inclu

[clang] 8c53036 - AMDGPU: Add v_smfmac_i32_16x16x128_i8 for gfx950 (#117213)

2024-11-21 Thread via cfe-commits
Author: Matt Arsenault Date: 2024-11-21T14:58:11-08:00 New Revision: 8c53036146758acf6b195867fbc9ec447e4a228f URL: https://github.com/llvm/llvm-project/commit/8c53036146758acf6b195867fbc9ec447e4a228f DIFF: https://github.com/llvm/llvm-project/commit/8c53036146758acf6b195867fbc9ec447e4a228f.diff

[clang] [llvm] AMDGPU: Add v_smfmac_i32_16x16x128_i8 for gfx950 (PR #117213)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/117213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Add v_smfmac_i32_32x32x64_i8 for gfx950 (PR #117214)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3e6f350 - AMDGPU: Add v_smfmac_i32_32x32x64_i8 for gfx950 (#117214)

2024-11-21 Thread via cfe-commits
Author: Matt Arsenault Date: 2024-11-21T15:01:03-08:00 New Revision: 3e6f3508adac947bf7b85aec88e796bbfbdebf70 URL: https://github.com/llvm/llvm-project/commit/3e6f3508adac947bf7b85aec88e796bbfbdebf70 DIFF: https://github.com/llvm/llvm-project/commit/3e6f3508adac947bf7b85aec88e796bbfbdebf70.diff

[clang] [llvm] AMDGPU: Add v_smfmac_i32_32x32x64_i8 for gfx950 (PR #117214)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm closed https://github.com/llvm/llvm-project/pull/117214 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread via cfe-commits
@@ -1474,6 +1474,11 @@ DeclContext *DeclContext::getPrimaryContext() { case Decl::ObjCCategoryImpl: return this; + case Decl::CXXRecord: +if (auto *OPD = dyn_cast(this)) + if (auto *Def = OPD->getDefinition()) +return Def; +return this; default:

[clang] [llvm] AMDGPU: Add v_smfmac_f32_16x16x128_bf8_bf8 for gfx950 (PR #117232)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/117232 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Support -print-supported-cpus and associated aliases (PR #117199)

2024-11-21 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu created https://github.com/llvm/llvm-project/pull/117199 The aliases are -mcpu=help and -mtune=help. There is still an issue with the output which prints an example line that references clang. That is not fixed here because it is printed in llvm/MC/SubtargetInfo.

[clang] [llvm] AMDGPU: Add v_mfma_f32_16x16x32_bf16 for gfx950 (PR #117053)

2024-11-21 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/117053 >From 34fb85ff3e70bce36ef7f641506f388d3242fe3b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 29 Jan 2024 18:16:52 +0530 Subject: [PATCH] AMDGPU: Add v_mfma_f32_16x16x32_bf16 for gfx950 --- .../CodeGe

[clang] [Clang] Prevent null dereferences (PR #115502)

2024-11-21 Thread via cfe-commits
@@ -2265,7 +2265,7 @@ class UnsafeBufferUsageReporter : public UnsafeBufferUsageHandler { } else if (isa(Operation)) { // note_unsafe_buffer_operation doesn't have this mode yet. assert(!IsRelatedToDecl && "Not implemented yet!"); -auto ME = dyn_c

[clang] [clang] Implement gcc_struct attribute on Itanium targets (PR #71148)

2024-11-21 Thread Pierrick Bouvier via cfe-commits
pbo-linaro wrote: Hi all, any update on this PR? QEMU still actively block compiling with clang on windows for this reason, by failing at configure step, and it was decided to wait for official `gcc_struct` support in llvm. https://github.com/llvm/llvm-project/pull/71148 __

[clang] f7497b1 - [Fuchsia][CMake] Enable new libc header gen (#116938)

2024-11-21 Thread via cfe-commits
Author: Petr Hosek Date: 2024-11-21T11:01:55-08:00 New Revision: f7497b10f7face081cc5ae2528276d919a5c6ca2 URL: https://github.com/llvm/llvm-project/commit/f7497b10f7face081cc5ae2528276d919a5c6ca2 DIFF: https://github.com/llvm/llvm-project/commit/f7497b10f7face081cc5ae2528276d919a5c6ca2.diff LO

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 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 26a9f3f5906c62cff7f2245b98affa432b504a87 bd9d84f2f0f97e9f870de070dd14fd8827ac69d3 --e

[clang] [TBAA] Don't emit pointer tbaa for unnamed structs or unions. (PR #116596)

2024-11-21 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/116596 >From df9460221a937f9a705f6ddf7c080ca9b7fa4e3f Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Sun, 17 Nov 2024 20:07:57 + Subject: [PATCH 1/2] [TBAA] Don't emit pointer tbaa for unnamed structs or unions.

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/116699 >From c3b3c87db9b6a47bea9ed69575d4a9a728d1b154 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Sat, 9 Nov 2024 01:34:16 + Subject: [PATCH 1/8] adding definition --- clang/lib/Sema/HLSLExternalSemaSou

[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

2024-11-21 Thread Helena Kotas via cfe-commits
@@ -1,28 +1,28 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.2-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s -check-prefixes=DXIL // NOTE: The number in type name and whether the struct is packed or not will mostly -// likely cha

[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

2024-11-21 Thread Helena Kotas via cfe-commits
@@ -12487,6 +12487,7 @@ def err_hlsl_pointers_unsupported : Error< "%select{pointers|references}0 are unsupported in HLSL">; def err_hlsl_missing_resource_class : Error<"HLSL resource needs to have [[hlsl::resource_class()]] attribute">; def err_hlsl_attribute_needs_intangib

[clang] Make armv6 iOS by default instead of macOS when targeting Darwin (PR #117243)

2024-11-21 Thread via cfe-commits
https://github.com/Un1q32 updated https://github.com/llvm/llvm-project/pull/117243 >From a15d1120fc54059eb009b6da7d81ffae79cbd868 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Thu, 21 Nov 2024 16:25:12 -0500 Subject: [PATCH 1/2] Make armv6 iOS by default --- clang/lib/Driver/ToolChains/Darwin.c

[clang] [llvm] [HLSL] Implement `WaveActiveAllTrue` Intrinsic (PR #117245)

2024-11-21 Thread Ashley Coleman via cfe-commits
https://github.com/V-FEXrt created https://github.com/llvm/llvm-project/pull/117245 Resolves https://github.com/llvm/llvm-project/issues/99161 - [x] Implement `WaveActiveAllTrue` clang builtin, - [x] Link `WaveActiveAllTrue` clang builtin with `hlsl_intrinsics.h` - [x] Add sema checks for `W

[clang] [llvm] [HLSL] Implement `WaveActiveAllTrue` Intrinsic (PR #117245)

2024-11-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ashley Coleman (V-FEXrt) Changes Resolves https://github.com/llvm/llvm-project/issues/99161 - [x] Implement `WaveActiveAllTrue` clang builtin, - [x] Link `WaveActiveAllTrue` clang builtin with `hlsl_intrinsics.h` - [x] Add sema checks f

[clang] [llvm] [HLSL] Implement `WaveActiveAllTrue` Intrinsic (PR #117245)

2024-11-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-spir-v @llvm/pr-subscribers-backend-directx Author: Ashley Coleman (V-FEXrt) Changes Resolves https://github.com/llvm/llvm-project/issues/99161 - [x] Implement `WaveActiveAllTrue` clang builtin, - [x] Link `WaveActiveAllTrue` clang builtin wit

[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

2024-11-21 Thread Helena Kotas via cfe-commits
@@ -2,36 +2,36 @@ // RUN: %clang_cc1 -triple spirv-pc-vulkan-compute -finclude-default-header -fnative-half-type -emit-llvm -o - %s | FileCheck %s -check-prefixes=SPIRV // NOTE: The type name number and whether the struct is packed or not will mostly -// likely change once s

[clang] Make armv6 iOS by default instead of macOS when targeting Darwin (PR #117243)

2024-11-21 Thread via cfe-commits
https://github.com/Un1q32 converted_to_draft https://github.com/llvm/llvm-project/pull/117243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement a header only distance intrinsic (PR #117240)

2024-11-21 Thread Farzon Lotfi via cfe-commits
@@ -853,6 +853,45 @@ float3 degrees(float3); _HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_degrees) float4 degrees(float4); +//===--===// +// distance builtins +//===--

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread via cfe-commits
@@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -DEMPTY %s | FileCheck -check-prefix=EMPTY %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump %s | FileCheck %s + joaosaffran wrote: I ref

[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

2024-11-21 Thread Helena Kotas via cfe-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/117017 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Implement `WaveActiveAllTrue` Intrinsic (PR #117245)

2024-11-21 Thread Ashley Coleman via cfe-commits
@@ -861,6 +861,14 @@ def CreateHandleFromBinding : DXILOp<217, createHandleFromBinding> { let stages = [Stages]; } +def WaveActiveAllTrue : DXILOp<334, waveAllTrue> { V-FEXrt wrote: Crossed wires with SPIRV. This should be 114 not 334 https://github.com/

[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

2024-11-21 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert edited https://github.com/llvm/llvm-project/pull/67520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

2024-11-21 Thread Aaron Puchert via cfe-commits
https://github.com/aaronpuchert commented: I've thought a bit more about what inheritance means for this and I think it makes our job easier. We can probably collect capabilities on the first declaration and then just check that the non-inherited attributes on subsequent declarations are alrea

[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

2024-11-21 Thread Aaron Puchert via cfe-commits
@@ -2263,6 +2265,27 @@ static bool neverReturns(const CFGBlock *B) { return false; } +void ThreadSafetyAnalyzer::checkMismatchedFunctionAttrs(const NamedDecl *ND) { + auto collectCapabilities = [&](const Decl *D) { +CapExprSet Caps; +for (const auto *A : D->specific

[clang] [clang] Warn on mismatched RequiresCapability attributes (PR #67520)

2024-11-21 Thread Aaron Puchert via cfe-commits
@@ -2263,6 +2265,27 @@ static bool neverReturns(const CFGBlock *B) { return false; } +void ThreadSafetyAnalyzer::checkMismatchedFunctionAttrs(const NamedDecl *ND) { + auto collectCapabilities = [&](const Decl *D) { +CapExprSet Caps; +for (const auto *A : D->specific

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread via cfe-commits
https://github.com/joaosaffran updated https://github.com/llvm/llvm-project/pull/116699 >From c3b3c87db9b6a47bea9ed69575d4a9a728d1b154 Mon Sep 17 00:00:00 2001 From: Joao Saffran Date: Sat, 9 Nov 2024 01:34:16 + Subject: [PATCH 1/9] adding definition --- clang/lib/Sema/HLSLExternalSemaSou

[clang] [llvm] [HLSL] Implement `WaveActiveAllTrue` Intrinsic (PR #117245)

2024-11-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 Author: Ashley Coleman (V-FEXrt) Changes Resolves https://github.com/llvm/llvm-project/issues/99161 - [x] Implement `WaveActiveAllTrue` clang builtin, - [x] Link `WaveActiveAllTrue` clang builtin with `hlsl_intrinsics.h` - [x] Add sema ch

[clang] [emacs][clang-format] Add elisp API for clang-format on git diffs (PR #112792)

2024-11-21 Thread Campbell Barton via cfe-commits
ideasman42 wrote: > All things considered, I think requiring `vc` is a lot less intrusive than > essentially our own `vc` wrapper Not sure what you mean exactly by a wrapper, if git/diff logic can be abstracted away - that seems a net gain. If ugly/fragile logic is required to do that - OK

[clang] [llvm] Codegen changes for strict modifier with grainsize/num_tasks of taskloop construct (PR #117196)

2024-11-21 Thread Shilei Tian via cfe-commits
@@ -4666,30 +4666,58 @@ void CGOpenMPRuntime::emitTaskLoopCall(CodeGenFunction &CGF, SourceLocation Loc, CGF.getContext().VoidPtrTy); } enum { NoSchedule = 0, Grainsize = 1, NumTasks = 2 }; - llvm::Value *TaskArgs[] = { - UpLoc, -

[clang] [llvm] [AArch64] Implement intrinsics for F1CVTL/F2CVTL and BF1CVTL/BF2CVTL (PR #116959)

2024-11-21 Thread Jonathan Thackray via cfe-commits
https://github.com/jthackray approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/116959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread Helena Kotas via cfe-commits
@@ -1474,6 +1474,11 @@ DeclContext *DeclContext::getPrimaryContext() { case Decl::ObjCCategoryImpl: return this; + case Decl::CXXRecord: +if (auto *OPD = dyn_cast(this)) + if (auto *Def = OPD->getDefinition()) +return Def; +return this; default:

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread Helena Kotas via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL hekota wrote: Rename to ByteAddressBuffer**s**-constructor**s**.hlsl - test cases for oth

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread Helena Kotas via cfe-commits
@@ -531,6 +531,16 @@ void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() { .addArraySubscriptOperators() .completeDefinition(); }); + + Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "ByteAddressBuffer") + .Record; + on

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-21 Thread Aaron Ballman via cfe-commits
@@ -2347,6 +2351,9 @@ def err_init_reference_member_uninitialized : Error< "reference member of type %0 uninitialized">; def note_uninit_reference_member : Note< "uninitialized reference member is here">; +def warn_field_requires_explicit_init : Warning< + "field %select{%

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-21 Thread Aaron Ballman via cfe-commits
@@ -3141,6 +3148,10 @@ def warn_attribute_ignored_no_calls_in_stmt: Warning< "statement">, InGroup; +def warn_attribute_needs_aggregate : Warning< AaronBallman wrote: Okay, that seems reasonable to me, thanks! https://github.com/llvm/llvm-project/pull/10

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-21 Thread Aaron Ballman via cfe-commits
@@ -551,3 +551,32 @@ struct full_of_empty empty_test_2(void) { struct full_of_empty e; return e; // no-warning } + +struct with_explicit_field { + int x; + int y [[clang::requires_explicit_initialization]]; // #FIELD_Y +}; + +struct with_explicit_array { + [[clang::requi

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-21 Thread Aaron Ballman via cfe-commits
@@ -1599,6 +1599,55 @@ is not specified. }]; } +def ExplicitInitDocs : Documentation { + let Category = DocCatField; + let Content = [{ +The ``clang::requires_explicit_initialization`` attribute indicates that the +field of an aggregate must be initialized explicitly by us

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/102040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64] Implement intrinsics for F1CVTL/F2CVTL and BF1CVTL/BF2CVTL (PR #116959)

2024-11-21 Thread Momchil Velikov via cfe-commits
https://github.com/momchil-velikov approved this pull request. LGTM, cheers! https://github.com/llvm/llvm-project/pull/116959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-21 Thread Aaron Ballman via cfe-commits
@@ -1885,6 +1885,13 @@ def Leaf : InheritableAttr { let SimpleHandler = 1; } +def ExplicitInit : InheritableAttr { + let Spellings = [Clang<"requires_explicit_initialization", 1>]; AaronBallman wrote: ```suggestion let Spellings = [Clang<"requires_explic

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-21 Thread Florian Hahn via cfe-commits
https://github.com/fhahn updated https://github.com/llvm/llvm-project/pull/116991 >From 3a8c157ca484db54a3e1d1ff8061d7b76ce46834 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 20 Nov 2024 15:31:54 + Subject: [PATCH 1/5] [TBAA] Add run-line with -fpointer-tbaa to cwg158 --- clang/t

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-21 Thread Florian Hahn via cfe-commits
@@ -205,14 +205,27 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { llvm::MDNode *AnyPtr = createScalarTypeNode("any pointer", getChar(), Size); if (!CodeGenOpts.PointerTBAA) return AnyPtr; -// Compute the depth of the pointer and generate a

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-21 Thread Florian Hahn via cfe-commits
@@ -18,10 +20,23 @@ struct A {}; // CHECK-LABEL: define {{.*}} @_Z1g const int *(A::*const *g(const int *(A::* const **p)[3], int *(A::***q)[3]))[3] { + // CHECK: load ptr, ptr %p.addr // CHECK: load ptr, {{.*}}, !tbaa ![[MEMPTR_TBAA:[^,]*]] const int *(A::*const *x)[3

[clang] [Fuchsia][CMake] Enable new libc header gen (PR #116938)

2024-11-21 Thread via cfe-commits
https://github.com/zeroomega approved this pull request. lgtm https://github.com/llvm/llvm-project/pull/116938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-21 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. https://github.com/llvm/llvm-project/pull/116991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 84b7086 - [rtsan] NFC: Update docs with suppress_equal_stacks (#117187)

2024-11-21 Thread via cfe-commits
Author: Chris Apple Date: 2024-11-21T10:53:53-08:00 New Revision: 84b70869e6227720e93aad35bd184a8742c94d82 URL: https://github.com/llvm/llvm-project/commit/84b70869e6227720e93aad35bd184a8742c94d82 DIFF: https://github.com/llvm/llvm-project/commit/84b70869e6227720e93aad35bd184a8742c94d82.diff L

[clang] [rtsan] NFC: Update docs with suppress_equal_stacks (PR #117187)

2024-11-21 Thread Chris Apple via cfe-commits
https://github.com/cjappl closed https://github.com/llvm/llvm-project/pull/117187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Fuchsia][CMake] Enable new libc header gen (PR #116938)

2024-11-21 Thread Paul Kirth via cfe-commits
https://github.com/ilovepi approved this pull request. https://github.com/llvm/llvm-project/pull/116938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-11-21 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Precommit CI has failing tests which seem relevant. https://github.com/llvm/llvm-project/pull/102040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [TBAA] Only emit pointer tbaa metedata for record types. (PR #116991)

2024-11-21 Thread Florian Hahn via cfe-commits
@@ -230,6 +243,12 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { ->getString(); TyName = Name; } else { + // Be conservative if the type isn't a RecordType. We are specifically fhahn wrote: Dropped, thanks htt

[clang] [llvm] Codegen changes for strict modifier with grainsize/num_tasks of taskloop construct (PR #117196)

2024-11-21 Thread CHANDRA GHALE via cfe-commits
https://github.com/chandraghale edited https://github.com/llvm/llvm-project/pull/117196 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Support -print-supported-cpus and associated aliases (PR #117199)

2024-11-21 Thread Tarun Prabhu via cfe-commits
@@ -4417,7 +4417,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args, // Use the -mcpu=? flag as the dummy input to cc1. Actions.clear(); - Action *InputAc = C.MakeAction(*A, types::TY_C); + Action *InputAc = C.MakeAction( + *A,

[clang] [rtsan] NFC: Update docs with suppress_equal_stacks (PR #117187)

2024-11-21 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/117187 None >From b5888f70bd1bbefc6a711ef2022478980ed2505f Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 21 Nov 2024 08:45:33 -0800 Subject: [PATCH] [rtsan] NFC: Update docs with suppress_equal_stacks --- cla

[clang] [llvm] AMDGPU: Define v_mfma_f32_{16x16x128|32x32x64}_f8f6f4 instructions (PR #116723)

2024-11-21 Thread Matt Arsenault via cfe-commits
@@ -15454,6 +15454,23 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI, MRI.setRegClass(Op.getReg(), NewRC); } + if (TII->isMAI(MI)) { +// The ordinary src0, src1, src2 were legalized above. +// +// We have to

[clang] clang: Relax LangOpts checks when lexing quoted numbers during preprocessing (PR #95798)

2024-11-21 Thread Jan Svoboda via cfe-commits
@@ -2068,7 +2068,8 @@ bool Lexer::LexNumericConstant(Token &Result, const char *CurPtr) { } // If we have a digit separator, continue. - if (C == '\'' && (LangOpts.CPlusPlus14 || LangOpts.C23)) { + if (C == '\'' && + (LangOpts.CPlusPlus14 || LangOpts.C23 || Parsing

[clang] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-21 Thread Scott Constable via cfe-commits
https://github.com/scottconstable edited https://github.com/llvm/llvm-project/pull/117121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] AMDGPU: Define v_mfma_f32_{16x16x128|32x32x64}_f8f6f4 instructions (PR #116723)

2024-11-21 Thread Matt Arsenault via cfe-commits
@@ -15454,6 +15454,23 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI, MRI.setRegClass(Op.getReg(), NewRC); } + if (TII->isMAI(MI)) { +// The ordinary src0, src1, src2 were legalized above. +// +// We have to

[clang] [llvm] AMDGPU: Define v_mfma_f32_{16x16x128|32x32x64}_f8f6f4 instructions (PR #116723)

2024-11-21 Thread Mariusz Sikora via cfe-commits
@@ -15454,6 +15454,23 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI, MRI.setRegClass(Op.getReg(), NewRC); } + if (TII->isMAI(MI)) { +// The ordinary src0, src1, src2 were legalized above. +// +// We have to

[clang-tools-extra] fd2e048 - [clang-tidy] ignore consteval function in `ExceptionAnalyzer` (#116643)

2024-11-21 Thread via cfe-commits
Author: Congcong Cai Date: 2024-11-22T05:01:49+08:00 New Revision: fd2e0483de089fb1459bf440d74e5b4e648a429f URL: https://github.com/llvm/llvm-project/commit/fd2e0483de089fb1459bf440d74e5b4e648a429f DIFF: https://github.com/llvm/llvm-project/commit/fd2e0483de089fb1459bf440d74e5b4e648a429f.diff

[clang-tools-extra] [clang-tidy] ignore consteval function in `ExceptionAnalyzer` (PR #116643)

2024-11-21 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 closed https://github.com/llvm/llvm-project/pull/116643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-21 Thread Scott Constable via cfe-commits
https://github.com/scottconstable edited https://github.com/llvm/llvm-project/pull/117121 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [X86] Enhance kCFI type IDs with a 3-bit arity indicator. (PR #117121)

2024-11-21 Thread Scott Constable via cfe-commits
scottconstable wrote: @phoebewang and @lvwr I also noticed that there is this code in LLVM: https://github.com/llvm/llvm-project/blob/9ba6672b9f0e82a1f6d4100dc832c84447ea545c/llvm/lib/Transforms/Utils/ModuleUtils.cpp#L202-L214. As far as I can tell, this code is not triggered when I build the L

[clang] [HLSL] Implement a header only distance intrinsic (PR #117240)

2024-11-21 Thread Farzon Lotfi via cfe-commits
https://github.com/farzonl created https://github.com/llvm/llvm-project/pull/117240 - For the HLSL intrinsic used `const inline` because that seems to be the pattern `countbits` - For the helper functions the pattern in `hlsl_detail.h` was to do `constexpr` like with `bit_cast` and `enable_

[clang] [clang][bytecode] Initialize bases when bitcasting (PR #117179)

2024-11-21 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/117179 >From 30d56c5522516e1d4b3fdb69c8aae67db8df5d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 8 Nov 2024 14:3

[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)

2024-11-21 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > But the list of tokens depends on things like what features are enabled, > right? e.g., `-fchar8_t` introduces a new keyword, while `_Atomic` isn't a > keyword in OpenCL, and `bool` is only a keyword in C23 and later but is > always a keyword in C++, etc. Ah, but in terms

[clang] [TBAA] Don't emit pointer tbaa for unnamed structs or unions. (PR #116596)

2024-11-21 Thread John McCall via cfe-commits
@@ -249,6 +249,21 @@ llvm::MDNode *CodeGenTBAA::getTypeInfoHelper(const Type *Ty) { if (!Ty->isRecordType()) return AnyPtr; + // For unnamed structs or unions C's compatible types rule applies. Two + // compatible types in different compilation units c

[clang] [llvm] Reland - [Driver][SYCL] Add initial SYCL offload compilation support … (PR #117268)

2024-11-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Michael Toguchi (mdtoguchi) Changes …(#107493) Introduces the SYCL based toolchain and initial toolchain construction when using the '-fsycl' option. This option will enable SYCL based offloading, creating a SPIR-V based IR file packaged

[clang-tools-extra] [clang-tidy] Enhance modernize-use-starts-ends-with to handle substr patterns (PR #116033)

2024-11-21 Thread Julian Schmidt via cfe-commits
@@ -240,6 +240,9 @@ void UseStartsEndsWithCheck::check(const MatchFinder::MatchResult &Result) { ReplacementFunction->getName()); // Replace arguments and everything after the function call. + if (FindExpr->getNumArgs() == 0) { +r

[clang] [llvm] Reland - [Driver][SYCL] Add initial SYCL offload compilation support … (PR #117268)

2024-11-21 Thread Michael Toguchi via cfe-commits
https://github.com/mdtoguchi created https://github.com/llvm/llvm-project/pull/117268 …(#107493) Introduces the SYCL based toolchain and initial toolchain construction when using the '-fsycl' option. This option will enable SYCL based offloading, creating a SPIR-V based IR file packaged into

[clang] [HLSL] Add ByteAddressBuffer definition to HLSLExternalSemaSource #113477 (PR #116699)

2024-11-21 Thread Helena Kotas via cfe-commits
@@ -1474,6 +1474,11 @@ DeclContext *DeclContext::getPrimaryContext() { case Decl::ObjCCategoryImpl: return this; + case Decl::CXXRecord: +if (auto *OPD = dyn_cast(this)) + if (auto *Def = OPD->getDefinition()) +return Def; +return this; default:

[clang] [Clang] Prevent potential null pointer dereferences (PR #117176)

2024-11-21 Thread via cfe-commits
@@ -627,7 +627,7 @@ class Analyzer { IsNoexcept = isNoexcept(FD); } else if (auto *BD = dyn_cast(D)) { if (auto *TSI = BD->getSignatureAsWritten()) { -auto *FPT = TSI->getType()->getAs(); +auto *FPT = TSI->getType()->castAs();

<    1   2   3   4   5   6