[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,68 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC 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] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -63,17 +67,17 @@ void Sema::ActOnOpenACCConstruct(OpenACCDirectiveKind K, // here as these constructs do not take any arguments. break; default: -Diag(StartLoc, diag::warn_acc_construct_unimplemented) << K; +Sema.Diag(StartLoc, diag::warn_acc_construct_unim

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -1200,6 +1200,27 @@ class Sema final { // // + /// \name Sema Components + /// Parts of Sema + ///@{ + + // Just in this section, private members are followed by public, because + // C++ requires us to create (private) objects before (public) references. + +private

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -63,17 +67,17 @@ void Sema::ActOnOpenACCConstruct(OpenACCDirectiveKind K, // here as these constructs do not take any arguments. break; default: -Diag(StartLoc, diag::warn_acc_construct_unimplemented) << K; +Sema.Diag(StartLoc, diag::warn_acc_construct_unim

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this' check

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -1378,8 +1379,21 @@ bool CoroutineStmtBuilder::makeReturnOnAllocFailure() { static bool collectPlacementArgs(Sema &S, FunctionDecl &FD, SourceLocation Loc, SmallVectorImpl &PlacementArgs) { if (auto *MD = dyn_cast(&FD)) { -if (MD->isImp

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this' check

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-06 Thread Erich Keane via cfe-commits
@@ -6898,10 +6898,18 @@ class Sema final { BinaryOperatorKind Operator); ActOnCXXThis - Parse 'this' pointer. - ExprResult ActOnCXXThis(SourceLocation loc); + /// + /// \param SkipLambdaCaptureCheck Whether to skip the 'this' check

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -19185,7 +19185,8 @@ static bool isLayoutCompatible(ASTContext &C, EnumDecl *ED1, EnumDecl *ED2) { /// Check if two fields are layout-compatible. static bool isLayoutCompatible(ASTContext &C, FieldDecl *Field1, - FieldDecl *Field2) { +

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC &OpenACC() { +assert(OpenACCPtr); erichkeane wrote: IMO, there is value to having the assert. I can

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -1162,6 +1162,11 @@ class Sema final { /// CurContext - This is the current declaration context of parsing. DeclContext *CurContext; + SemaOpenACC &OpenACC() { +assert(OpenACCPtr); erichkeane wrote: I don't buy the 'noticeable impact on assertion

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. I think this is a case of 'cure is worse than the disease'. Unless this implements our 'identifier' rules, it is just going to reject valid code. Any sort of enforcement here on individual characters NEEDS to follow the ru

[clang] [clang] Validate ABI tag attributes (PR #84272)

2024-03-07 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Second: We create a new `Argument` type in `Attr.td`, and the code-gen > > infrastructure for it that takes an "identifier surrounded by quotes" (sort > > of a mix between `IdentifierArgument` and `StringArgument`). This has the > > effect of using our 'normal' parsing ru

[clang] [clang] Add CodeGen tests for CWG 5xx issues (PR #84303)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK +// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexcept

[clang] [clang] Add CodeGen tests for CWG 5xx issues (PR #84303)

2024-03-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/84303 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Erich Keane via cfe-commits
@@ -19185,7 +19185,7 @@ static bool isLayoutCompatible(ASTContext &C, EnumDecl *ED1, EnumDecl *ED2) { /// Check if two fields are layout-compatible. erichkeane wrote: Can you update this comment for the new member? Is it both fields that are union members,

[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

2024-03-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I approve too, i trust you to update the comment for the new *PARAMETER* (not member, I'm a dummy) to make it clear. https://github.com/llvm/llvm-project/pull/84313 ___ cfe-commits mailing list

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > The clang-format check fails due to a change in `clang/docs/ReleaseNotes. > rst`, which isn't mine. What's the protocol? Shall I fix the format issue, or > can my change be merged anyway? Nope, don't worry about that one. That bot is being weird, feel free to merge withou

[clang] [Sema] Avoid unnecessary copy on MultiLevelTemplateArgumentList. NFC (PR #84459)

2024-03-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Ah, this used to be a really small class, at one point it was an unsigned plus a handful of array-refs, so it made sense to pass by value. It seems to have grown a decent bit to the point that pass-by-const-ref now makes sense. https://github.com/llvm/

[clang] [Sema] Avoid unnecessary copy on MultiLevelTemplateArgumentList. NFC (PR #84459)

2024-03-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > Thanks. That explains now :) No problem! Feel free to change a bunch of them, I'm sure we pass by copy quite a bit, I chased out many of them a while back, but I'm sure i didnt get them all. https://github.com/llvm/llvm-project/pull/84459 _

[clang] [C++20][Coroutines] Lambda-coroutine with operator new in promise_type (PR #84193)

2024-03-08 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/84193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-03-08 Thread Erich Keane via cfe-commits
erichkeane wrote: > If we can come to a consensus as to what to do w/ `clang::assume` and > `__attribute__((assume))` reasonably soon, then I’ll handle `[[omp::assume]]` > in this pr as well; otherwise, I’ll open a pr for `[[omp::assume]]` tomorrow > or so. This patch is big enough as it is,

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-09 Thread Erich Keane via cfe-commits
erichkeane wrote: I'm pretty unmotivated here, I don't think it is worth allowing this all the time thanks to it not really being a conforming extension, and I don't think it is sufficiently worth creating a dialect over with the flag. >From what I can see, the GCC folks are equally as unmoti

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-09 Thread Erich Keane via cfe-commits
https://github.com/erichkeane requested changes to this pull request. Left my comment on the main list, but I don't see this as a well motivated change, and even if GCC supported it, it would still be a very difficult to motivate extension without massive historical workloads already using it.

[clang] Add bit-precise overloads for builtin operators (PR #84755)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -8955,6 +8962,22 @@ class BuiltinOperatorOverloadBuilder { (S.Context.getAuxTargetInfo() && S.Context.getAuxTargetInfo()->hasInt128Type())) ArithmeticTypes.push_back(S.Context.UnsignedInt128Ty); + +/// _BitInt overloads are a bit special. We don't

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Left my comment on the main list, but I don't see this as a well motivated > > change, and even if GCC supported it, it would still be a very difficult to > > motivate extension without massive historical workloads already using it. > > This is needed by the Linux kernel,

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit, else LGTM. https://github.com/llvm/llvm-project/pull/83847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

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

[clang] [Clang][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -409,7 +413,7 @@ RISC-V Support CUDA/HIP Language Changes ^ -- PTX is no longer included by default when compiling for CUDA. Using +- PTX is no longer included by default when compiling for CUDA. Using erichkeane wrote: Unrelated c

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

2024-03-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: The commit message and release note needs to be MUCH more detailed. Else I think this looks like an acceptable patch. https://github.com/llvm/llvm-project/pull/84671 ___ cfe-commits mailing list cfe-commits@li

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -0,0 +1,67 @@ +//===- SemaOpenACC.h - Semantic Analysis for OpenACC 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][Sema] Allow access to a public template alias declaration that refers to friend's private nested type (PR #83847)

2024-03-11 Thread Erich Keane via cfe-commits
@@ -4342,10 +4342,17 @@ QualType Sema::CheckTemplateIdType(TemplateName Name, InstantiatingTemplate Inst(*this, TemplateLoc, Template); if (Inst.isInvalid()) return QualType(); +if (!AliasTemplate->getDeclContext()->isFileContext()) { + ContextRAII SavedC

[clang] [clang] Factor out OpenACC part of `Sema` (PR #84184)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > This direction looks good to me, mostly I just have nits. > > The one major change I'd consider before landing is to find a way to avoid > the verbosity regression cor3ntin mentions for `Diag()` and friends. > Notational regressions within Sema itself may be as important as

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Left my comment on the main list > > Sorry, I missed this. Where? Bad phrasing: I jsut meant here: https://github.com/llvm/llvm-project/pull/84428#issuecomment-1987017272 I commented on the 'overall' patch, but then to do the 'needs revision', I needed to add a review m

[clang] Add bit-precise overloads for builtin operators (PR #84755)

2024-03-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. LGTM if Corentin is happy with the comment. https://github.com/llvm/llvm-project/pull/84755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > > C23 6.7.3.2p20: "As a special case, the last member of a structure with > > more than one named member may have an incomplete array type; this is > > called a flexible array member. ..." > > Thanks! Yeah, I wonder if that could have been "of a structure _or union_ " > (a

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-11 Thread Erich Keane via cfe-commits
erichkeane wrote: > But then we (and GCC and MSVC) support the `[0]` extension syntax. So it's > not like codegen is impossible. > > https://godbolt.org/z/PGa9KWGxq > > ```c > union foo { > int a; > int b[]; // error: flexible array member 'b' in a union is not allowed > }; > union

[clang] [Clang][Sema]: Allow flexible arrays in unions and alone in structs (PR #84428)

2024-03-12 Thread Erich Keane via cfe-commits
erichkeane wrote: > > There are currently over 200 separate unions using the work-around. > > Specifically, this is what Linux uses for getting C99 flexible arrays in > unions and alone in structs: > > ``` > #define DECLARE_FLEX_ARRAY(TYPE, NAME)\ > struct { \ >

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

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

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

2024-03-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/84671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

2024-03-12 Thread Erich Keane via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -std=c++20 -verify %s +// RUN: %clang_cc1 -std=c++23 -verify %s +// expected-no-diagnostics + +template concept IsOk = requires() { typename T::Float; }; + +template struct Thing; + +template struct Foobar { erichkeane wrote:

[clang] [clang] CTAD: Respect requires-clause of the original function template (PR #84913)

2024-03-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/84913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclc] [llvm] [openmp] [Clang] `__attribute__((assume))` refactor (PR #84934)

2024-03-12 Thread Erich Keane via cfe-commits
erichkeane wrote: Hi @Sirraide : I appreciate the patch! However, I'm not particularly likely to get a chance to take a look before I go to the WG21 meeting next week, so I'll likely need to review this in April when I get back. I just wanted to mention that so you don't think I'm ignoring y

[clang] [Clang][Sema] Fix a bug on type constraint checking (PR #84671)

2024-03-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/84671 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -8069,6 +8069,38 @@ static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +static void handleAMDGPUMaxNumWorkGroupsAttr(Sema &S, Decl *D, +

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -8069,6 +8069,38 @@ static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +static void handleAMDGPUMaxNumWorkGroupsAttr(Sema &S, Decl *D, +

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -194,3 +204,87 @@ __global__ void non_cexpr_waves_per_eu_2() {} // expected-error@+1{{'amdgpu_waves_per_eu' attribute requires parameter 1 to be an integer constant}} __attribute__((amdgpu_waves_per_eu(2, ipow2(2 __global__ void non_cexpr_waves_per_eu_2_4() {} + +// exp

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This would also need a release note I believe. I don't have the codegen expertise to review this with high confidence, but it looks right to me. https://github.com/llvm/llvm-project/pull/82776 ___ cfe-commits m

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

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

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -4386,6 +4386,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(nullptr); } + case Builtin::BI__builtin_start_object_lifetime: case Builtin::BI__builtin_launder: { erichkeane wrote: Should t

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -194,3 +204,87 @@ __global__ void non_cexpr_waves_per_eu_2() {} // expected-error@+1{{'amdgpu_waves_per_eu' attribute requires parameter 1 to be an integer constant}} __attribute__((amdgpu_waves_per_eu(2, ipow2(2 __global__ void non_cexpr_waves_per_eu_2_4() {} + +// exp

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/82814 Like with 'break'/'continue', returning out of a compute construct is ill-formed, so this implements the diagnostic. However, unlike the OpenMP implementation of this same diagnostic, OpenACC doesn't have a

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/82814 >From cdbf2a137ed7ba0a6d40f955072ef636ee93b292 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 23 Feb 2024 10:36:31 -0800 Subject: [PATCH 1/2] [OpenACC] Implement 'return' branch-out of Compute Construct

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-23 Thread Erich Keane via cfe-commits
erichkeane wrote: > Looks good. Looks like something similar should be done for goto Thanks! Yes, I agree we probably want to do something similar for goto, but I'm still looking at it. Trying to keep patches small :) https://github.com/llvm/llvm-project/pull/82814 _

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -263,6 +263,14 @@ namespace { } } +QualType Expr::getEnumCoercedType(const ASTContext &Ctx) const { + if (isa(this->getType())) +return this->getType(); + else if (const EnumConstantDecl *ECD = this->getEnumConstantDecl()) erichkeane wrote: ```sugg

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

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

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread Erich Keane via cfe-commits
@@ -4097,6 +4105,13 @@ FieldDecl *Expr::getSourceBitField() { return nullptr; } +EnumConstantDecl *Expr::getEnumConstantDecl() { + Expr *E = this->IgnoreParenImpCasts(); + if (DeclRefExpr *DRE = dyn_cast(E)) erichkeane wrote: ```suggestion if (auto *DRE

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-23 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A couple more coding standard edits, else LGTM. https://github.com/llvm/llvm-project/pull/81418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [OpenACC] Implement 'return' branch-out of Compute Construct (PR #82814)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/82814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/82417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

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

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Clang is mostly good, needs an entry in `ReleaseNotes.rst`. Also, a Clang 'codegen' test for templates (see the example I gave you!) would be helpful as well. https://github.com/llvm/llvm-project/pull/79035 _

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -607,6 +607,29 @@ static void instantiateDependentAMDGPUWavesPerEUAttr( S.addAMDGPUWavesPerEUAttr(New, Attr, MinExpr, MaxExpr); } +static void instantiateDependentAMDGPUMaxNumWorkGroupsAttr( +Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, +const AMDG

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -8069,6 +8069,67 @@ static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +// Returns true if error erichkeane wrote: Comment not necessary, just remove i

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -8069,6 +8069,67 @@ static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR)); } +// Returns true if error +static bool +checkAMDGPUMaxNumWorkGroupsArguments(Sema &S, Expr *XExpr,

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Needs a release note if this exists in a previous release. Also, do you have a bug report here? https://github.com/llvm/llvm-project/pull/83024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. 1 nit on the release notes, else lgtm. https://github.com/llvm/llvm-project/pull/83024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit specializ

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

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

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit specializ

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit specializ

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Erich Keane via cfe-commits
erichkeane wrote: Side note: In the future can you be more descriptive with follow up commit messages, isntead of just `[FOLD]`. That doesn't really tell me whether I need to re-review/give context, particularly since I do much of that triage in email. As far as this patch, feel free to commi

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

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

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: We probably need an entry in ReleaseNotes.rst here as well. https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -2258,6 +2258,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-26 Thread Erich Keane via cfe-commits
@@ -2612,44 +2669,313 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [llvm] [AMDGPU] Adding the amdgpu-num-work-groups function attribute (PR #79035)

2024-02-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Clang changes look fine, but I don't have the expertise to review the LLVM changes, so whoever reviews LLVM feel free to 'approve' when you're ready. https://github.com/llvm/llvm-project/pull/79035 ___ cfe-comm

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/81418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/81418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > Since we didn’t bring this up in the RFC, do we have any idea as to what we > should do with `[[clang::assume]]`? > > My suggestion would be to keep the current semantics for `[[clang::assume]]` > (and `__attribute__((assume))`, but probably _not_ `[[assume]]`) iff the > a

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: There are a few things in how the `handle` function works that are incorrect/not necessary, but like Aaron, I'm pretty solidly against this patch in concept. Aaron had some good reasoning, and mine opinion reflects all of it. https://github.com/llvm/ll

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > @AaronBallman @erichkeane, do you have any suggestions for paths forward, for > use cases where it is guaranteed that the attribute is valid and the user (or > perhaps more specifically, another Clang-tool) needs to provide information > to LLVM through Clang AST/source. >

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > So my understanding was that the annotate attribute didn't modify codegen > (and thus LLVM string attributes), but perhaps I didn't use it properly. > > Is there any reference for that? I'm not sure what you mean by that? the 'annotate' attribute just ends up in an LLVM-s

[clang] [clang] Refactor target attribute mangling. (PR #81893)

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Hi- Sorry for the delay, I didn't see the updated commit, so thanks for the ping. In general this is 'about right', but I don't like the 'getManglingSuffix' type of thing. I believe we should have these functions take an ostream and append to it, that

[clang] [Clang][Sema] placement new initializes typedef array with correct size (PR #83124)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: I definitely agree with both of Shafik's comments! The fix itself concerns me, the logic in the block that is having its condition inverted is specifically made for 'if no array size was specified' (see comment), so that makes me think this is an incorrect patch. It doesn'

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: >I suppose the only question now is whether [[clang::assume]] should be treated >like [[assume]] if it’s not applied to a function declaration? THAT is an interesting question that @AaronBallman might have some comments on... Effectively, we have TWO 'assume' attributes- 1-

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Of the three, I lean towards 3 actually, I think that is perhaps the BEST > > idea, and is perhaps supported by our existing infrastructure already (if > > you have Attr.td set its targets right?). I'd like to see what Aaron has to > > say, but I THINK that is my preferen

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: > > I might lean toward CXXAssumeAttr and OMPAssumeAttr ? > > That’s a good idea actually. I have those occasionally :) https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [Clang][C++23] Implement P1774R8: Portable assumptions (PR #81014)

2024-02-27 Thread Erich Keane via cfe-commits
erichkeane wrote: We'd need to see what @alexey-bataev has to say about renaming the OMP assume attribute. I imagine that'll end up causing a headache for his users. https://github.com/llvm/llvm-project/pull/81014 ___ cfe-commits mailing list cfe-com

[clang] Turn 'counted_by' into a type attribute and parse it into 'CountAttributedType' (PR #78000)

2024-02-27 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: No additional comments from me, if the other reviewers are happy, I'm happy with where this is/is going. https://github.com/llvm/llvm-project/pull/78000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Erich Keane via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Erich Keane via cfe-commits
@@ -2258,6 +2258,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [Clang][Sema] Fix missing warning when comparing mismatched enums in … (PR #81418)

2024-02-28 Thread Erich Keane via cfe-commits
erichkeane wrote: > For what it's worth, this change adds several instances of > `-Wenum-enum-conversion` for the Linux kernel: > [ClangBuiltLinux/linux#2002](https://github.com/ClangBuiltLinux/linux/issues/2002). > I assume this is intentional given the nature of the change as a whole but >

[clang] [Clang][Sema] Fix the lambda call expression inside of a type alias declaration (PR #82310)

2024-02-28 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I don't have any concerns, but want @cor3ntin to take a look. He's under the weather at the moment, so he might be a few days. https://github.com/llvm/llvm-project/pull/82310 ___ cfe-commits mailing list cfe-c

[clang] [Clang][HTO] Add clang attribute for propagating llvm-level information (PR #83059)

2024-02-28 Thread Erich Keane via cfe-commits
erichkeane wrote: > > Hm actually reopening, the metadata isn't emitted if the defnition isn't > > available [e.g. for `extern int X;` when given an annotation > > That seems like a bug (so long as the declaration is actually emitted to LLVM > IR at all). > > > @AaronBallman @erichkeane, do y

[clang] [clang] Refactor target attribute mangling. (PR #81893)

2024-02-28 Thread Erich Keane via cfe-commits
@@ -857,6 +864,36 @@ void AArch64TargetCodeGenInfo::checkFunctionCallABI( << Callee->getDeclName(); } +void AArch64ABIInfo::appendAttributeMangling(TargetClonesAttr *Attr, + unsigned Index, +

<    5   6   7   8   9   10   11   12   13   14   >