[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-19 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,1242 @@ +//===-- SPIRVStructurizer.cpp --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH

[clang-tools-extra] 5fa742e - [clang-tidy][NFC] add qutation mark for C++ classes in warning message (#109068)

2024-09-19 Thread via cfe-commits
Author: Congcong Cai Date: 2024-09-19T22:46:16+08:00 New Revision: 5fa742eeed0821baf864d23f237ff1b481e1ae11 URL: https://github.com/llvm/llvm-project/commit/5fa742eeed0821baf864d23f237ff1b481e1ae11 DIFF: https://github.com/llvm/llvm-project/commit/5fa742eeed0821baf864d23f237ff1b481e1ae11.diff

[clang] [clang-tools-extra] Remove clang-pseudo (PR #109154)

2024-09-19 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `clang-aarch64-sve-vla-2stage` running on `linaro-g3-02` while building `clang-tools-extra,clang` at step 11 "build stage 2". Full details are available at: https://lab.llvm.org/buildbot/#/builders/41/builds/2164 Here is the

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-19 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-19 Thread Dmitry Polukhin via cfe-commits
dmpolukhin wrote: With DeclContext visitor collectLambdas takes 0.03% or smaller, sometime I don't even see it in sampling profile. https://github.com/llvm/llvm-project/pull/109167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-09-19 Thread Zibi Sarbinowski via cfe-commits
@@ -70,6 +70,11 @@ class FileEntryRef { const FileEntry &getFileEntry() const { return *getBaseMapEntry().second->V.get(); } +#ifdef __MVS__ zibi2 wrote: I wonder if we can remove this conditional compilation guard and defined this non-const function

[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-09-19 Thread Zibi Sarbinowski via cfe-commits
@@ -617,6 +625,23 @@ FileID SourceManager::createFileIDImpl(ContentCache &File, StringRef Filename, return FileID::get(LoadedID); } unsigned FileSize = File.getSize(); +#ifdef __MVS__ + llvm::ErrorOr NeedConversion = + llvm::needzOSConversion(Filename.str().c_str

[clang] [clang] fix the unexpected control flow in ParseTentative.cpp (PR #109298)

2024-09-19 Thread via cfe-commits
cor3ntin wrote: Do we have a test for this? https://github.com/llvm/llvm-project/pull/109298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] [mlir] [APInt] Assert correct values in APInt constructor (PR #80309)

2024-09-19 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/80309 >From f47b38cd26107108f082df437196832fbe9ad78d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 19 Sep 2024 17:27:13 +0200 Subject: [PATCH] apint only --- clang/lib/AST/ByteCode/IntegralAP.h | 6

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Craig Topper via cfe-commits
@@ -3664,12 +3680,18 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && (Offset <= -2048 || Offset >= 2048)) { topperc wrote: Ok. If t

[clang] [llvm] [X86][AVX10.2] Support AVX10.2 MOVZXC new Instructions. (PR #108537)

2024-09-19 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lld-x86_64-win` running on `as-worker-93` while building `clang,llvm` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/1186 Here is the releva

[clang] Add missing deps edge: CodeGenAction.cpp.o -> GenVT.inc (PR #109306)

2024-09-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-codegen Author: Evan Wilde (etcwilde) Changes CodeGenAction.cpp.o depends on generating GenVT.inc before trying to compile it through the following header chain: ``` GenVT.inc MachineValueType.h LowLevelType.h MachineMe

[clang] Add missing deps edge: CodeGenAction.cpp.o -> GenVT.inc (PR #109306)

2024-09-19 Thread Saleem Abdulrasool via cfe-commits
https://github.com/compnerd approved this pull request. https://github.com/llvm/llvm-project/pull/109306 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Driver][AArch64] Add support for aarch64-amazon-linux triple (PR #109263)

2024-09-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: > The behviour was diverged between X86 and aarch64: prior to this patch, a > standard clang with no configuration works on x86 but not aarch64 amazon > linux; the latter fails to find C++ headers and libraries. This is not an issue of the source code. The system needs to do `-

[clang] [Clang][Driver][AArch64] Add support for aarch64-amazon-linux triple (PR #109263)

2024-09-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. . https://github.com/llvm/llvm-project/pull/109263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][bytecode] Implement arithmetic, bitwise and compound assignment operator (PR #108949)

2024-09-19 Thread Timm Baeder via cfe-commits
tbaederr wrote: Does it work to _not_ discard the result of a compound operator? ```c++ using VI __attribute__((ext_vector_type(4))) = int; constexpr int a() { VI a = {0, 0, 0, 0}; VI b = {1,1,1,1}; VI C = (a += b); return 0; } static_assert(a() == 0); ``` https://github.c

[clang] Add missing deps edge: CodeGenAction.cpp.o -> GenVT.inc (PR #109306)

2024-09-19 Thread Evan Wilde via cfe-commits
https://github.com/etcwilde created https://github.com/llvm/llvm-project/pull/109306 CodeGenAction.cpp.o depends on generating GenVT.inc before trying to compile it through the following header chain: ``` GenVT.inc MachineValueType.h LowLevelType.h MachineMemOperand.h MachineInstr.h MachineBas

[clang-tools-extra] [clang-tidy][readability-container-contains] Use hasOperands when possible (PR #109178)

2024-09-19 Thread Nicolas van Kempen via cfe-commits
https://github.com/nicovank updated https://github.com/llvm/llvm-project/pull/109178 >From 3f5df5d8299a48fe0bf919cd2d52eaa195b1e8ce Mon Sep 17 00:00:00 2001 From: Nicolas van Kempen Date: Thu, 19 Sep 2024 12:35:47 -0400 Subject: [PATCH] [clang-tidy][readability-container-contains] Use hasOperan

[clang] [flang] [mlir] [clang][flang][mlir] Support -frecord-command-line option (PR #102975)

2024-09-19 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > As you are renaming functions, you can fix the function naming style > `tools::function` instead of `tools::Function`. While the style is largely > inconsistent, we usually fix the style while renaming functions. I will do that and merge. Thanks! https://github.com/llvm/l

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang] [flang] [mlir] [clang][flang][mlir] Support -frecord-command-line option (PR #102975)

2024-09-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM. As you are renaming functions, you can fix the function naming style `tools::function` instead of `tools::Function`. While the style is largely inconsistent, we usually fix the style while renaming functions. https://github.com/llvm

[clang] [Clang] prevented assertion failure by handling integral to boolean conversions for boolean vectors (PR #108657)

2024-09-19 Thread Aaron Ballman via cfe-commits
@@ -51,6 +53,9 @@ static void test(void) { ivec4 -= ivec4; ivec4 |= ivec4; ivec4 += ptr; // expected-error {{cannot convert between vector and non-scalar values ('int4' (vector of 4 'int' values) and 'int *')}} + +bvec4 != 0; // expected-warning {{inequality co

[clang] [llvm] Update llvm::Registry to work for LLVM shared library builds on windows (PR #109024)

2024-09-19 Thread Thomas Fransham via cfe-commits
https://github.com/fsfod updated https://github.com/llvm/llvm-project/pull/109024 >From fcb6837e5c6ff48bf261bae9d3cedda55da89a7e Mon Sep 17 00:00:00 2001 From: Thomas Fransham Date: Wed, 28 Aug 2024 16:08:52 +0100 Subject: [PATCH 1/3] Update llvm::Registry to work for LLVM shared library build

[clang] [Clang][Driver][AArch64] Add support for aarch64-amazon-linux triple (PR #109263)

2024-09-19 Thread Peter Waller via cfe-commits
peterwaller-arm wrote: > The CMake build system could be adjusted to make > -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-amazon-linux implied on Amazon Linux, > though. Thanks - Is there precedence for this? Do you have any ideas about how to detect the correct default triple? https://github.com/llv

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-09-19 Thread via cfe-commits
@@ -1289,6 +1299,14 @@ static bool runImpl(Function &F, LazyValueInfo *LVI, DominatorTree *DT, FnChanged |= BBChanged; } + // Infer range attribute on return value. + if (RetRange && !RetRange->isFullSet()) { +Attribute RangeAttr = F.getRetAttribute(Attribute::Ran

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-09-19 Thread via cfe-commits
@@ -1289,6 +1299,14 @@ static bool runImpl(Function &F, LazyValueInfo *LVI, DominatorTree *DT, FnChanged |= BBChanged; } + // Infer range attribute on return value. + if (RetRange && !RetRange->isFullSet()) { +Attribute RangeAttr = F.getRetAttribute(Attribute::Ran

[clang] [clang-scan-deps] Don't inspect Args[0] as an option (PR #109050)

2024-09-19 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 approved this pull request. https://github.com/llvm/llvm-project/pull/109050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver] Add a custom error option in multilib.yaml. (PR #105684)

2024-09-19 Thread Petr Hosek via cfe-commits
petrhosek wrote: > To be clear, are you asking _me_ to make a followup PR to change that > identifier in this already-landed patch, or are you going to do it? > > (Just to avoid the situation where both of us do it, or both of us think the > other is going to) If you have time to implement it

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

2024-09-19 Thread Erich Keane via cfe-commits
@@ -1419,6 +1419,35 @@ is not specified. }]; } +def ExplicitInitDocs : Documentation { erichkeane wrote: This is a little lacking for me? Semantics, limitations, examples of how this is intended to be used, warnings about 'make sure you own the type' sort

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

2024-09-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane 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] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

2024-09-19 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I think this needs to work in C as well, and we should have tests for that too. I see this as more useful in C than C++, and there isn't a good reason to restrict it. Also, needs a release note. https://github.com/llvm/llvm-project/pull/102040 ___

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

2024-09-19 Thread Erich Keane via cfe-commits
@@ -119,6 +119,15 @@ FIELD(HasInitMethod, 1, NO_MERGE) /// within anonymous unions or structs. FIELD(HasInClassInitializer, 1, NO_MERGE) +/// Custom attribute that is True if any field is marked as requiring explicit +/// initialization with [[clang::requires_explicit_initiali

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

2024-09-19 Thread Erich Keane via cfe-commits
@@ -6014,6 +6014,10 @@ static void handleNoMergeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(NoMergeAttr::Create(S.Context, AL)); } +static void handleExplicitInitAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + D->addAttr(ExplicitInitAttr::Create(S.Context, A

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

2024-09-19 Thread Erich Keane via cfe-commits
@@ -81,6 +82,7 @@ CXXRecordDecl::DefinitionData::DefinitionData(CXXRecordDecl *D) HasPrivateFields(false), HasProtectedFields(false), HasPublicFields(false), HasMutableFields(false), HasVariantMembers(false), HasOnlyCMembers(true), HasInitMethod(false), Has

[clang] [llvm] [clang][OpenMP] Add codegen for scope directive (PR #109197)

2024-09-19 Thread Alexey Bataev via cfe-commits
https://github.com/alexey-bataev approved this pull request. LG https://github.com/llvm/llvm-project/pull/109197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

2024-09-19 Thread Richard Smith via cfe-commits
@@ -1306,3 +1306,18 @@ constexpr int field(int a) { static_assert(field(3), ""); // expected-error {{constant expression}} \ // expected-note {{in call to 'field(3)'}} } + +namespace literal_comparison { + +constexpr bool different_in_loop(bool b =

[clang] [Clang][NFC] Remove incorrect SYCL tests (PR #109182)

2024-09-19 Thread via cfe-commits
https://github.com/elizabethandrews updated https://github.com/llvm/llvm-project/pull/109182 >From de0278d21e737c7ac8cd0165f05484c40aeb46fa Mon Sep 17 00:00:00 2001 From: Elizabeth Andrews Date: Wed, 18 Sep 2024 12:34:06 -0700 Subject: [PATCH 1/3] [Clang][NFC] Remove incorrect SYCL tests The t

[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

2024-09-19 Thread Richard Smith via cfe-commits
https://github.com/zygoloid updated https://github.com/llvm/llvm-project/pull/109208 >From 81193568c17a89f6cf42f43a82fb1fbf0f90184d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 18 Sep 2024 21:59:56 + Subject: [PATCH 1/4] Implement current CWG direction for string literal compari

[clang] [llvm] [Loads] Check context instruction for context-sensitive derefability (PR #109277)

2024-09-19 Thread Thorsten Schütt via cfe-commits
@@ -104,6 +104,17 @@ static bool isDereferenceableAndAlignedPointer( if (CheckForNonNull && !isKnownNonZero(V, SimplifyQuery(DL, DT, AC, CtxI))) return false; +// When using something like !dereferenceable on a load, the +// dereferenceability may only

[clang] [PAC] Re-sign a pointer to a noexcept member function when it is converted to a pointer to a member function without noexcept (PR #109056)

2024-09-19 Thread John McCall via cfe-commits
@@ -2419,8 +2419,13 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return Visit(const_cast(E)); case CK_NoOp: { -return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE) - : Visit(const_cast(E)); +i

[clang] [PAC] Re-sign a pointer to a noexcept member function when it is converted to a pointer to a member function without noexcept (PR #109056)

2024-09-19 Thread John McCall via cfe-commits
https://github.com/rjmccall edited https://github.com/llvm/llvm-project/pull/109056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

2024-09-19 Thread Richard Smith via cfe-commits
https://github.com/zygoloid updated https://github.com/llvm/llvm-project/pull/109208 >From 81193568c17a89f6cf42f43a82fb1fbf0f90184d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 18 Sep 2024 21:59:56 + Subject: [PATCH 1/5] Implement current CWG direction for string literal compari

[clang] [HLSL][NFC] Update resource attribute tests (PR #108919)

2024-09-19 Thread Helena Kotas via cfe-commits
@@ -29,15 +29,21 @@ RWBuffer Buffer; // CHECK-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <> implicit class RWBuffer definition // CHECK: FinalAttr 0x{{[0-9A-Fa-f]+}} <> Implicit final -// CHECK-NEXT: implicit h 'element_type * {{\[\[}}hlsl::resource_class(UAV)]] {{\[\[}}hlsl::co

[clang] [HLSL][NFC] Update resource attribute tests (PR #108919)

2024-09-19 Thread Helena Kotas via cfe-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/108919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 7586aea - [HLSL][NFC] Update resource attribute tests (#108919)

2024-09-19 Thread via cfe-commits
Author: Helena Kotas Date: 2024-09-19T10:40:12-07:00 New Revision: 7586aea9edd324a6d2806e5cb879456a978f61e0 URL: https://github.com/llvm/llvm-project/commit/7586aea9edd324a6d2806e5cb879456a978f61e0 DIFF: https://github.com/llvm/llvm-project/commit/7586aea9edd324a6d2806e5cb879456a978f61e0.diff

[clang] cead904 - [clang-scan-deps] Don't inspect Args[0] as an option (#109050)

2024-09-19 Thread via cfe-commits
Author: Martin Storsjö Date: 2024-09-19T20:46:09+03:00 New Revision: cead9044a995910306e2e64b426fcc8042d7e0ef URL: https://github.com/llvm/llvm-project/commit/cead9044a995910306e2e64b426fcc8042d7e0ef DIFF: https://github.com/llvm/llvm-project/commit/cead9044a995910306e2e64b426fcc8042d7e0ef.diff

[clang] [clang-scan-deps] Don't inspect Args[0] as an option (PR #109050)

2024-09-19 Thread Martin Storsjö via cfe-commits
https://github.com/mstorsjo closed https://github.com/llvm/llvm-project/pull/109050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Remove incorrect SYCL tests (PR #109182)

2024-09-19 Thread via cfe-commits
elizabethandrews wrote: > Ah, I remember now why the SYCL flag / mode was abused here (the default AS > Map for SPIR-V is problematic in this case); I believe that using the > `spirv64-amd-amdhsa` triple instead of `spirv64-unknown-unknown` will work, > and allow for the removal of the SYCL re

[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

2024-09-19 Thread Richard Smith via cfe-commits
@@ -2142,11 +2150,81 @@ static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) { return LVal.Base.dyn_cast(); } -static bool IsLiteralLValue(const LValue &Value) { - if (Value.getLValueCallIndex()) +// Information about an LValueBase that is some kind of string. +st

[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

2024-09-19 Thread Erich Keane via cfe-commits
@@ -2142,11 +2150,81 @@ static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) { return LVal.Base.dyn_cast(); } -static bool IsLiteralLValue(const LValue &Value) { - if (Value.getLValueCallIndex()) +// Information about an LValueBase that is some kind of string. +st

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
@@ -183,6 +183,10 @@ Changes in existing checks ` check to remove `->`, when redundant `get()` is removed. +- Improved :doc:`modernize-use-nullptr + ` check to also recognize + `NULL`/`__null` (but not `0`) when used with a templated type. tkoeppe wrote:

[clang] [SystemZ][z/OS] Implement z/OS XPLINK ABI (PR #101024)

2024-09-19 Thread Abhina Sree via cfe-commits
@@ -532,9 +532,371 @@ bool SystemZTargetCodeGenInfo::isVectorTypeBased(const Type *Ty, return false; } +//===--===// +// z/OS XPLINK ABI Implementation +//===

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
https://github.com/tkoeppe updated https://github.com/llvm/llvm-project/pull/109169 From 2e1e6b573aaee9a528c0a5af79c65f4cba94bcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 18 Sep 2024 17:04:44 + Subject: [PATCH] [clang-tidy] Make modernize-use-nullptr matcher

[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

2024-09-19 Thread Richard Smith via cfe-commits
@@ -2142,11 +2150,81 @@ static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) { return LVal.Base.dyn_cast(); } -static bool IsLiteralLValue(const LValue &Value) { - if (Value.getLValueCallIndex()) +// Information about an LValueBase that is some kind of string. +st

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Florian Mayer via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
https://github.com/tkoeppe updated https://github.com/llvm/llvm-project/pull/109169 From 386d94da472178be9cdc6f5f3720be431d0744e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 18 Sep 2024 17:04:44 + Subject: [PATCH] [clang-tidy] Make modernize-use-nullptr matcher

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
https://github.com/tkoeppe updated https://github.com/llvm/llvm-project/pull/109169 From a7ea1466bb42d701f834c984b3225120666ad4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 18 Sep 2024 17:04:44 + Subject: [PATCH] [clang-tidy] Make modernize-use-nullptr matcher

[clang] [clang] implement current direction of CWG2765 for string literal comparisons in constant evaluation (PR #109208)

2024-09-19 Thread Erich Keane via cfe-commits
@@ -2142,11 +2150,81 @@ static const ValueDecl *GetLValueBaseDecl(const LValue &LVal) { return LVal.Base.dyn_cast(); } -static bool IsLiteralLValue(const LValue &Value) { - if (Value.getLValueCallIndex()) +// Information about an LValueBase that is some kind of string. +st

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
@@ -84,6 +84,28 @@ void test_macro_expansion4() { #undef MY_NULL } +template struct pear { + // If you say __null (or NULL), we assume that T will always be a pointer + // type, so we suggest replacing it with nullptr. + void f() { x = __null; } + // CHECK-MESSAGES: :[[@L

[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-19 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thanks for the fix! The changes should also come with a release note so users know about the improvement. Otherwise, changes basically LG modulo nits. https://github.com/llvm/llvm-project/pull/108475 ___ cfe-

[clang-tools-extra] [clang-tidy][readability-container-contains] Use hasOperands when possible (PR #109178)

2024-09-19 Thread via cfe-commits
@@ -167,7 +167,8 @@ Changes in existing checks - Improved :doc:`readability-container-contains ` check to let it work on - any class that has a ``contains`` method. + any class that has a ``contains`` method. Also now match previously missing EugeneZelenko

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-09-19 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/99620 >From 46ab5f809414b3f06ab9956e0fc6910284417b6d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 19 Jul 2024 11:02:56 +0200 Subject: [PATCH 1/2] [CVP] Infer range return attribute We already infer this in IPSC

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
https://github.com/tkoeppe updated https://github.com/llvm/llvm-project/pull/109169 From 6077d493dfe2cbfa053a155c562475b3b41ed007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 18 Sep 2024 17:04:44 + Subject: [PATCH] [clang-tidy] Make modernize-use-nullptr matcher

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
tkoeppe wrote: Done! https://github.com/llvm/llvm-project/pull/109169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SystemZ][z/OS] Implement z/OS XPLINK ABI (PR #101024)

2024-09-19 Thread Abhina Sree via cfe-commits
@@ -532,9 +532,371 @@ bool SystemZTargetCodeGenInfo::isVectorTypeBased(const Type *Ty, return false; } +//===--===// +// z/OS XPLINK ABI Implementation +//===

[clang] [SystemZ][z/OS] Implement z/OS XPLINK ABI (PR #101024)

2024-09-19 Thread Abhina Sree via cfe-commits
https://github.com/abhina-sree deleted https://github.com/llvm/llvm-project/pull/101024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy][NFC] add qutation mark for C++ classes in warning message (PR #109068)

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

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-19 Thread Nathan Gauër via cfe-commits
@@ -0,0 +1,1242 @@ +//===-- SPIRVStructurizer.cpp --*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH

[clang] [clang][wasm] Replace the target integer add saturate intrinsics with the equivalent generic `__builtin_elementwise_add_sat` intrinsics (PR #109269)

2024-09-19 Thread Simon Pilgrim via cfe-commits
https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/109269 >From 97dd8d7e892203e6073ebab271967e743fe194fa Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 19 Sep 2024 11:37:46 +0100 Subject: [PATCH] [clang][wasm] Replace the target integer add saturate intrinsic

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-19 Thread Michal Paszkowski via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Na

[clang] [compiler-rt] [llvm] [FMV][AArch64] Unify ls64, ls64_v and ls64_accdata. (PR #108024)

2024-09-19 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea updated https://github.com/llvm/llvm-project/pull/108024 >From b6abb4f0fcf50d7498a6f0d0ef8b75808c8b1eb1 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Tue, 10 Sep 2024 14:02:17 +0100 Subject: [PATCH 1/2] [FMV][AArch64] Unify ls64, ls64_v and ls64_accdata.

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread via cfe-commits
EugeneZelenko wrote: Please mention changes in Release Notes. https://github.com/llvm/llvm-project/pull/109169 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Lifetime of locals must end before musttail call (PR #109255)

2024-09-19 Thread Oliver Stannard via cfe-commits
https://github.com/ostannard updated https://github.com/llvm/llvm-project/pull/109255 >From 85ac319257785f88fd27a533fffde7aab20c8d8d Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Wed, 18 Sep 2024 16:22:41 +0100 Subject: [PATCH 1/3] [clang] Lifetime of locals must end before musttail call

[clang] [clang][OpenMP] Add AST nodes for opaque block/loop directives (PR #109286)

2024-09-19 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 b1b436c108101f31b27eedb3a9591b7a02e0bc6e bba25fe832489086d6a0b63c399c82057e1d3cfc --e

[clang] [AST] Iterate redecls starting from the canonical one in getRawCommentsForAnyRedecl() (PR #108475)

2024-09-19 Thread Aaron Ballman via cfe-commits
@@ -440,14 +440,23 @@ const RawComment *ASTContext::getRawCommentForAnyRedecl( // Any redeclarations of D that we haven't checked for comments yet? // We can't use DenseMap::iterator directly since it'd get invalid. - auto LastCheckedRedecl = [this, CanonicalD]() -> const

[clang] [llvm] [LV] Mask off possibly aliasing vector lanes (PR #100579)

2024-09-19 Thread Sam Tebbs via cfe-commits
@@ -2725,9 +2725,17 @@ class VPAliasLaneMaskRecipe : public VPSingleDefRecipe { /// Get the VPValue* for the pointer being read from VPValue *getSourceValue() const { return getOperand(0); } + // Get the size of the element(s) accessed by the pointers + unsigned getAcces

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-19 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-19 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-19 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-19 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-19 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang-tools-extra] [clang-tidy] Add new check bugprone-tagged-union-member-count (PR #89925)

2024-09-19 Thread Congcong Cai via cfe-commits
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= , =?utf-8?b?R8OhYm9yIFTDs3Ro

[clang] [clang] fix the unexpected controlflow in `ParseTentative.cpp` (PR #95917)

2024-09-19 Thread Nikita Popov via cfe-commits
nikic wrote: FWIW, I think it would be fine to just merge this PR as-is without a test case. It seems pretty clear that this was the original intention of the code. https://github.com/llvm/llvm-project/pull/95917 ___ cfe-commits mailing list cfe-commi

[clang] 1412022 - Target ABI: improve call parameters extensions handling (#100757)

2024-09-19 Thread via cfe-commits
Author: Jonas Paulsson Date: 2024-09-19T16:59:31+02:00 New Revision: 14120227a34365e829d05c1413033d235d7d272c URL: https://github.com/llvm/llvm-project/commit/14120227a34365e829d05c1413033d235d7d272c DIFF: https://github.com/llvm/llvm-project/commit/14120227a34365e829d05c1413033d235d7d272c.diff

[clang] [llvm] target ABI: improve call parameters extensions handling (PR #100757)

2024-09-19 Thread Jonas Paulsson via cfe-commits
https://github.com/JonPsson1 closed https://github.com/llvm/llvm-project/pull/100757 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [SystemZ][z/OS] Implement z/OS XPLINK ABI (PR #101024)

2024-09-19 Thread Ulrich Weigand via cfe-commits
@@ -532,9 +532,371 @@ bool SystemZTargetCodeGenInfo::isVectorTypeBased(const Type *Ty, return false; } +//===--===// +// z/OS XPLINK ABI Implementation +//===

[clang] [C++20][Modules] Fix crash when function and lambda inside loaded from different modules (PR #109167)

2024-09-19 Thread Dmitry Polukhin via cfe-commits
https://github.com/dmpolukhin updated https://github.com/llvm/llvm-project/pull/109167 >From 72b43bd2f392a009187e1cdd90627691a4017707 Mon Sep 17 00:00:00 2001 From: Dmitry Polukhin Date: Wed, 18 Sep 2024 09:02:23 -0700 Subject: [PATCH 1/3] [C++20][Modules] Fix crash when function and lambda in

[clang] [llvm] [clang][OpenMP] Add codegen for scope directive (PR #109197)

2024-09-19 Thread David Pagan via cfe-commits
@@ -0,0 +1,2267 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filechec

[clang] [llvm] [RISCV][VCIX] Add vcix_state to GNU inline assembly register set (PR #106914)

2024-09-19 Thread Michal Terepeta via cfe-commits
@@ -44,7 +44,7 @@ ArrayRef RISCVTargetInfo::getGCCRegNames() const { "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", // CSRs - "fflags", "frm", "vtype", "vl", "vxsat", "vxrm" + "fflags", "frm", "vtype", "vl", "vxsat", "vxrm", "sf_vcix_state"

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-19 Thread Congcong Cai via cfe-commits
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/109302 Refactor matches to give more generic checker. >From cc2c798193722b3a537c76e74981ff767d064efa Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 19 Sep 2024 23:46:16 +0800 Subject: [PATCH] [clang-tidy]

[clang-tools-extra] [clang-tidy][bugprone-posix-return] support integer literals as LHS (PR #109302)

2024-09-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Congcong Cai (HerrCai0907) Changes Refactor matches to give more generic checker. --- Full diff: https://github.com/llvm/llvm-project/pull/109302.diff 3 Files Affected: - (modified) clang-tools-extra/clang-tidy/bugprone/Pos

[clang] [lld] [llvm] [mlir] [IR] Introduce `T` to `DataLayout` to represent flat address space if a target supports it (PR #108786)

2024-09-19 Thread Alex Voicu via cfe-commits
AlexVlx wrote: > +1 to @efriedma-quic and @jdoerfert's comments. DataLayout should remain as > generic as possible. Trying to encode a concept of "_the_ flat address space" > in it seems way too specific to one optimization for one or two targets. This isn't purely a nice to have optimisation

[clang-tools-extra] [clang-tidy] modernize-use-nullptr matches "NULL" in templates (PR #109169)

2024-09-19 Thread Thomas Köppe via cfe-commits
@@ -183,6 +183,10 @@ Changes in existing checks ` check to remove `->`, when redundant `get()` is removed. +- Improved :doc:`modernize-use-nullptr tkoeppe wrote: Oh I see, I didn't realize there was such an ordering. Done. https://github.com/llvm/llvm-pr

[clang] [llvm] [SPIR-V] Add SPIR-V structurizer (PR #107408)

2024-09-19 Thread Nathan Gauër via cfe-commits
Keenuts wrote: rebased. Will merge tomorrow morning if CI is green. https://github.com/llvm/llvm-project/pull/107408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From a295c6d8057ddd712097e3bf659cdbe3bb4ec869 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/3] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [compiler-rt] [llvm] [AArch64] Split FeatureMTE to FEAT_MTE and FEAT_MTE2. (PR #109299)

2024-09-19 Thread Alexandros Lamprineas via cfe-commits
https://github.com/labrinea created https://github.com/llvm/llvm-project/pull/109299 These extensions depend on each other as follows: mte -> mte2 Currently in LLVM FeatureMTE models both FEAT_MTE and FEAT_MTE2 lumped together. However the architecture does not mandate that both need to be im

[clang] [compiler-rt] [llvm] [AArch64] Split FeatureMTE to FEAT_MTE and FEAT_MTE2. (PR #109299)

2024-09-19 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-aarch64 @llvm/pr-subscribers-clang Author: Alexandros Lamprineas (labrinea) Changes These extensions depend on each other as follows: mte -> mte2 Currently in LLVM FeatureMTE models both FEAT_MTE and FEAT_MTE2 lumped together. However the archi

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-09-19 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Missing fold: https://alive2.llvm.org/ce/z/2rmc3h See https://github.com/dtcxzyw/llvm-opt-benchmark/pull/1342#discussion_r1767033125 https://github.com/llvm/llvm-project/pull/99620 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

<    1   2   3   4   5   >