[clang] [llvm] [AArch64] Add intrinsics for non-widening FMOPA/FMOPS (PR #88105)

2024-04-09 Thread via cfe-commits
Lukacma wrote: > > I noticed that file names and file location are using sme2 as prefix. > > Shouldn't we use sme2p1 prefix for this intrinsic ? > > None of instructions seem to require `FEAT_SME2p1`: > https://developer.arm.com/documentation/ddi0602/2024-03/SME-Instructions/BFMOPA--non-wideni

[clang] 3f71d29 - [clang][Interp] Handle __unaligned in alignof expressions

2024-04-09 Thread Timm Bäder via cfe-commits
Author: Timm Bäder Date: 2024-04-09T16:06:36+02:00 New Revision: 3f71d29e2370912ccc0384adce640c554561edd2 URL: https://github.com/llvm/llvm-project/commit/3f71d29e2370912ccc0384adce640c554561edd2 DIFF: https://github.com/llvm/llvm-project/commit/3f71d29e2370912ccc0384adce640c554561edd2.diff LO

[clang] [clang][c++20] Fix code coverage mapping crash with generalized NTTPs (PR #85837)

2024-04-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. This seems fine to me, but please give @efriedma-quic a few days to do a final pass through. https://github.com/llvm/llvm-project/pull/85837 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-09 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/86526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-09 Thread via cfe-commits
@@ -750,6 +750,9 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, Builder.defineMacro("__cpp_named_character_escapes", "202207L"); Builder.defineMacro("__cpp_placeholder_variables", "202306L"); + // C++26 features supported in earlier lang

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-09 Thread via cfe-commits
@@ -1981,21 +1981,35 @@ class FunctionDecl : public DeclaratorDecl, }; - /// Stashed information about a defaulted function definition whose body has - /// not yet been lazily generated. - class DefaultedFunctionInfo final - : llvm::TrailingObjects { + /// Stashed

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-09 Thread via cfe-commits
@@ -2484,6 +2498,9 @@ class FunctionDecl : public DeclaratorDecl, void setDeletedAsWritten(bool D = true) { FunctionDeclBits.IsDeleted = D; } + /// Only valid if isDeletedAsWritten() returns true. + void setDeletedMessage(StringLiteral *Message); + cor3nt

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-04-09 Thread via cfe-commits
https://github.com/cor3ntin commented: Last batch of nitpicks, and then I think I'll be happy enough to approve this patch! https://github.com/llvm/llvm-project/pull/86526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [clang] Introduce `SemaSYCL` (PR #88086)

2024-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,66 @@ +//===- SemaOpenACC.h 000- Semantic Analysis for SYCL constructs ---===// +// +// 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] [clang] Introduce `SemaSYCL` (PR #88086)

2024-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,66 @@ +//===- SemaOpenACC.h 000- Semantic Analysis for SYCL constructs ---===// +// +// 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] [clang] Introduce `SemaSYCL` (PR #88086)

2024-04-09 Thread Erich Keane via cfe-commits
@@ -0,0 +1,66 @@ +//===- SemaOpenACC.h 000- Semantic Analysis for SYCL constructs ---===// erichkeane wrote: ```suggestion //===- SemaSYCL.h 000- Semantic Analysis for SYCL constructs ---===// ``` https://github.com/llvm/llvm-project/pull/88086

[clang] Rework the printing of attributes (PR #87281)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > And `final` as well as `override`? (This is why I'm not convinced we should > > be backporting anything -- the problem is with printing in general and will > > crop up in various places, so we're not really fixing a regression so much > > as playing whack-a-mole with a

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-09 Thread Edwin Vane via cfe-commits
revane wrote: Using the suggested code and this one usage: ``` MY_MACRO(myglob); ``` No suggestion is made. My understanding is because the full range of the NamedDecl would contain `awesome_myglob` which isn't entirely within a macro arg. https://github.com/llvm/llvm-project/pull/87792 __

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-09 Thread Edwin Vane via cfe-commits
https://github.com/revane updated https://github.com/llvm/llvm-project/pull/87792 >From b34156654bfa937b180eaad1061e38c10a799235 Mon Sep 17 00:00:00 2001 From: Edwin Vane Date: Fri, 5 Apr 2024 11:06:01 -0400 Subject: [PATCH] [clang-tidy] Allow renaming macro arguments Although the identifier-n

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
@@ -58,3 +58,24 @@ void B::g() requires true; #endif } // namespace dr2847 + +namespace dr2858 { // dr2858: 19 + +#if __cplusplus > 202302L + +template +struct A { + // FIXME: The nested-name-specifier in the following friend declarations are declarative, sd

[clang] 5278594 - Add a diagnostic group for tentative array definitions

2024-04-09 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-09T10:40:08-04:00 New Revision: 5278594d7ef8c6814578f2f600016fef5ad058c9 URL: https://github.com/llvm/llvm-project/commit/5278594d7ef8c6814578f2f600016fef5ad058c9 DIFF: https://github.com/llvm/llvm-project/commit/5278594d7ef8c6814578f2f600016fef5ad058c9.diff

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Using the suggested code and this one usage: > > ``` > MY_MACRO(myglob); > ``` > > No suggestion is made. My understanding is because the full range of the > NamedDecl would contain `awesome_myglob` which isn't entirely within a macro > arg. Oh, awesome, thank you for t

[clang] [OpenACC] Implement Default clause for Compute Constructs (PR #88135)

2024-04-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/88135 As a followup to my previous commits, this is an implementation of a single clause, in this case the 'default' clause. This implements all semantic analysis for it on compute clauses, and continues to leave

[clang] [OpenACC] Implement Default clause for Compute Constructs (PR #88135)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Erich Keane (erichkeane) Changes As a followup to my previous commits, this is an implementation of a single clause, in this case the 'default' clause. This implements all semantic analysis for it on compute clauses, and continue

[clang] [OpenACC] Implement Default clause for Compute Constructs (PR #88135)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes As a followup to my previous commits, this is an implementation of a single clause, in this case the 'default' clause. This implements all semantic analysis for it on compute clauses, and continues to lea

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this, what a great speed-up! Generally LGTM, though I think you should add a release note to clang/docs/ReleaseNotes.rst so users know about the significant performance improvement. https://github.com/llvm/llvm-project/pull/87824 __

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-09 Thread Aaron Ballman via cfe-commits
@@ -61,7 +61,28 @@ class ParentMapContext::ParentMap { template friend struct ::MatchParents; /// Contains parents of a node. - using ParentVector = llvm::SmallVector; + class ParentVector { + public: +ParentVector() = default; +explicit ParentVector(size_t n,

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

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

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
@@ -58,3 +58,24 @@ void B::g() requires true; #endif } // namespace dr2847 + +namespace dr2858 { // dr2858: 19 + +#if __cplusplus > 202302L + +template +struct A { + // FIXME: The nested-name-specifier in the following friend declarations are declarative, + // but we don't

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
@@ -58,3 +58,24 @@ void B::g() requires true; #endif } // namespace dr2847 + +namespace dr2858 { // dr2858: 19 + +#if __cplusplus > 202302L + +template +struct A { + // FIXME: The nested-name-specifier in the following friend declarations are declarative, + // but we don't

[clang-tools-extra] [clang-tidy] Ignore delete ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread Mike Weller via cfe-commits
https://github.com/MikeWeller created https://github.com/llvm/llvm-project/pull/88138 Fix `bugprone-forwarding-reference-overload` so it doesn't report a constructor that is deleted. >From 6c188e730f43467c3a7940c0ca6f6bd0bc8fc7f1 Mon Sep 17 00:00:00 2001 From: Mike Weller Date: Tue, 9 Apr 202

[clang-tools-extra] [clang-tidy] Ignore delete ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread Mike Weller via cfe-commits
MikeWeller wrote: https://github.com/llvm/llvm-project/issues/88128 https://github.com/llvm/llvm-project/pull/88138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore delete ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 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-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread Mike Weller via cfe-commits
https://github.com/MikeWeller edited https://github.com/llvm/llvm-project/pull/88138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/88139 This patch adds a `Typename` bit-field to `TemplateTemplateParmDecl` which stores whether the template template parameter was declared with the `typename` keyword. >From 5bc0f03437349705ac9dff096fcc0c5b8b16c

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes This patch adds a `Typename` bit-field to `TemplateTemplateParmDecl` which stores whether the template template parameter was declared with the `typename` keyword. --- Full diff: https://github.co

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/88139 >From a3a9dd90ffd82c738c41c6c581852a10742f2bbc Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 9 Apr 2024 10:51:56 -0400 Subject: [PATCH] [Clang][AST] Track whether template template parameters u

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/88139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Erich Keane via cfe-commits
@@ -1581,26 +1581,33 @@ class TemplateTemplateParmDecl final DefaultArgStorage; DefArgStorage DefaultArgument; + /// Whether this template template parameter was declaration with + /// the 'typename' keyword. + /// + /// If false, it was declared with the 'class' k

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Could also use a release note as this is noticable now. https://github.com/llvm/llvm-project/pull/88139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Erich Keane via cfe-commits
@@ -1634,6 +1640,14 @@ class TemplateTemplateParmDecl final using TemplateParmPosition::setPosition; using TemplateParmPosition::getIndex; + /// Whether this template template parameter was declared with + /// the 'typename' keyword. + bool wasDeclaredWithTypename() con

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread Mike Weller via cfe-commits
@@ -251,3 +251,10 @@ class Test10 { Test10(T &&Item, E e) : e(e){} }; + +// A deleted ctor cannot hide anything +class Test11 { +public: + template + Test11(T&&) = delete; MikeWeller wrote: Although this is enough to trigger (or not after the fix) t

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

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

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane I added a release note. Regarding the addition of an enumeration type, how about: ```cpp enum class TypeParmKeyword { Class, Typename }; ``` (I used `TypeParm` because a template template parameter is a _type-parameter_ in the C++ grammar, but I'm open to alte

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane I added a release note. Regarding the addition of an enumeration > type, how about: > > ```c++ > enum class TypeParmKeyword { > Class, > Typename > }; > ``` > > (I used `TypeParm` because a template template parameter is a > _type-parameter_ in the C++ gram

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread Mike Weller via cfe-commits
https://github.com/MikeWeller updated https://github.com/llvm/llvm-project/pull/88138 >From 4cb9527430d3c7f9acc518427a29eae0aa7e00d1 Mon Sep 17 00:00:00 2001 From: Mike Weller Date: Tue, 9 Apr 2024 16:03:31 +0100 Subject: [PATCH] [clang-tidy] Ignore delete ctor in `bugprone-forwarding-referenc

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: `Sema.h` changes look good. https://github.com/llvm/llvm-project/pull/88139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-09 Thread via cfe-commits
@@ -61,7 +61,28 @@ class ParentMapContext::ParentMap { template friend struct ::MatchParents; /// Contains parents of a node. - using ParentVector = llvm::SmallVector; + class ParentVector { + public: +ParentVector() = default; +explicit ParentVector(size_t n,

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/88042 >From e850ae0982efbb7cec7c33d6b927844d89128743 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 8 Apr 2024 09:46:08 -0400 Subject: [PATCH 1/4] [Clang][Sema] Implement approved resolution for CWG28

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread via cfe-commits
@@ -1581,26 +1581,33 @@ class TemplateTemplateParmDecl final DefaultArgStorage; DefArgStorage DefaultArgument; + /// Whether this template template parameter was declaration with + /// the 'typename' keyword. + /// + /// If false, it was declared with the 'class' k

[clang] [Clang][AST] Track whether template template parameters used the 'typename' keyword (PR #88139)

2024-04-09 Thread via cfe-commits
@@ -1634,6 +1640,14 @@ class TemplateTemplateParmDecl final using TemplateParmPosition::setPosition; using TemplateParmPosition::getIndex; + /// Whether this template template parameter was declared with + /// the 'typename' keyword. + bool wasDeclaredWithTypename() con

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread Mike Weller via cfe-commits
https://github.com/MikeWeller ready_for_review https://github.com/llvm/llvm-project/pull/88138 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tidy Author: Mike Weller (MikeWeller) Changes Fix `bugprone-forwarding-reference-overload` so it doesn't report a constructor that is deleted. --- Full diff: https://github.com/llvm/llvm-project/pull/88138.diff 2 Files Affected: - (modified)

[clang-tools-extra] [clang-tidy] Ignore deleted ctor in `bugprone-forwarding-reference-overload` (PR #88138)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-tools-extra Author: Mike Weller (MikeWeller) Changes Fix `bugprone-forwarding-reference-overload` so it doesn't report a constructor that is deleted. --- Full diff: https://github.com/llvm/llvm-project/pull/88138.diff 2 Files Affected: - (modi

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/88042 >From e850ae0982efbb7cec7c33d6b927844d89128743 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 8 Apr 2024 09:46:08 -0400 Subject: [PATCH 1/4] [Clang][Sema] Implement approved resolution for CWG28

[clang] [clang][UBSan] Remove rigid metadata checks for `ubsan-bitfield-conversion` (PR #88116)

2024-04-09 Thread Vitaly Buka via cfe-commits
https://github.com/vitalybuka approved this pull request. https://github.com/llvm/llvm-project/pull/88116 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4bb5d48 - [clang][NFC] Fix CUDA clang-cl tests

2024-04-09 Thread Michael Liao via cfe-commits
Author: Michael Liao Date: 2024-04-09T11:55:31-04:00 New Revision: 4bb5d48584818646a31a1ba4bfbbd658b7dfbe67 URL: https://github.com/llvm/llvm-project/commit/4bb5d48584818646a31a1ba4bfbbd658b7dfbe67 DIFF: https://github.com/llvm/llvm-project/commit/4bb5d48584818646a31a1ba4bfbbd658b7dfbe67.diff

[clang] [Clang][Sema] Implement approved resolution for CWG2858 (PR #88042)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/88042 >From e850ae0982efbb7cec7c33d6b927844d89128743 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 8 Apr 2024 09:46:08 -0400 Subject: [PATCH 1/5] [Clang][Sema] Implement approved resolution for CWG28

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -10798,6 +10798,95 @@ def warn_imp_cast_drops_unaligned : Warning< "implicit cast from type %0 to type %1 drops __unaligned qualifier">, InGroup>; +def warn_func_effect_allocates : Warning< + "'%0' function must not allocate or deallocate memory">, Sir

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -5016,3 +5024,254 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::FunctionE

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
https://github.com/Sirraide requested changes to this pull request. I’ve taken another look at this since it’s been a while, and you seem to be making good progress, from what I can tell; there are a few overarching things I’d like to point out here. - The way effects are being cached seems a

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +// TODO: Should FunctionEffect be located elsewhere, where Decl is not +// forw

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +// TODO: Should FunctionEffect be located elsewhere, where Decl is not +// forw

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +// TODO: Should FunctionEffect be located elsewhere, where Decl is not +// forw

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +// TODO: Should FunctionEffect be located elsewhere, where Decl is not +// forw

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +// TODO: Should FunctionEffect be located elsewhere, where Decl is not +// forw

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -5016,3 +5024,254 @@ void AutoType::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) { Profile(ID, Context, getDeducedType(), getKeyword(), isDependentType(), getTypeConstraintConcept(), getTypeConstraintArguments()); } + +FunctionEffect::FunctionE

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -10798,6 +10798,95 @@ def warn_imp_cast_drops_unaligned : Warning< "implicit cast from type %0 to type %1 drops __unaligned qualifier">, InGroup>; +def warn_func_effect_allocates : Warning< + "'%0' function must not allocate or deallocate memory">, Sir

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -17154,6 +17156,10 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, BlockScopeInfo *BSI = cast(FunctionScopes.back()); BlockDecl *BD = BSI->TheDecl; + if (const auto FX = BD->getFunctionEffects()) { +CheckAddCallableWithEffects(BD, FX); + } ---

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -0,0 +1,117 @@ +// RUN: %clang_cc1 %s -ast-dump -fblocks | FileCheck %s + +// Make sure that the attribute gets parsed and attached to the correct AST elements. + +#pragma clang diagnostic ignored "-Wunused-variable" + +// =

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -7959,6 +7979,122 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +static bool +handleNonBlockingNonAllocatingTypeAttr(TypeProcessingState &state, + ParsedAttr &PAt

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -4429,6 +4433,218 @@ class FunctionNoProtoType : public FunctionType, public llvm::FoldingSetNode { } }; +// -- + +// TODO: Should FunctionEffect be located elsewhere, where Decl is not +// forw

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -0,0 +1,190 @@ +// RUN: %clang_cc1 -fsyntax-only -fblocks -fcxx-exceptions -verify %s +// These are in a separate file because errors (e.g. incompatible attributes) currently prevent Sirraide wrote: Are all of these specifically Objective-C++ tests? Because p

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -1868,6 +1868,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +if (getLangOpts().CPlusPlus) { + // For C, when called from checkPointerTypesForAssignment, + // we need not to c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -13804,3 +13807,78 @@ StringRef ASTContext::getCUIDHash() const { CUIDHash = llvm::utohexstr(llvm::MD5Hash(LangOpts.CUID), /*LowerCase=*/true); return CUIDHash; } + +using FunctionEffectSpan = llvm::ArrayRef; + +llvm::hash_code hash_value(const FunctionEffect &Effect) {

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
@@ -18324,6 +18324,47 @@ bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, return true; } + // Virtual overrides: check for matching effects. + const auto OldFX = Old->getFunctionEffects(); + const auto NewFX = New->getFunctionEffects(); + + if

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
Sirraide wrote: Regarding the effects implementation, my understanding of the situation is this: There are a number of effects that we support. Each effect has a set of properties, which are represented as flags. Furthermore, we can attach one or more effects to a function. I understand that

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
Sirraide wrote: One more thing: if we’re already introducing a set of flags that indicate the properties of each effect (e.g. must not throw etc.), is there anything else to effects than the union of those flags? In other words, can’t we just store the flags directly in the function type and c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
https://github.com/Sirraide edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Relax ordering of static libraries for offloading (PR #87532)

2024-04-09 Thread Joseph Huber via cfe-commits
jhuber6 wrote: ping https://github.com/llvm/llvm-project/pull/87532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST][NFC] Fix printing of dependent PackIndexTypes (PR #88146)

2024-04-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/88146 Dependent `PackIndexType`s currently print the memory address of the index `Expr*` rather than pretty printing the expression. This patch fixes that. >From 04869abc01117c6f4f270b9b9b61cdb2a7e1acc6 Mon Sep 17

[clang] [Clang][AST][NFC] Fix printing of dependent PackIndexTypes (PR #88146)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes Dependent `PackIndexType`s currently print the memory address of the index `Expr*` rather than pretty printing the expression. This patch fixes that. --- Full diff: https://github.com/llvm/llvm-pro

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-04-09 Thread via cfe-commits
Sirraide wrote: > I don’t think there is a point in storing anything other than just the flags In other words, the design approach I’m proposing is that instead of having two effects, `nolock` and `noallock`, we’d instead just have two *attributes* that each add a ‘set’ of effects, but those ‘

[clang] [clang][UBSan] Remove rigid metadata checks for `ubsan-bitfield-conversion` (PR #88116)

2024-04-09 Thread Michael Halkenhäuser via cfe-commits
mhalk wrote: Thanks for reviewing -- much appreciated! https://github.com/llvm/llvm-project/pull/88116 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 3009228 - [clang][UBSan] Remove rigid metadata checks for `ubsan-bitfield-conversion` (#88116)

2024-04-09 Thread via cfe-commits
Author: Michael Halkenhäuser Date: 2024-04-09T18:18:21+02:00 New Revision: 3009228a09dbfe04e0911fc19813ec72d389bc45 URL: https://github.com/llvm/llvm-project/commit/3009228a09dbfe04e0911fc19813ec72d389bc45 DIFF: https://github.com/llvm/llvm-project/commit/3009228a09dbfe04e0911fc19813ec72d389bc4

[clang] [clang][UBSan] Remove rigid metadata checks for `ubsan-bitfield-conversion` (PR #88116)

2024-04-09 Thread Michael Halkenhäuser via cfe-commits
https://github.com/mhalk closed https://github.com/llvm/llvm-project/pull/88116 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add ``ignoringParenImpCasts`` in ``hasAnyArgument`` fix#75754 (PR #87268)

2024-04-09 Thread via cfe-commits
https://github.com/komalverma04 updated https://github.com/llvm/llvm-project/pull/87268 >From 9b5781108081565e4009c3809eab623387655f1c Mon Sep 17 00:00:00 2001 From: komalverma04 Date: Mon, 1 Apr 2024 22:43:10 +0530 Subject: [PATCH 1/5] [clang-tidy] Add ignoringParenImpCasts in hasAnyArgument

[clang] [BitInt] Expose a _BitInt literal suffix in C++ (PR #86586)

2024-04-09 Thread via cfe-commits
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, if (isImaginary) break; // Cannot be repeated. isImaginary = true; continue; // Success. +case '_': + if (isFPConstant) +break; // Invalid for floats

[clang] [BitInt] Expose a _BitInt literal suffix in C++ (PR #86586)

2024-04-09 Thread via cfe-commits
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, // wb and WB are allowed, but a mixture of cases like Wb or wB is not. We // explicitly do not support the suffix in C++ as an extension because a // library-based UDL tha

[clang] [flang] [flang][Frontend] Implement printing defined macros via -dM (PR #87627)

2024-04-09 Thread Krzysztof Parzyszek via cfe-commits
kparzysz wrote: @klausler Are you ok with this? https://github.com/llvm/llvm-project/pull/87627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][deps] Overload `Filesystem::exists` in `DependencyScanningFilesystem` to have it use cached `status` (PR #88152)

2024-04-09 Thread Artem Chikin via cfe-commits
https://github.com/artemcm created https://github.com/llvm/llvm-project/pull/88152 As-is, calls to `exists()` fallback on the implementation in `ProxyFileSystem::exists` which explicitly calls out to the underlying `FS`, which for the `DependencyScanningFilesystem` (overlay) is the real underl

[clang] [clang][deps] Overload `Filesystem::exists` in `DependencyScanningFilesystem` to have it use cached `status` (PR #88152)

2024-04-09 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] [clang][deps] Overload `Filesystem::exists` in `DependencyScanningFilesystem` to have it use cached `status` (PR #88152)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Artem Chikin (artemcm) Changes As-is, calls to `exists()` fallback on the implementation in `ProxyFileSystem::exists` which explicitly calls out to the underlying `FS`, which for the `DependencyScanningFilesystem` (overlay) is the real un

[clang] cppcheck: use move semantics for 'NodeKinds' and update possible callers to use it (PR #87273)

2024-04-09 Thread Amila Senadheera via cfe-commits
Amila-Rukshan wrote: Ping https://github.com/llvm/llvm-project/pull/87273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Frontend] Implement printing defined macros via -dM (PR #87627)

2024-04-09 Thread Peter Klausler via cfe-commits
@@ -49,15 +51,21 @@ class Definition { TokenSequence Apply(const std::vector &args, Prescanner &); + void Print(llvm::raw_ostream &out, llvm::StringRef macroName = "") const; + private: static TokenSequence Tokenize(const std::vector &argNames, const TokenSequen

[clang] [flang] [flang][Frontend] Implement printing defined macros via -dM (PR #87627)

2024-04-09 Thread Peter Klausler via cfe-commits
@@ -49,15 +51,21 @@ class Definition { TokenSequence Apply(const std::vector &args, Prescanner &); + void Print(llvm::raw_ostream &out, llvm::StringRef macroName = "") const; klausler wrote: `const char *` would be a more portable type for `macroName` for

[clang] [flang] [flang][Frontend] Implement printing defined macros via -dM (PR #87627)

2024-04-09 Thread Peter Klausler via cfe-commits
@@ -46,6 +49,38 @@ bool Definition::set_isDisabled(bool disable) { return was; } +void Definition::Print( +llvm::raw_ostream &out, llvm::StringRef macroName) const { + if (!isFunctionLike_) { +// If it's not a function-like macro, then just print the replacement. +

[clang] [LinkerWrapper] Relax ordering of static libraries for offloading (PR #87532)

2024-04-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: if a.o depends on b.o in libb.a, and b.o depends on c.o in libb.a, will the linker wrapper be able to link all the dependencies? For archive of objects with embedded device bitcode, why not creating an archive of device bitcode for each required target ID and let lld handle the

[clang] [LinkerWrapper] Relax ordering of static libraries for offloading (PR #87532)

2024-04-09 Thread Joseph Huber via cfe-commits
jhuber6 wrote: > if a.o depends on b.o in libb.a, and b.o depends on c.o in libb.a, will the > linker wrapper be able to link all the dependencies? Given an invocation like this with those dependencies ```console $ clang main.o libb.a liba.a ``` main.o will extract `a.o` from `liba.a`. We will

[clang] [clang] Introduce `SemaSYCL` (PR #88086)

2024-04-09 Thread Harald van Dijk via cfe-commits
@@ -0,0 +1,66 @@ +//===- SemaOpenACC.h 000- Semantic Analysis for SYCL constructs ---===// +// +// 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] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-09 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) Changes There's so much overlap between the cited papers so this condenses the status page into a single entry rather than trying to test conformance against multiple papers doing conflicting things. --- Full

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I'm not convinced I have sufficient tests, so I'm especially interested in some help figuring out what else to test and how to go about it. I don't believe we need to test library behavior here because Clang does not provide any library support for complex types in freestan

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-09 Thread Carlos Galvez via cfe-commits
carlosgalvezp wrote: Nice! Should we add this example as a test case? https://github.com/llvm/llvm-project/pull/87792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

2024-04-09 Thread zhijian lin via cfe-commits
https://github.com/diggerlin updated https://github.com/llvm/llvm-project/pull/82809 >From 557e7163d744890aadfa703a81a0c4f2cd112517 Mon Sep 17 00:00:00 2001 From: zhijian Date: Fri, 23 Feb 2024 13:23:18 -0500 Subject: [PATCH 1/7] Implement a subset of builtin_cpu_supports() features --- clang

<    1   2   3   4   >