[clang] [llvm] Remove unused variable, and unneeded extract element instruction (PR #103489)

2024-08-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/103489 >From bb704124a6aa45fa733347ef24b5f9b462567b92 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 13 Aug 2024 17:06:28 -0700 Subject: [PATCH 1/2] remove unused var, and unneeded extract element --- llvm

[clang] [clang][driver] Fix -print-target-triple OS version for apple targets (PR #104037)

2024-08-14 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun updated https://github.com/llvm/llvm-project/pull/104037 From 3cb5a4539962fbdf11ccc07b9b1a8fa3bf2fec9a Mon Sep 17 00:00:00 2001 From: Gabor Horvath Date: Wed, 14 Aug 2024 16:17:40 +0100 Subject: [PATCH] Fix -print-target-triple OS version for apple targets The targ

[clang] [clang][driver] Fix -print-target-triple OS version for apple targets (PR #104037)

2024-08-14 Thread Gábor Horváth via cfe-commits
https://github.com/Xazax-hun ready_for_review https://github.com/llvm/llvm-project/pull/104037 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/104088 This allows annotating fields of C/C++ structs using API Notes. Previously API Notes supported Objective-C properties, but not fields. rdar://131548377 >From cefe51c59177d4c69a1d556408e6a69301c07326 Mon Sep

[clang] 6b652f6 - [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (#101585)

2024-08-14 Thread via cfe-commits
Author: Malavika Samak Date: 2024-08-14T10:45:43-07:00 New Revision: 6b652f6edaa84a9e4934885f6f12b973efb1b810 URL: https://github.com/llvm/llvm-project/commit/6b652f6edaa84a9e4934885f6f12b973efb1b810 DIFF: https://github.com/llvm/llvm-project/commit/6b652f6edaa84a9e4934885f6f12b973efb1b810.diff

[clang] [attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (PR #101585)

2024-08-14 Thread Malavika Samak via cfe-commits
https://github.com/malavikasamak closed https://github.com/llvm/llvm-project/pull/101585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Egor Zhdan (egorzhdan) Changes This allows annotating fields of C/C++ structs using API Notes. Previously API Notes supported Objective-C properties, but not fields. rdar://131548377 --- Patch is 22.46 KiB, truncated to 20.00 KiB below,

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/104088 >From 3e4c23b5cdfba147bf6598822ca4d9174c984a05 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 14 Aug 2024 18:37:25 +0100 Subject: [PATCH] [APINotes] Support fields of C/C++ structs This allows annotatin

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Saleem Abdulrasool via cfe-commits
@@ -858,6 +867,62 @@ void APINotesWriter::Implementation::writeCXXMethodBlock( } } +namespace { +/// Used to serialize the on-disk C field table. +class FieldTableInfo +: public VersionedTableInfo { +public: + unsigned getKeyLength(key_type_ref) { +return sizeof(ui

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Saleem Abdulrasool via cfe-commits
@@ -1252,6 +1282,81 @@ bool APINotesReader::Implementation::readCXXMethodBlock( return false; } +bool APINotesReader::Implementation::readFieldBlock( +llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl &Scratch) { + if (Cursor.EnterSubBlock(FIELD_BLOCK_ID)) +retur

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Saleem Abdulrasool via cfe-commits
@@ -793,6 +827,16 @@ class YAMLConverter { SwiftVersion); } + template + void convertVariable(const T &Entity, VariableInfo &VI) { compnerd wrote: I think that `computeVariableInfo` seems better - we are "hydrating" the variable

[clang] [Clang] Error on extraneous template headers by default. (PR #104046)

2024-08-14 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/104046 >From 5c724a55dda16dcf5dfd8e5be8c86001fa6c9fe7 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 14 Aug 2024 17:25:29 +0200 Subject: [PATCH 1/2] [Clang] Error on extraneous template headers by default.

[clang] 0dedd6f - [Clang] Adjust concept definition locus (#103867)

2024-08-14 Thread via cfe-commits
Author: cor3ntin Date: 2024-08-14T19:56:39+02:00 New Revision: 0dedd6fe1409ab02945bb5f903a23335aa79b590 URL: https://github.com/llvm/llvm-project/commit/0dedd6fe1409ab02945bb5f903a23335aa79b590 DIFF: https://github.com/llvm/llvm-project/commit/0dedd6fe1409ab02945bb5f903a23335aa79b590.diff LOG:

[clang] [Clang] Adjust concept definition locus (PR #103867)

2024-08-14 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/103867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] eae1d65 - [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (#102414)

2024-08-14 Thread via cfe-commits
Author: Joshua Batista Date: 2024-08-14T11:07:25-07:00 New Revision: eae1d65f3435b1399e1468cb27bfe745f95d4df2 URL: https://github.com/llvm/llvm-project/commit/eae1d65f3435b1399e1468cb27bfe745f95d4df2 DIFF: https://github.com/llvm/llvm-project/commit/eae1d65f3435b1399e1468cb27bfe745f95d4df2.diff

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

2024-08-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/102414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Check inline defs when emitting speculative vtable (PR #100785)

2024-08-14 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic approved this pull request. LGTM... but please consider submitting a patch to expand the explanation in ItaniumCXXABI::canSpeculativelyEmitVTableAsBaseClass. If I'm following correctly, the function in question is, in fact, odr-used in the translation unit in q

[clang] [clang][driver] Fix -print-target-triple OS version for apple targets (PR #104037)

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

[clang] [llvm] IR: Store the default subtarget info in named metadata instead of the context. (PR #98673)

2024-08-14 Thread Fangrui Song via cfe-commits
MaskRay wrote: @efriedma-quic Does this work for you? https://github.com/llvm/llvm-project/pull/98673 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank created https://github.com/llvm/llvm-project/pull/104148 `hasOperands` does not always execute matchers in the order they are written. This can cause issue in code using bindings when one operand matcher is relying on a binding set by the other. With this change, th

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Nicolas van Kempen (nicovank) Changes `hasOperands` does not always execute matchers in the order they are written. This can cause issue in code using bindings when one operand matcher is relying on a binding set by the other. With this c

[clang] 394162f - [Clang] Fix 'nvlink-wrapper' not ignoring `-plugin` like lld does (#104056)

2024-08-14 Thread via cfe-commits
Author: Joseph Huber Date: 2024-08-14T13:39:13-05:00 New Revision: 394162f356069ddccf1f941abf20959809644926 URL: https://github.com/llvm/llvm-project/commit/394162f356069ddccf1f941abf20959809644926 DIFF: https://github.com/llvm/llvm-project/commit/394162f356069ddccf1f941abf20959809644926.diff

[clang] [Clang] Fix 'nvlink-wrapper' not ignoring `-plugin` like lld does (PR #104056)

2024-08-14 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 closed https://github.com/llvm/llvm-project/pull/104056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 6429dd6935343b343ce3082c13e772425caea15a Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:47:52 -0400 Subject: [PATCH 1/2] [clang][ASTMatcher] Fix execution order of hasOperands

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 6429dd6935343b343ce3082c13e772425caea15a Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:47:52 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 3ee431b27ac1d20cc6446fc6a8c663f33dd17d12 Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:48:57 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #102364)

2024-08-14 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Boost/MPL 1.86.0 is now released! https://github.com/boostorg/mpl/releases/tag/boost-1.86.0 Thus I'm merging this patch, thanks for the reviews! I will keep an eye in case there's need for a revert. https://github.com/llvm/llvm-project/pull/102364 ___

[clang] 2dec83c - [clang] Turn -Wenum-constexpr-conversion into a hard error (#102364)

2024-08-14 Thread via cfe-commits
Author: Carlos Galvez Date: 2024-08-14T20:51:45+02:00 New Revision: 2dec83cc8e21a72e8718b5b3f009a19d6634fad3 URL: https://github.com/llvm/llvm-project/commit/2dec83cc8e21a72e8718b5b3f009a19d6634fad3 DIFF: https://github.com/llvm/llvm-project/commit/2dec83cc8e21a72e8718b5b3f009a19d6634fad3.diff

[clang] [clang] Turn -Wenum-constexpr-conversion into a hard error (PR #102364)

2024-08-14 Thread Carlos Galvez via cfe-commits
https://github.com/carlosgalvezp closed https://github.com/llvm/llvm-project/pull/102364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTMatcher] Fix execution order of hasOperands submatchers (PR #104148)

2024-08-14 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/104148 >From 168f812b5817ea2a9a80e0a6b52b2005e57d327c Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Wed, 14 Aug 2024 14:54:20 -0400 Subject: [PATCH] [clang][ASTMatcher] Fix execution order of hasOperands su

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert created https://github.com/llvm/llvm-project/pull/104168 As mentioned in #68706, it is useful to be able to call kernels from the runtime, e.g., to perform memset. This patch provides a kernel library that can be invoked from the offload runtime directly and implem

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Johannes Doerfert (jdoerfert) Changes As mentioned in #68706, it is useful to be able to call kernels from the runtime, e.g., to perform memset. This patch provides a kernel library that can be invoked from the offload runtime dire

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 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 d213981c80626698a07b11ce872acba098a863d4 defcf1effca6b441fc687477f406295601806163 --e

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
https://github.com/egorzhdan updated https://github.com/llvm/llvm-project/pull/104088 >From 1f41cef4dfbf19517c67586945ad9885f48a7150 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Wed, 14 Aug 2024 18:37:25 +0100 Subject: [PATCH] [APINotes] Support fields of C/C++ structs This allows annotatin

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
@@ -1252,6 +1282,81 @@ bool APINotesReader::Implementation::readCXXMethodBlock( return false; } +bool APINotesReader::Implementation::readFieldBlock( +llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl &Scratch) { + if (Cursor.EnterSubBlock(FIELD_BLOCK_ID)) +retur

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
@@ -858,6 +867,62 @@ void APINotesWriter::Implementation::writeCXXMethodBlock( } } +namespace { +/// Used to serialize the on-disk C field table. +class FieldTableInfo +: public VersionedTableInfo { +public: + unsigned getKeyLength(key_type_ref) { +return sizeof(ui

[clang] [APINotes] Support fields of C/C++ structs (PR #104088)

2024-08-14 Thread Egor Zhdan via cfe-commits
@@ -793,6 +827,16 @@ class YAMLConverter { SwiftVersion); } + template + void convertVariable(const T &Entity, VariableInfo &VI) { egorzhdan wrote: The existing methods that do the same thing for classes, methods, etc. are calle

[clang] [-Wunsafe-buffer-usage] Fix a small bug recently found (PR #102953)

2024-08-14 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/102953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [-Wunsafe-buffer-usage] Warning Libc functions (PR #101583)

2024-08-14 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ edited https://github.com/llvm/llvm-project/pull/101583 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] handle both gnu and cpp11 attributes to ensure correct parsing inside extern block (PR #102864)

2024-08-14 Thread Oleksandr T. via cfe-commits
https://github.com/a-tarasyuk updated https://github.com/llvm/llvm-project/pull/102864 >From b0e53b1c8a687165fa28bd21200f83bf1b1a9234 Mon Sep 17 00:00:00 2001 From: Oleksandr T Date: Mon, 12 Aug 2024 13:56:30 +0300 Subject: [PATCH 1/2] [Clang] handle both gnu and cpp11 attributes to ensure cor

[clang] [-Wunsafe-buffer-usage] Fix a small bug recently found (PR #102953)

2024-08-14 Thread Artem Dergachev via cfe-commits
https://github.com/haoNoQ approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/102953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/101802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll requested changes to this pull request. Thank you, this is moving in the right direction. You should also add an entry to potentially breaking section of release notes, because according to Hyrum's law, someone for sure depends on the current behavior of `SourceLocati

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Vlad Serebrennikov via cfe-commits
@@ -50,6 +50,18 @@ unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2) { loc1.int_data == loc2.int_data); } +unsigned clang_lessThanLocations(CXSourceLocation loc1, CXSourceLocation loc2) { + const SourceLocation Loc1 = SourceLocation::get

[clang] [Clang][Sema] Rebuild template parameters for out-of-line template definitions and partial specializations (PR #104030)

2024-08-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. LGTM As a note, it's helpful to pre-commit on an NFC patch all these test cases, and then on the main PR we can see just which test cases changed behavior. Which I see here are the three test cases at lines 76-78, 84-86, and 96-98. htt

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-14 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: I think serialization is missing for the new bit on BinaryOperator. I'm not sure why we're storing it in the first place, though; it's queried in exactly one place, so there isn't really any benefit to precomputing it. https://github.com/llvm/llvm-p

[clang] [llvm] [NVPTX] Add conversion intrinsics from/to fp8 types (e4m3, e5m2) (PR #102969)

2024-08-14 Thread Sergey Kozub via cfe-commits
https://github.com/sergey-kozub updated https://github.com/llvm/llvm-project/pull/102969 >From e74a0de37302baaf89bfe3230f561684ec5777db Mon Sep 17 00:00:00 2001 From: Sergey Kozub Date: Mon, 12 Aug 2024 12:52:01 -0700 Subject: [PATCH] [NVPTX] Add conversion intrinsics from/to fp8 types (e4m3,

[clang] [llvm] [NVPTX] Add conversion intrinsics from/to fp8 types (e4m3, e5m2) (PR #102969)

2024-08-14 Thread Sergey Kozub via cfe-commits
@@ -722,6 +722,37 @@ let hasSideEffects = false in { defm CVT_f16x2 : CVT_FROM_FLOAT_V2_SM80<"f16x2", Int32Regs>; defm CVT_bf16x2 : CVT_FROM_FLOAT_V2_SM80<"bf16x2", Int32Regs>; + + // FP8 conversions. + multiclass CVT_TO_F8X2 { +def _f32 : + NVPTXInst<(outs Int1

[clang] [llvm] [NVPTX] Add conversion intrinsics from/to fp8 types (e4m3, e5m2) (PR #102969)

2024-08-14 Thread Sergey Kozub via cfe-commits
https://github.com/sergey-kozub updated https://github.com/llvm/llvm-project/pull/102969 >From b74c8bc6009fb2f905089345594b13c8bc75ca36 Mon Sep 17 00:00:00 2001 From: Sergey Kozub Date: Mon, 12 Aug 2024 12:52:01 -0700 Subject: [PATCH] [NVPTX] Add conversion intrinsics from/to fp8 types (e4m3,

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-14 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov closed https://github.com/llvm/llvm-project/pull/102510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add frontend flag to enable support for broken external resugarers (PR #102510)

2024-08-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: Closed as completed elsewhere. https://github.com/llvm/llvm-project/pull/102510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-14 Thread Doug Wyatt via cfe-commits
@@ -0,0 +1,1199 @@ +//=== EffectAnalysis.cpp - Sema warnings for function effects -===// +// +// 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: A

[clang] [Clang] Add `__CLANG_GPU_DISABLE_MATH_WRAPPERS` macro for offloading math (PR #98234)

2024-08-14 Thread Joseph Huber via cfe-commits
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/98234 >From 902690cdfd3108babf0059098932c6b72c493a07 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 9 Jul 2024 17:17:39 -0500 Subject: [PATCH] [Clang] Add `__CLANG_GPU_DISABLE_MATH_WRAPPERS` macro for offloadi

[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)

2024-08-14 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: @zygoloid ping, this is ready for another look. https://github.com/llvm/llvm-project/pull/100692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Do not reason about locations passed as inline asm input (PR #103714)

2024-08-14 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/103714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/4] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
@@ -50,6 +50,18 @@ unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2) { loc1.int_data == loc2.int_data); } +unsigned clang_lessThanLocations(CXSourceLocation loc1, CXSourceLocation loc2) { + const SourceLocation Loc1 = SourceLocation::get

[clang] [Clang] Overflow Pattern Exclusions (PR #100272)

2024-08-14 Thread Justin Stitt via cfe-commits
JustinStitt wrote: > I think serialization is missing for the new bit on BinaryOperator. How do I add this? > I'm not sure why we're storing it in the first place, though; it's queried in > exactly one place, so there isn't really any benefit to precomputing it. It's queried when we check

[clang] [Clang][NFC] Move FindCountedByField into FieldDecl (PR #104235)

2024-08-14 Thread Bill Wendling via cfe-commits
https://github.com/bwendling created https://github.com/llvm/llvm-project/pull/104235 FindCountedByField can be used in more places than CodeGen. Move it into FieldDecl to avoid layering issues. >From a87bc65687b687073e8ff37606ca9e783f1edcf9 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date:

[clang] [Clang][NFC] Move FindCountedByField into FieldDecl (PR #104235)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Bill Wendling (bwendling) Changes FindCountedByField can be used in more places than CodeGen. Move it into FieldDecl to avoid layering issues. --- Full diff: https://github.com/llvm/llvm-project/pull/104235.diff 4 Files Affected: - (mo

[clang] [Clang][NFC] Move FindCountedByField into FieldDecl (PR #104235)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Bill Wendling (bwendling) Changes FindCountedByField can be used in more places than CodeGen. Move it into FieldDecl to avoid layering issues. --- Full diff: https://github.com/llvm/llvm-project/pull/104235.diff 4 Files Affected

[clang] [libclang/python] Fix bug in `SourceRange.__contains__`, add tests (PR #101802)

2024-08-14 Thread Jannick Kremer via cfe-commits
https://github.com/DeinAlptraum updated https://github.com/llvm/llvm-project/pull/101802 >From 572b1be0b204561fdbb049f0c17f065d17198ac0 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sat, 3 Aug 2024 09:28:02 +0100 Subject: [PATCH 1/4] [libclang/python] Fix bug in SourceRange.__contains__,

[clang] [llvm] [AMDGPU] Convert AMDGPUResourceUsageAnalysis pass from Module to MF pass (PR #102913)

2024-08-14 Thread Scott Linder via cfe-commits
slinder1 wrote: Is it best to leave comments on the commit from the PR comment, i.e. currently https://github.com/llvm/llvm-project/commit/51f72f115b340a092c2c9f8569911b944a4efb6d ? I can't seem to start a review, so it will be individual comments (I think). Is there another way to handle thi

[clang] [Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-14 Thread Bill Wendling via cfe-commits
https://github.com/bwendling updated https://github.com/llvm/llvm-project/pull/102549 >From 7ba43ae2b737fbd868848a23b58b3965f8d36ce1 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 6 Aug 2024 17:49:01 -0700 Subject: [PATCH 01/11] [WIP][Clang] Add __builtin_get_counted_by builtin The __

[clang] [Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-14 Thread Bill Wendling via cfe-commits
@@ -222,6 +222,49 @@ bool Expr::isFlexibleArrayMemberLike( IgnoreTemplateOrMacroSubstitution); } +namespace { + +/// MemberExprVisitor - Find the MemberExpr through all of the casts, array +/// subscripts, and unary ops. This intentiona

[clang] [Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-14 Thread Bill Wendling via cfe-commits
@@ -4678,6 +4678,19 @@ void FieldDecl::printName(raw_ostream &OS, const PrintingPolicy &Policy) const { DeclaratorDecl::printName(OS, Policy); } +const FieldDecl *FieldDecl::FindCountedByField() const { + const auto *CAT = getType()->getAs(); + if (!CAT) +return nullp

[clang] [Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-14 Thread Bill Wendling via cfe-commits
@@ -6590,8 +6590,34 @@ ExprResult Sema::BuildCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc, return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy, VK_PRValue, RParenLoc, CurFPFeatureOverrides()); } - return BuildResol

[clang] [Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-14 Thread Bill Wendling via cfe-commits
https://github.com/bwendling edited https://github.com/llvm/llvm-project/pull/102549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-14 Thread Bill Wendling via cfe-commits
@@ -222,6 +222,49 @@ bool Expr::isFlexibleArrayMemberLike( IgnoreTemplateOrMacroSubstitution); } +namespace { + +/// MemberExprVisitor - Find the MemberExpr through all of the casts, array +/// subscripts, and unary ops. This intentiona

[clang] [Clang] Add __builtin_get_counted_by builtin (PR #102549)

2024-08-14 Thread Bill Wendling via cfe-commits
https://github.com/bwendling commented: I made changes to use the CustomTypeChecking for the builtin. PTAL https://github.com/llvm/llvm-project/pull/102549 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/104239 This PR creates a new attribute in HLSL, "TextureDimension", which specifies the dimension of a specific texture resource. This PR is another necessary part of completing https://github.com/llvm/llvm-project/

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Joshua Batista (bob80905) Changes This PR creates a new attribute in HLSL, "TextureDimension", which specifies the dimension of a specific texture resource. This PR is another necessary part of completing https://github.com/llvm/llvm-pro

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/104239 >From aaa455933d3703b84634703fd4fcb5c815aa139e Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 14 Aug 2024 14:02:22 -0700 Subject: [PATCH 1/2] create texture dimension attr --- clang/include/clang/Ba

[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

2024-08-14 Thread Justin Stitt via cfe-commits
JustinStitt wrote: A good example of a Linux kernel contributor running into an overflow that should really have its type marked as wrapping : https://lore.kernel.org/all/zrzk8hiladaj+...@gmail.com/ They could use this feature to mark the suspected field `percpu_ref->percpu_ref_data->count` a

[clang] [llvm] [NVPTX] Add conversion intrinsics from/to fp8 types (e4m3, e5m2) (PR #102969)

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

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-14 Thread Justin Bogner via cfe-commits
bogner wrote: What is this attribute supposed to mean? I think we need some design here before we create the attribute, as it isn't clear to me that a single integer covers our needs. The texture kinds that need to be representable by this and whatever other attributes we design are 1D, 2D, 3D

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer", we use a substitute UDT +// to test the 't' binding type for this test. + +template +struct [[hlsl::resource_class(SRV)]] Buffer { --

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -38,6 +38,14 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, HLSLBufferDecl *Result = HLSLBufferDecl::Create( getASTContext(), LexicalParent, CBuffer, KwLoc, Ident, IdentLoc, LBrace); + auto RC = CBuffer ? llvm::hlsl::ResourceClass::CBuffer +

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer", we use a substitute UDT +// to test the 't' binding type for this test. + +template +struct [[hlsl::resource_class(SRV)]] Buffer { +

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; + RWBuffer RWBuf; + }; +Eg1 e1 : /* register(t0) :*/ register(u0); +// Valid: f is skip

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer", we use a substitute UDT +// to test the 't' binding type for this test. + +template +struct [[hlsl::resource_class(SRV)]] Buffer { +

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -492,14 +999,21 @@ void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { // Validate. if (!Slot.empty()) { switch (Slot[0]) { damyanp wrote: Can `getRegisterTypeIndex` be reused here? Seems like there's more than one table of

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 Thread Johannes Doerfert via cfe-commits
https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/104168 >From 9e529ede3a97513ec0afee6c4538e7299d2933f0 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Mon, 12 Aug 2024 11:53:06 -0700 Subject: [PATCH] [Offload] Provide a kernel library useable by the offload

[clang] [llvm] Remove unused variable, and unneeded extract element instruction (PR #103489)

2024-08-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/103489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 Thread Joseph Huber via cfe-commits
@@ -392,25 +392,52 @@ EXTERN void *omp_target_memset(void *Ptr, int ByteVal, size_t NumBytes, DP("filling memory on host via memset"); memset(Ptr, ByteVal, NumBytes); // ignore return value, memset() cannot fail } else { -// TODO: replace the omp_target_memset()

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 Thread Joseph Huber via cfe-commits
@@ -0,0 +1,53 @@ +//===-- Kenrels/Memory.cpp - Memory related kernel definitions ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 Thread Joseph Huber via cfe-commits
@@ -1533,6 +1533,55 @@ Error GenericDeviceTy::printInfo() { return Plugin::success(); } +Expected +GenericDeviceTy::getKernel(llvm::StringRef Name, DeviceImageTy *ImagePtr) { + + GenericKernelTy *&KernelPtr = KernelMap[Name]; + if (!KernelPtr) { jhuber6 wr

[clang] [llvm] [Offload] Provide a kernel library useable by the offload runtime (PR #104168)

2024-08-14 Thread Johannes Doerfert via cfe-commits
@@ -392,25 +392,52 @@ EXTERN void *omp_target_memset(void *Ptr, int ByteVal, size_t NumBytes, DP("filling memory on host via memset"); memset(Ptr, ByteVal, NumBytes); // ignore return value, memset() cannot fail } else { -// TODO: replace the omp_target_memset()

<    1   2   3   4   5   >