[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -74,12 +74,12 @@ void use() { for (int i = 0; i < 10; ++i) { // FIXME: Once we have a new array-section type to represent OpenACC as // well, change this error message. erichkeane wrote: Thanks, done in bb1a8bbb

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-26 Thread via cfe-commits
@@ -74,12 +74,12 @@ void use() { for (int i = 0; i < 10; ++i) { // FIXME: Once we have a new array-section type to represent OpenACC as // well, change this error message. NagyDonat wrote: This FIXME was resolved by this commit, consider removing it

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

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

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

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

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-25 Thread Erich Keane via cfe-commits
erichkeane wrote: I think I've got everything done you were concerned about. Let me know if you see anything else! https://github.com/llvm/llvm-project/pull/89639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Alexey Bataev via cfe-commits
@@ -6610,6 +6610,265 @@ class TypoExpr : public Expr { }; +/// This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', +/// with a boolean differentiator. +/// OpenMP 5.0 [2.1.5, Array Sections]. +/// To specify an array section in an OpenMP construct,

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Alexey Bataev via cfe-commits
@@ -6610,6 +6610,265 @@ class TypoExpr : public Expr { }; +/// This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', +/// with a boolean differentiator. +/// OpenMP 5.0 [2.1.5, Array Sections]. +/// To specify an array section in an OpenMP construct,

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Alexey Bataev via cfe-commits
@@ -6610,6 +6610,265 @@ class TypoExpr : public Expr { }; +/// This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', +/// with a boolean differentiator. +/// OpenMP 5.0 [2.1.5, Array Sections]. +/// To specify an array section in an OpenMP construct,

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Erich Keane via cfe-commits
@@ -11163,7 +11163,7 @@ def err_omp_declare_mapper_redefinition : Error< "redefinition of user-defined mapper for type %0 with name %1">; def err_omp_invalid_mapper: Error< "cannot find a valid user-defined mapper for type %0 with name %1">; -def err_omp_array_section_use

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Alexey Bataev via cfe-commits
@@ -3413,8 +3413,8 @@ StringRef BuiltinType::getName(const PrintingPolicy ) const { return "reserve_id_t"; case IncompleteMatrixIdx: return ""; - case OMPArraySection: -return ""; + case ArraySection: +return ""; alexey-bataev wrote: Ok

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Alexey Bataev via cfe-commits
@@ -443,12 +443,17 @@ ExprDependence clang::computeDependence(ObjCIndirectCopyRestoreExpr *E) { return E->getSubExpr()->getDependence(); } -ExprDependence clang::computeDependence(OMPArraySectionExpr *E) { +ExprDependence clang::computeDependence(ArraySectionExpr *E) {

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Alexey Bataev via cfe-commits
@@ -11163,7 +11163,7 @@ def err_omp_declare_mapper_redefinition : Error< "redefinition of user-defined mapper for type %0 with name %1">; def err_omp_invalid_mapper: Error< "cannot find a valid user-defined mapper for type %0 with name %1">; -def err_omp_array_section_use

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Erich Keane via cfe-commits
@@ -3413,8 +3413,8 @@ StringRef BuiltinType::getName(const PrintingPolicy ) const { return "reserve_id_t"; case IncompleteMatrixIdx: return ""; - case OMPArraySection: -return ""; + case ArraySection: +return ""; erichkeane wrote:

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Erich Keane via cfe-commits
@@ -11762,20 +11770,25 @@ TreeTransform::TransformOMPArraySectionExpr(OMPArraySectionExpr *E) { } ExprResult Stride; - if (Expr *Str = E->getStride()) { -Stride = getDerived().TransformExpr(Str); -if (Stride.isInvalid()) - return ExprError(); + if

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Erich Keane via cfe-commits
@@ -443,12 +443,17 @@ ExprDependence clang::computeDependence(ObjCIndirectCopyRestoreExpr *E) { return E->getSubExpr()->getDependence(); } -ExprDependence clang::computeDependence(OMPArraySectionExpr *E) { +ExprDependence clang::computeDependence(ArraySectionExpr *E) {

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Erich Keane via cfe-commits
@@ -11163,7 +11163,7 @@ def err_omp_declare_mapper_redefinition : Error< "redefinition of user-defined mapper for type %0 with name %1">; def err_omp_invalid_mapper: Error< "cannot find a valid user-defined mapper for type %0 with name %1">; -def err_omp_array_section_use

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

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

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-24 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I opted to leave the type of both array sections the same as it seems like it will save a bunch of work and complexity, at the expense of 1 'print', and potentially 1 diagnostic. Let me know if you think this is an important distinction!

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-23 Thread Erich Keane via cfe-commits
erichkeane wrote: > > @alexey-bataev Not having this new 'base' type as a member of the > > `StmtNodes.td` results in one of the Clang tools failing (see the CI). AND, > > since it is a template, it can't do that. > > I can't make it a Mixin, because it needs to provide some of the Expr-type

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-23 Thread Alexey Bataev via cfe-commits
alexey-bataev wrote: > @alexey-bataev Not having this new 'base' type as a member of the > `StmtNodes.td` results in one of the Clang tools failing (see the CI). AND, > since it is a template, it can't do that. > > I can't make it a Mixin, because it needs to provide some of the Expr-type >

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-23 Thread Erich Keane via cfe-commits
erichkeane wrote: @alexey-bataev Not having this new 'base' type as a member of the `StmtNodes.td` results in one of the Clang tools failing (see the CI). AND, since it is a template, it can't do that. I can't make it a Mixin, because it needs to provide some of the Expr-type functions

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-23 Thread Erich Keane via cfe-commits
erichkeane wrote: @njames93 : My test failure has to do with the "NodeIntrospection" stuff that you seemed to review ~3 years ago: https://reviews.llvm.org/D93164 At the moment, I cannot even figure out how to get it to build, but I suspect it is getting confused in some way by having a

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/89639 >From b95304b22915217ad149c1b22a6517c585067acf Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 22 Apr 2024 10:35:13 -0700 Subject: [PATCH 1/3] [NFC] Factor out common parts of ArraySections into its own

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

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

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Erich Keane via cfe-commits
@@ -6610,6 +6610,111 @@ class TypoExpr : public Expr { }; +// This is a sub-class for OpenMP and OpenACC array sections. OpenACC uses a +// very small subset of the functionality, so this class only exposes the things +// the two have in common. This type is not expected to

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane updated https://github.com/llvm/llvm-project/pull/89639 >From b95304b22915217ad149c1b22a6517c585067acf Mon Sep 17 00:00:00 2001 From: erichkeane Date: Mon, 22 Apr 2024 10:35:13 -0700 Subject: [PATCH 1/2] [NFC] Factor out common parts of ArraySections into its own

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Alexey Bataev via cfe-commits
@@ -6610,6 +6610,111 @@ class TypoExpr : public Expr { }; +// This is a sub-class for OpenMP and OpenACC array sections. OpenACC uses a +// very small subset of the functionality, so this class only exposes the things +// the two have in common. This type is not expected to

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Alexey Bataev via cfe-commits
@@ -6610,6 +6610,111 @@ class TypoExpr : public Expr { }; +// This is a sub-class for OpenMP and OpenACC array sections. OpenACC uses a +// very small subset of the functionality, so this class only exposes the things +// the two have in common. This type is not expected to

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Alexey Bataev via cfe-commits
@@ -6610,6 +6610,111 @@ class TypoExpr : public Expr { }; +// This is a sub-class for OpenMP and OpenACC array sections. OpenACC uses a +// very small subset of the functionality, so this class only exposes the things +// the two have in common. This type is not expected to

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff dc20a0ea1fd04a2ef95eb5c73e9f88357fc5f694 b95304b22915217ad149c1b22a6517c585067acf --

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Erich Keane via cfe-commits
erichkeane wrote: Note: this is one of my approaches. This ends up touching the OpenMP work 'the least' (in that this is the entirety of the OpenMP changes as best I can tell), at the expense of more work/a separate AST Node for OpenACC. The OTHER approach I have is to move/rename

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Erich Keane (erichkeane) Changes OpenACC is going to need an array sections implementation that is a simpler version/more restrictive version of the OpenMP version. This patch extracts the things that should be common between the two

[clang] [NFC] Factor out common parts of ArraySections into its own class (PR #89639)

2024-04-22 Thread Erich Keane via cfe-commits
https://github.com/erichkeane created https://github.com/llvm/llvm-project/pull/89639 OpenACC is going to need an array sections implementation that is a simpler version/more restrictive version of the OpenMP version. This patch extracts the things that should be common between the two into