[clang-tools-extra] [clang] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-07 Thread Erich Keane via cfe-commits
erichkeane wrote: > @AaronBallman, @erichkeane I have addressed comments in the PR, could you > please revisit this PR? Thank you! I'm still away at the WG21 meeting, but I've got this on my list of things to review when I return. https://github.com/llvm/llvm-project/pull/70762 __

[llvm] [lld] [clang] [lldb] [flang] [libcxx] [clang-tools-extra] [libc] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -229,6 +230,9 @@ class Parser : public CodeCompletionHandler { /// Parsing OpenMP directive mode. bool OpenMPDirectiveParsing = false; + /// Parsing OpenACC directive mode. + bool OpenACCDirectiveParsing = false; erichkeane wrote: Its currently being

[llvm] [lld] [clang] [lldb] [flang] [libcxx] [clang-tools-extra] [libc] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang -S -### -fopenacc %s 2>&1 | FileCheck %s --check-prefix=CHECK-DRIVER +// CHECK-DRIVER: "-cc1" {{.*}} "-fopenacc" + +// RUN: %clang -S -### -fopenacc -fexperimental-openacc-macro-override=202211 %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACRO-OV

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -369,9 +369,39 @@ void test_unexpanded_exprs(Types ...values) { void f(int arg = values); // expected-error{{default argument contains unexpanded parameter pack 'values'}} } -// Test unexpanded parameter packs in partial specializations. -template -struct TestUnexpandedD

[clang] [compiler-rt] [llvm] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -4297,3 +4297,19 @@ def PreferredType: InheritableAttr { let Args = [TypeArgument<"Type", 1>]; let Documentation = [PreferredTypeDocumentation]; } + +def CodeAlign: StmtAttr { + let Spellings = [Clang<"code_align">]; + let Subjects = SubjectList<[ForStmt, CXXForRangeSt

[llvm] [clang] [compiler-rt] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -10025,6 +10025,11 @@ def err_duplicate_case_differing_expr : Error< def warn_case_empty_range : Warning<"empty case range specified">; def warn_missing_case_for_condition : Warning<"no case matching constant switch condition '%0'">; +def err_loop_attr_duplication : Error<

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

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

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This needs attribute documentation and a release note. Additionally, I think we should prohibit using this in Microsoft mode (that is, diagnose that) rather than having it be a no-op. We can enable it in the future, but if we permit it, folks will assu

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

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

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -3635,6 +3635,13 @@ def MSStruct : InheritableAttr { let SimpleHandler = 1; } +def GCCStruct : InheritableAttr { + let Spellings = [GCC<"gcc_struct">]; + let Subjects = SubjectList<[Record]>; + let Documentation = [Undocumented]; erichkeane wrote: Doc

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -7337,6 +7337,27 @@ static void handleDeclspecThreadAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) ThreadAttr(S.Context, AL)); } +static void handleMSConstexprAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!S.getLangOpts().isCompatible

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

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

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-11-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I think this is pretty close, I think skipping on constructors for now is acceptable. However, i think we should enable the test, and record the diagnostic to ensure we show it is invalid for now (along with better showing the TODO). https://github.co

[flang] [llvm] [clang] [lld] [libcxx] [lldb] [clang-tools-extra] [libc] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -229,6 +230,9 @@ class Parser : public CodeCompletionHandler { /// Parsing OpenMP directive mode. bool OpenMPDirectiveParsing = false; + /// Parsing OpenACC directive mode. + bool OpenACCDirectiveParsing = false; erichkeane wrote: Ah, I see. As it i

[clang] [libc] [flang] [clang-tools-extra] [llvm] [libcxx] [lld] [lldb] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -1349,6 +1349,19 @@ def fno_hip_emit_relocatable : Flag<["-"], "fno-hip-emit-relocatable">, HelpText<"Do not override toolchain to compile HIP source to relocatable">; } +// Clang specific/exclusive options for OpenACC. +def openacc_macro_override erichk

[flang] [llvm] [clang] [lld] [libcxx] [lldb] [clang-tools-extra] [libc] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/70234 >From b3d64b3f744ccb37e334e3aae8d6874cd8391c56 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 23 Oct 2023 11:09:11 -0700 Subject: [PATCH 1/7] [OpenACC] Initial commit for OpenACC Support This is the ini

[libc] [clang] [lld] [libcxx] [lldb] [llvm] [clang-tools-extra] [flang] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -4001,6 +4008,14 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, (T.isNVPTX() || T.isAMDGCN()) && Args.hasArg(options::OPT_fopenmp_cuda_mode); + // OpenACC Configuration. + if (Args.hasArg(option

[lldb] [libc] [llvm] [clang-tools-extra] [lld] [clang] [flang] [libcxx] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -3633,6 +3633,22 @@ static void RenderHLSLOptions(const ArgList &Args, ArgStringList &CmdArgs, CmdArgs.push_back("-finclude-default-header"); } +static void RenderOpenACCOptions(const Driver &D, const ArgList &Args, + ArgStringList &CmdA

[libc] [clang] [lld] [libcxx] [lldb] [llvm] [clang-tools-extra] [flang] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/70234 >From b3d64b3f744ccb37e334e3aae8d6874cd8391c56 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 23 Oct 2023 11:09:11 -0700 Subject: [PATCH 1/8] [OpenACC] Initial commit for OpenACC Support This is the ini

[clang] [Clang] Fix linker error for function multiversioning (PR #71706)

2023-11-13 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: This seems fine to me, but I think @efriedma-quic /the weak ODR discussion needs to be finalized before this can be accepted. https://github.com/llvm/llvm-project/pull/71706 ___ cfe-commits mailing list cfe-com

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -7337,6 +7337,27 @@ static void handleDeclspecThreadAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) ThreadAttr(S.Context, AL)); } +static void handleMSConstexprAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!S.getLangOpts().isCompatible

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -fms-compatibility -fms-compatibility-version=19.33 -std=c++20 -verify %s +// expected-no-diagnostics + +[[msvc::constexpr]] int log2(int x) { [[msvc::constexpr]] return x > 1 ? 1 + log2(x / 2) : 0; } +constexpr bool test_log2() { [[msvc::con

[clang-tools-extra] [llvm] [compiler-rt] [clang] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -334,11 +334,12 @@ CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, // This attribute requires an integer argument which is a constant power of // two between 1 and 4096 inclusive. int AlignValue = ArgVal.getSExtValue(); -if (AlignValue

[compiler-rt] [clang] [flang] [clang-tools-extra] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -322,6 +322,66 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[compiler-rt] [clang] [flang] [clang-tools-extra] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-13 Thread Erich Keane via cfe-commits
@@ -322,6 +322,66 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang-tools-extra] [llvm] [compiler-rt] [flang] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-14 Thread Erich Keane via cfe-commits
@@ -0,0 +1,126 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c-local -x c %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp-local -pedantic -x c++ -std=c++11 %s + +void foo() { + int i; + int a[10], b[10]; + + [[clang::code_align(8)]] + for (i = 0; i < 10; ++i

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

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

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-14 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Docs need work, code is fine from what I can tell, but @efriedma-quic or @rjmccall need to take a look at the ABI components. https://github.com/llvm/llvm-project/pull/71148 ___ cfe-commits mailing list cfe-com

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-14 Thread Erich Keane via cfe-commits
@@ -302,6 +302,11 @@ Attribute Changes in Clang to reduce the size of the destroy functions for coroutines which are known to be destroyed after having reached the final suspend point. +- On targets with C++ ABI other than Microsoft, Clang now supports + ``[[gnu:gcc_struc

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-14 Thread Erich Keane via cfe-commits
@@ -302,6 +302,11 @@ Attribute Changes in Clang to reduce the size of the destroy functions for coroutines which are known to be destroyed after having reached the final suspend point. +- On targets with C++ ABI other than Microsoft, Clang now supports eri

[clang] [clang] Stub out gcc_struct attribute (PR #71148)

2023-11-14 Thread Erich Keane via cfe-commits
@@ -998,6 +998,9 @@ def warn_npot_ms_struct : Warning< "data types with sizes that aren't a power of two">, DefaultError, InGroup; +def err_itanium_layout_unimplemented : Error< + "sorry, Itanium-compatible layout is unimplemented for the current C++ ABI">; --

[flang] [llvm] [clang] [compiler-rt] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-14 Thread Erich Keane via cfe-commits
@@ -0,0 +1,126 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c-local -x c %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp-local -pedantic -x c++ -std=c++11 %s + +void foo() { + int i; + int a[10], b[10]; + + [[clang::code_align(8)]] + for (i = 0; i < 10; ++i

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -298,7 +367,18 @@ void Parser::ParseOpenACCDirective() { T.consumeClose(); break; } +case OpenACCDirectiveKind::Cache: + ParseOpenACCCacheVarList(); + // The ParseOpenACCCacheVarList function manages to recover from failures, + // so we

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -298,7 +367,18 @@ void Parser::ParseOpenACCDirective() { T.consumeClose(); break; } +case OpenACCDirectiveKind::Cache: + ParseOpenACCCacheVarList(); + // The ParseOpenACCCacheVarList function manages to recover from failures, + // so we

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/74324 >From 31fe05335fce5f7c593e4c3f3595c548cf54bba0 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 29 Nov 2023 11:12:02 -0800 Subject: [PATCH 1/2] [OpenACC] Implement 'cache' construct parsing The 'cache' co

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -268,6 +270,71 @@ ExprResult Parser::ParseOpenACCRoutineName() { return getActions().CorrectDelayedTyposInExpr(Res); } +void Parser::ParseOpenACCCacheVar() { + ExprResult ArrayName = ParseOpenACCIDExpression(); + // FIXME: Pass this to Sema. + (void)ArrayName; + + //

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -237,19 +240,18 @@ void ParseOpenACCClauseList(Parser &P) { } // namespace -// Routine has an optional paren-wrapped name of a function in the local scope. -// We parse the name, emitting any diagnostics -ExprResult Parser::ParseOpenACCRoutineName() { - +ExprResult Parser:

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -268,6 +270,71 @@ ExprResult Parser::ParseOpenACCRoutineName() { return getActions().CorrectDelayedTyposInExpr(Res); } +void Parser::ParseOpenACCCacheVar() { + ExprResult ArrayName = ParseOpenACCIDExpression(); + // FIXME: Pass this to Sema. + (void)ArrayName; + + //

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/74324 >From 31fe05335fce5f7c593e4c3f3595c548cf54bba0 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 29 Nov 2023 11:12:02 -0800 Subject: [PATCH 1/3] [OpenACC] Implement 'cache' construct parsing The 'cache' co

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -1714,6 +1714,8 @@ class ConstraintRefersToContainingTemplateChecker // Friend, likely because it was referred to without its template arguments. void CheckIfContainingRecord(const CXXRecordDecl *CheckingRD) { CheckingRD = CheckingRD->getMostRecentDecl(); +if (!C

[clang] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

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

[clang] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -4077,6 +4084,7 @@ Sema::SubstExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) { TemplateInstantiator Instantiator(*this, TemplateArgs, SourceLocation(), DeclarationName()); + Instan

[clang] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -504,3 +504,24 @@ struct bar { bar x; } // namespace GH61763 + +namespace GH74314 { +template constexpr bool is_same_v = __is_same(T, U); +template constexpr bool is_not_same_v = !__is_same(T, U); + +template +concept something_interesting = requires { + true; +

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/74324 >From 31fe05335fce5f7c593e4c3f3595c548cf54bba0 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 29 Nov 2023 11:12:02 -0800 Subject: [PATCH 1/4] [OpenACC] Implement 'cache' construct parsing The 'cache' co

[clang] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -4077,6 +4084,7 @@ Sema::SubstExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) { TemplateInstantiator Instantiator(*this, TemplateArgs, SourceLocation(), DeclarationName()); + Instan

[clang] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -4077,6 +4084,7 @@ Sema::SubstExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) { TemplateInstantiator Instantiator(*this, TemplateArgs, SourceLocation(), DeclarationName()); + Instan

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
@@ -268,6 +270,71 @@ ExprResult Parser::ParseOpenACCRoutineName() { return getActions().CorrectDelayedTyposInExpr(Res); } +void Parser::ParseOpenACCCacheVar() { + ExprResult ArrayName = ParseOpenACCIDExpression(); + // FIXME: Pass this to Sema. + (void)ArrayName; + + //

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/74324 >From 31fe05335fce5f7c593e4c3f3595c548cf54bba0 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 29 Nov 2023 11:12:02 -0800 Subject: [PATCH 1/5] [OpenACC] Implement 'cache' construct parsing The 'cache' co

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-05 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/74324 >From 31fe05335fce5f7c593e4c3f3595c548cf54bba0 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Wed, 29 Nov 2023 11:12:02 -0800 Subject: [PATCH 1/6] [OpenACC] Implement 'cache' construct parsing The 'cache' co

[clang] [OpenACC] Implement 'cache' construct parsing (PR #74324)

2023-12-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/74324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [flang] [compiler-rt] [llvm] [libc] [clang] Exclude non-template classes when checking if constraint refers to containing template arguments (PR #74265)

2023-12-06 Thread Erich Keane via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -std=c++20 -verify %s + +template +concept C = true; + +class non_temp { +template T> +friend void f(); + +non_temp(); +}; + +template T> +void f() { +auto v = non_temp(); +} + +template +class temp { +template T> +frien

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-12-06 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -8938,6 +8957,11 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, attr.setUsedAsTypeAttr();

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-12-06 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -3341,7 +3341,7 @@ def RequiresCapability : InheritableAttr { let TemplateDependent = 1; let ParseArgumentsAsUnevaluated

[clang] [clang][TSA] Make RequiresCapability a DeclOrType attribute (PR #67095)

2023-12-06 Thread Erich Keane via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: @@ -3341,7 +3341,7 @@ def RequiresCapability : InheritableAttr { let TemplateDependent = 1; let ParseArgumentsAsUnevaluated

[clang] [clang] Substitute alias templates from correct context (PR #74335)

2023-12-06 Thread Erich Keane via cfe-commits
erichkeane wrote: > This started to give errors to code previously considere valid with > "out-of-line definition of X differs from that in". Don't have a repro yet. Please provide one as soon as you can! In the meantime, we should probably revert @Fznamznon https://github.com/llvm/llvm-proj

[lldb] [libunwind] [clang] [mlir] [libcxx] [clang-tools-extra] [libcxxabi] [lld] [libc] [openmp] [llvm] [flang] [Clang][Sema] Don't say "is declared here" for invalid template locations (PR #71264)

2023-12-06 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think this is a very positive change, and see nothing besides Aaron's nit to comment on. Thanks! https://github.com/llvm/llvm-project/pull/71264 ___ cfe-commits mailing list cfe-commits@list

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-07 Thread Erich Keane via cfe-commits
@@ -2884,6 +2884,12 @@ def warn_cxx11_compat_constexpr_body_multiple_return : Warning< InGroup, DefaultIgnore; def note_constexpr_body_previous_return : Note< "previous return statement is here">; +def err_ms_constexpr_not_distinct : Error< + "[[msvc::constexpr]] cannot b

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-07 Thread Erich Keane via cfe-commits
@@ -217,6 +217,8 @@ C23 Feature Support Non-comprehensive list of changes in this release - +- The default value of `_MSC_VER` was raised from 1920 to 1933. + MSVC 19.33 added undocumented attribute ``[[msvc::constexpr]]``.

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-07 Thread Erich Keane via cfe-commits
@@ -2884,6 +2884,12 @@ def warn_cxx11_compat_constexpr_body_multiple_return : Warning< InGroup, DefaultIgnore; def note_constexpr_body_previous_return : Note< "previous return statement is here">; +def err_ms_constexpr_not_distinct : Error< + "[[msvc::constexpr]] cannot b

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-07 Thread Erich Keane via cfe-commits
@@ -3612,6 +3612,22 @@ an error: }]; } +def MSConstexprDocs : Documentation { + let Category = DocCatStmt; + let Content = [{ +The ``[[msvc::constexpr]]`` attribute can be applied only to a function +definition or a ``return`` statement. It does not impact function declarati

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-07 Thread Erich Keane via cfe-commits
@@ -2884,6 +2884,12 @@ def warn_cxx11_compat_constexpr_body_multiple_return : Warning< InGroup, DefaultIgnore; def note_constexpr_body_previous_return : Note< "previous return statement is here">; +def err_ms_constexpr_not_distinct : Error< + "[[msvc::constexpr]] cannot b

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-07 Thread Erich Keane via cfe-commits
@@ -2884,6 +2884,12 @@ def warn_cxx11_compat_constexpr_body_multiple_return : Warning< InGroup, DefaultIgnore; def note_constexpr_body_previous_return : Note< "previous return statement is here">; +def err_ms_constexpr_not_distinct : Error< + "[[msvc::constexpr]] cannot b

[clang] [OpenACC] Implement 'wait' construct parsing (PR #74752)

2023-12-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/74752 The 'wait' construct comes in two forms: one with no parens, the second with a 'wait-argument'. This implements both forms for constructs. Additionally, the 'wait-argument' parsing is split into its own funct

[clang] [OpenACC] Implement 'wait' construct parsing (PR #74752)

2023-12-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/74752 >From 8b7d70d55395d9a75968deeac8a13d88aae62a00 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Thu, 7 Dec 2023 08:55:46 -0800 Subject: [PATCH 1/2] [OpenACC] Implement 'wait' construct parsing The 'wait' const

[clang] [OpenACC] Implement 'wait' construct parsing (PR #74752)

2023-12-07 Thread Erich Keane via cfe-commits
@@ -251,6 +254,67 @@ void ParseOpenACCClauseList(Parser &P) { } // namespace +/// OpenACC 3.3, section 2.16: +/// In this section and throughout the specification, the term wait-argument +/// means: +/// [ devnum : int-expr : ] [ queues : ] async-argument-list +bool Parser::P

[clang] [OpenACC] Implement 'wait' construct parsing (PR #74752)

2023-12-07 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/74752 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-08 Thread Erich Keane via cfe-commits
@@ -235,6 +235,7 @@ Non-comprehensive list of changes in this release except that it returns the size of a type ignoring tail padding. * ``__builtin_classify_type()`` now classifies ``_BitInt`` values as the return value ``18`` and vector types as return value ``19``, to m

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-08 Thread Erich Keane via cfe-commits
@@ -3657,6 +3657,21 @@ an error: }]; } +def MSConstexprDocs : Documentation { + let Category = DocCatStmt; + let Content = [{ +The ``[[msvc::constexpr]]`` attribute can be applied only to a function +definition or a ``return`` statement. It does not impact function declarati

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-08 Thread Erich Keane via cfe-commits
@@ -2884,6 +2884,12 @@ def warn_cxx11_compat_constexpr_body_multiple_return : Warning< InGroup, DefaultIgnore; def note_constexpr_body_previous_return : Note< "previous return statement is here">; +def err_ms_constexpr_not_distinct : Error< + "[[msvc::constexpr]] cannot b

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

2023-12-08 Thread Erich Keane via cfe-commits
erichkeane wrote: Also, please don't 'force-push', just push an additional commit to your review. It erases history and makes reviewing it about 3x harder since history/context gets lost. https://github.com/llvm/llvm-project/pull/71300 ___ cfe-commi

[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

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

[clang] [Clang][Builtin] add __builtin_exit (PR #74803)

2023-12-11 Thread Erich Keane via cfe-commits
erichkeane wrote: This comes down to a question of 'why' from me? Typically we add builtins like this because libc++ need them, or libc/libstdc++ use them. In this case, I don't see any evidence of anyone really needing it. While GCC supports it, I don't really see value here? Also, this is

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2023-12-11 Thread Erich Keane via cfe-commits
erichkeane wrote: Please don't force push... it makes these 100x more difficult to review. ALso, it seems that the latest push has broken quite a lot, according to the build bots. https://github.com/llvm/llvm-project/pull/70976 ___ cfe-commits maili

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-12-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/72863 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Add 'clause' parsing infrastructure plus a few clauses (PR #75052)

2023-12-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/75052 As we've now finished parsing the constructs, we're moving onto implementing 'clause' parsing. While some are complicated and require their own patch, the handful added here are simple to parse (that is,

[clang] [OpenACC] Add 'clause' parsing infrastructure plus a few clauses (PR #75052)

2023-12-11 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/75052 >From 0bcee977f95f87a5ccf7bc53d6cd0a5d9521d963 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 8 Dec 2023 09:18:40 -0800 Subject: [PATCH 1/2] [OpenACC] Add 'clause' parsing infrastructure plus a few clau

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-11 Thread Erich Keane via cfe-commits
erichkeane wrote: Can you point out the diff from the previous patch? https://github.com/llvm/llvm-project/pull/75069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-11 Thread Erich Keane via cfe-commits
@@ -3990,9 +3991,16 @@ QualType Sema::CheckTemplateIdType(TemplateName Name, if (Inst.isInvalid()) return QualType(); -CanonType = SubstType(Pattern->getUnderlyingType(), - TemplateArgLists, AliasTemplate->getLocation(), -

[clang-tools-extra] [llvm] [clang] [compiler-rt] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,81 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [clang] [compiler-rt] [flang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,81 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang-tools-extra] [compiler-rt] [flang] [clang] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,79 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang-tools-extra] [compiler-rt] [flang] [llvm] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [clang] [compiler-rt] [clang-tools-extra] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -296,10 +296,16 @@ bool CodeGen::isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, return false; // If this is a C++ record, check the bases first. - if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) + if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) {

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,90 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[compiler-rt] [llvm] [flang] [clang] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-15 Thread Erich Keane via cfe-commits
@@ -322,6 +322,71 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] [compiler-rt] [flang] [llvm] [clang-tools-extra] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -322,6 +322,71 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [flang] [clang] [clang-tools-extra] [compiler-rt] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -322,6 +322,71 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] [clang-tools-extra] [llvm] [compiler-rt] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -359,16 +359,34 @@ static Attr *handleCodeAlignAttr(Sema &S, Stmt *St, const ParsedAttr &A) { static void CheckForDuplicateCodeAlignAttrs(Sema &S, const SmallVectorImpl &Attrs) { - const Attr *A = nullptr; - for (const auto *I : Attrs) { -

[clang-tools-extra] [compiler-rt] [llvm] [clang] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -322,6 +322,61 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[compiler-rt] [flang] [clang] [clang-tools-extra] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -322,6 +322,71 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[compiler-rt] [flang] [clang] [clang-tools-extra] [llvm] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -322,6 +322,71 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [clang-tools-extra] [compiler-rt] [flang] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -322,6 +322,59 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[llvm] [clang-tools-extra] [compiler-rt] [flang] [clang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

2023-11-16 Thread Erich Keane via cfe-commits
@@ -322,6 +322,59 @@ static Attr *handleUnlikely(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI, +Expr *E) { + if

[clang] [Clang] Fix finding instantiated decls for class template specializations during instantiation (PR #72346)

2023-11-17 Thread Erich Keane via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -verify -fsyntax-only %s erichkeane wrote: Typically we find a similar test file and put it there, just wrapped in a namespace for the github issue. https://github.com/llvm/llvm-project/pull/72346 ___

[clang] [Clang] Fix finding instantiated decls for class template specializations during instantiation (PR #72346)

2023-11-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I don't have a great feel if this is the right fix, but if it doesn't break anything in the tests, and does fix something, this is likely acceptable for now. This DOES need a release note, and as Shafik says: this should likely be placed in an existing

[libc] [llvm] [lld] [clang-tools-extra] [libcxx] [clang] [flang] [lldb] [OpenACC] Initial commits to support OpenACC (PR #70234)

2023-11-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane closed https://github.com/llvm/llvm-project/pull/70234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenACC] Implement initial parsing for Construct/Directive Names (PR #72661)

2023-11-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/72661 As the first real parsing effort for the OpenACC implementation effort, this implements the parsing for construct/directive names. This does not do any semantic analysis, nor any parsing for the parens for af

[clang] [OpenACC] Implement initial parsing for Construct/Directive Names (PR #72661)

2023-11-17 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/72661 >From 01fc81b37ad744a265f712b26fd6c3a85430c719 Mon Sep 17 00:00:00 2001 From: erichkeane Date: Fri, 17 Nov 2023 06:29:35 -0800 Subject: [PATCH 1/2] [OpenACC] Implement initial parsing for Construct/Directive

<    1   2   3   4   5   6   7   8   9   10   >