[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// RUN: llvm-tblgen -gen-directive-decl -I %p/../../include %s | FileCheck -match-full-lines %s
|
|
|
|
// RUN: llvm-tblgen -gen-directive-impl -I %p/../../include %s | FileCheck -match-full-lines %s -check-prefix=IMPL
|
[flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.
Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert
Reviewed By: DavidTruby, ichoyjx
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83326
2020-07-12 00:42:05 +08:00
|
|
|
// RUN: llvm-tblgen -gen-directive-gen -I %p/../../include %s | FileCheck -match-full-lines %s -check-prefix=GEN
|
[openmp] Base of tablegen generated OpenMP common declaration
Summary:
As discussed previously when landing patch for OpenMP in Flang, the idea is
to share common part of the OpenMP declaration between the different Frontend.
While doing this it was thought that moving to tablegen instead of Macros will also
give a cleaner and more powerful way of generating these declaration.
This first part of a future series of patches is setting up the base .td file for
DirectiveLanguage as well as the OpenMP version of it. The base file is meant to
be used by other directive language such as OpenACC.
In this first patch, the Directive and Clause enums are generated with tablegen
instead of the macros on OMPConstants.h. The next pacth will extend this
to other enum and move the Flang frontend to use it.
Reviewers: jdoerfert, DavidTruby, fghanim, ABataev, jdenny, hfinkel, jhuber6, kiranchandramohan, kiranktp
Reviewed By: jdoerfert, jdenny
Subscribers: arphaman, martong, cfe-commits, mgorny, yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D81736
2020-06-23 21:29:50 +08:00
|
|
|
|
|
|
|
include "llvm/Frontend/Directive/DirectiveBase.td"
|
|
|
|
|
|
|
|
def TestDirectiveLanguage : DirectiveLanguage {
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
let name = "Tdl";
|
[openmp] Base of tablegen generated OpenMP common declaration
Summary:
As discussed previously when landing patch for OpenMP in Flang, the idea is
to share common part of the OpenMP declaration between the different Frontend.
While doing this it was thought that moving to tablegen instead of Macros will also
give a cleaner and more powerful way of generating these declaration.
This first part of a future series of patches is setting up the base .td file for
DirectiveLanguage as well as the OpenMP version of it. The base file is meant to
be used by other directive language such as OpenACC.
In this first patch, the Directive and Clause enums are generated with tablegen
instead of the macros on OMPConstants.h. The next pacth will extend this
to other enum and move the Flang frontend to use it.
Reviewers: jdoerfert, DavidTruby, fghanim, ABataev, jdenny, hfinkel, jhuber6, kiranchandramohan, kiranktp
Reviewed By: jdoerfert, jdenny
Subscribers: arphaman, martong, cfe-commits, mgorny, yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D81736
2020-06-23 21:29:50 +08:00
|
|
|
|
|
|
|
let cppNamespace = "tdl";
|
|
|
|
let directivePrefix = "TDLD_";
|
|
|
|
let clausePrefix = "TDLC_";
|
2020-07-11 08:11:11 +08:00
|
|
|
let includeHeader = "tdl.h.inc";
|
2020-08-11 22:43:56 +08:00
|
|
|
let flangClauseBaseClass = "TdlClause";
|
[openmp] Base of tablegen generated OpenMP common declaration
Summary:
As discussed previously when landing patch for OpenMP in Flang, the idea is
to share common part of the OpenMP declaration between the different Frontend.
While doing this it was thought that moving to tablegen instead of Macros will also
give a cleaner and more powerful way of generating these declaration.
This first part of a future series of patches is setting up the base .td file for
DirectiveLanguage as well as the OpenMP version of it. The base file is meant to
be used by other directive language such as OpenACC.
In this first patch, the Directive and Clause enums are generated with tablegen
instead of the macros on OMPConstants.h. The next pacth will extend this
to other enum and move the Flang frontend to use it.
Reviewers: jdoerfert, DavidTruby, fghanim, ABataev, jdenny, hfinkel, jhuber6, kiranchandramohan, kiranktp
Reviewed By: jdoerfert, jdenny
Subscribers: arphaman, martong, cfe-commits, mgorny, yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D81736
2020-06-23 21:29:50 +08:00
|
|
|
}
|
|
|
|
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
def TDLC_ClauseA : Clause<"clausea"> {
|
|
|
|
let isImplicit = 1;
|
|
|
|
}
|
|
|
|
def TDLC_ClauseB : Clause<"clauseb"> {
|
|
|
|
let isDefault = 1;
|
2020-08-11 22:43:56 +08:00
|
|
|
let flangClassValue = "IntExpr";
|
2020-08-18 02:22:01 +08:00
|
|
|
let isValueList = 1;
|
|
|
|
}
|
|
|
|
def TDLC_ClauseC : Clause<"clausec"> {
|
|
|
|
let flangClassValue = "Name";
|
|
|
|
let defaultValue = "*";
|
|
|
|
let isValueOptional = 1;
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
}
|
[openmp] Base of tablegen generated OpenMP common declaration
Summary:
As discussed previously when landing patch for OpenMP in Flang, the idea is
to share common part of the OpenMP declaration between the different Frontend.
While doing this it was thought that moving to tablegen instead of Macros will also
give a cleaner and more powerful way of generating these declaration.
This first part of a future series of patches is setting up the base .td file for
DirectiveLanguage as well as the OpenMP version of it. The base file is meant to
be used by other directive language such as OpenACC.
In this first patch, the Directive and Clause enums are generated with tablegen
instead of the macros on OMPConstants.h. The next pacth will extend this
to other enum and move the Flang frontend to use it.
Reviewers: jdoerfert, DavidTruby, fghanim, ABataev, jdenny, hfinkel, jhuber6, kiranchandramohan, kiranktp
Reviewed By: jdoerfert, jdenny
Subscribers: arphaman, martong, cfe-commits, mgorny, yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D81736
2020-06-23 21:29:50 +08:00
|
|
|
|
|
|
|
def TDL_DirA : Directive<"dira"> {
|
2020-07-07 10:19:43 +08:00
|
|
|
let allowedClauses = [
|
|
|
|
VersionedClause<TDLC_ClauseA, 2, 4>,
|
|
|
|
VersionedClause<TDLC_ClauseB, 2>
|
|
|
|
];
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
let isDefault = 1;
|
[openmp] Base of tablegen generated OpenMP common declaration
Summary:
As discussed previously when landing patch for OpenMP in Flang, the idea is
to share common part of the OpenMP declaration between the different Frontend.
While doing this it was thought that moving to tablegen instead of Macros will also
give a cleaner and more powerful way of generating these declaration.
This first part of a future series of patches is setting up the base .td file for
DirectiveLanguage as well as the OpenMP version of it. The base file is meant to
be used by other directive language such as OpenACC.
In this first patch, the Directive and Clause enums are generated with tablegen
instead of the macros on OMPConstants.h. The next pacth will extend this
to other enum and move the Flang frontend to use it.
Reviewers: jdoerfert, DavidTruby, fghanim, ABataev, jdenny, hfinkel, jhuber6, kiranchandramohan, kiranktp
Reviewed By: jdoerfert, jdenny
Subscribers: arphaman, martong, cfe-commits, mgorny, yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D81736
2020-06-23 21:29:50 +08:00
|
|
|
}
|
|
|
|
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// CHECK: #ifndef LLVM_Tdl_INC
|
|
|
|
// CHECK-NEXT: #define LLVM_Tdl_INC
|
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: namespace llvm {
|
|
|
|
// CHECK-NEXT: class StringRef;
|
|
|
|
// CHECK-NEXT: namespace tdl {
|
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: enum class Directive {
|
|
|
|
// CHECK-NEXT: TDLD_dira,
|
|
|
|
// CHECK-NEXT: };
|
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: static constexpr std::size_t Directive_enumSize = 1;
|
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: enum class Clause {
|
|
|
|
// CHECK-NEXT: TDLC_clausea,
|
|
|
|
// CHECK-NEXT: TDLC_clauseb,
|
2020-08-18 02:22:01 +08:00
|
|
|
// CHECK-NEXT: TDLC_clausec,
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// CHECK-NEXT: };
|
|
|
|
// CHECK-EMPTY:
|
2020-08-18 02:22:01 +08:00
|
|
|
// CHECK-NEXT: static constexpr std::size_t Clause_enumSize = 3;
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: // Enumeration helper functions
|
|
|
|
// CHECK-NEXT: Directive getTdlDirectiveKind(llvm::StringRef Str);
|
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: llvm::StringRef getTdlDirectiveName(Directive D);
|
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: Clause getTdlClauseKind(llvm::StringRef Str);
|
|
|
|
// CHECK-EMPTY:
|
|
|
|
// CHECK-NEXT: llvm::StringRef getTdlClauseName(Clause C);
|
|
|
|
// CHECK-EMPTY:
|
2020-07-07 10:19:43 +08:00
|
|
|
// CHECK-NEXT: /// Return true if \p C is a valid clause for \p D in version \p Version.
|
|
|
|
// CHECK-NEXT: bool isAllowedClauseForDirective(Directive D, Clause C, unsigned Version);
|
|
|
|
// CHECK-EMPTY:
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// CHECK-NEXT: } // namespace tdl
|
|
|
|
// CHECK-NEXT: } // namespace llvm
|
|
|
|
// CHECK-NEXT: #endif // LLVM_Tdl_INC
|
|
|
|
|
2020-07-11 08:11:11 +08:00
|
|
|
// IMPL: #include "tdl.h.inc"
|
|
|
|
// IMPL-EMPTY:
|
|
|
|
// IMPL-NEXT: #include "llvm/ADT/StringRef.h"
|
|
|
|
// IMPL-NEXT: #include "llvm/ADT/StringSwitch.h"
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
// IMPL-NEXT: #include "llvm/Support/ErrorHandling.h"
|
2020-07-11 08:11:11 +08:00
|
|
|
// IMPL-EMPTY:
|
|
|
|
// IMPL-NEXT: using namespace llvm;
|
|
|
|
// IMPL-NEXT: using namespace tdl;
|
|
|
|
// IMPL-EMPTY:
|
[flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.
Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert
Reviewed By: DavidTruby, ichoyjx
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83326
2020-07-12 00:42:05 +08:00
|
|
|
// IMPL-NEXT: Directive llvm::tdl::getTdlDirectiveKind(llvm::StringRef Str) {
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// IMPL-NEXT: return llvm::StringSwitch<Directive>(Str)
|
|
|
|
// IMPL-NEXT: .Case("dira",TDLD_dira)
|
|
|
|
// IMPL-NEXT: .Default(TDLD_dira);
|
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-EMPTY:
|
|
|
|
// IMPL-NEXT: llvm::StringRef llvm::tdl::getTdlDirectiveName(Directive Kind) {
|
|
|
|
// IMPL-NEXT: switch (Kind) {
|
|
|
|
// IMPL-NEXT: case TDLD_dira:
|
|
|
|
// IMPL-NEXT: return "dira";
|
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-NEXT: llvm_unreachable("Invalid Tdl Directive kind");
|
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-EMPTY:
|
|
|
|
// IMPL-NEXT: Clause llvm::tdl::getTdlClauseKind(llvm::StringRef Str) {
|
|
|
|
// IMPL-NEXT: return llvm::StringSwitch<Clause>(Str)
|
|
|
|
// IMPL-NEXT: .Case("clausea",TDLC_clauseb)
|
|
|
|
// IMPL-NEXT: .Case("clauseb",TDLC_clauseb)
|
2020-08-18 02:22:01 +08:00
|
|
|
// IMPL-NEXT: .Case("clausec",TDLC_clausec)
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// IMPL-NEXT: .Default(TDLC_clauseb);
|
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-EMPTY:
|
|
|
|
// IMPL-NEXT: llvm::StringRef llvm::tdl::getTdlClauseName(Clause Kind) {
|
|
|
|
// IMPL-NEXT: switch (Kind) {
|
|
|
|
// IMPL-NEXT: case TDLC_clausea:
|
|
|
|
// IMPL-NEXT: return "clausea";
|
|
|
|
// IMPL-NEXT: case TDLC_clauseb:
|
|
|
|
// IMPL-NEXT: return "clauseb";
|
2020-08-18 02:22:01 +08:00
|
|
|
// IMPL-NEXT: case TDLC_clausec:
|
|
|
|
// IMPL-NEXT: return "clausec";
|
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
2020-07-01 02:36:37 +08:00
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-NEXT: llvm_unreachable("Invalid Tdl Clause kind");
|
2020-07-07 10:19:43 +08:00
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-EMPTY:
|
|
|
|
// IMPL-NEXT: bool llvm::tdl::isAllowedClauseForDirective(Directive D, Clause C, unsigned Version) {
|
|
|
|
// IMPL-NEXT: assert(unsigned(D) <= llvm::tdl::Directive_enumSize);
|
|
|
|
// IMPL-NEXT: assert(unsigned(C) <= llvm::tdl::Clause_enumSize);
|
2020-07-09 07:54:34 +08:00
|
|
|
// IMPL-NEXT: switch (D) {
|
|
|
|
// IMPL-NEXT: case TDLD_dira:
|
|
|
|
// IMPL-NEXT: switch (C) {
|
|
|
|
// IMPL-NEXT: case TDLC_clausea:
|
|
|
|
// IMPL-NEXT: return 2 <= Version && 4 >= Version;
|
|
|
|
// IMPL-NEXT: case TDLC_clauseb:
|
|
|
|
// IMPL-NEXT: return 2 <= Version && 2147483647 >= Version;
|
|
|
|
// IMPL-NEXT: default:
|
|
|
|
// IMPL-NEXT: return false;
|
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-NEXT: break;
|
|
|
|
// IMPL-NEXT: }
|
|
|
|
// IMPL-NEXT: llvm_unreachable("Invalid Tdl Directive kind");
|
2020-07-07 10:19:43 +08:00
|
|
|
// IMPL-NEXT: }
|
[flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.
Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert
Reviewed By: DavidTruby, ichoyjx
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83326
2020-07-12 00:42:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
// GEN: #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_SETS
|
|
|
|
// GEN-NEXT: #undef GEN_FLANG_DIRECTIVE_CLAUSE_SETS
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: namespace llvm {
|
|
|
|
// GEN-NEXT: namespace tdl {
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: // Sets for dira
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: static allowedClauses_TDLD_dira {
|
|
|
|
// GEN-NEXT: llvm::tdl::Clause::TDLC_clausea,
|
|
|
|
// GEN-NEXT: llvm::tdl::Clause::TDLC_clauseb,
|
|
|
|
// GEN-NEXT: };
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: static allowedOnceClauses_TDLD_dira {
|
|
|
|
// GEN-NEXT: };
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: static allowedExclusiveClauses_TDLD_dira {
|
|
|
|
// GEN-NEXT: };
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: static requiredClauses_TDLD_dira {
|
|
|
|
// GEN-NEXT: };
|
|
|
|
// GEN-NEXT: } // namespace tdl
|
|
|
|
// GEN-NEXT: } // namespace llvm
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_SETS
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_MAP
|
|
|
|
// GEN-NEXT: #undef GEN_FLANG_DIRECTIVE_CLAUSE_MAP
|
|
|
|
// GEN-EMPTY:
|
2020-08-06 02:20:26 +08:00
|
|
|
// GEN-NEXT: {
|
[flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.
Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert
Reviewed By: DavidTruby, ichoyjx
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83326
2020-07-12 00:42:05 +08:00
|
|
|
// GEN-NEXT: {llvm::tdl::Directive::TDLD_dira,
|
|
|
|
// GEN-NEXT: {
|
|
|
|
// GEN-NEXT: llvm::tdl::allowedClauses_TDLD_dira,
|
|
|
|
// GEN-NEXT: llvm::tdl::allowedOnceClauses_TDLD_dira,
|
|
|
|
// GEN-NEXT: llvm::tdl::allowedExclusiveClauses_TDLD_dira,
|
|
|
|
// GEN-NEXT: llvm::tdl::requiredClauses_TDLD_dira,
|
|
|
|
// GEN-NEXT: }
|
|
|
|
// GEN-NEXT: },
|
2020-08-06 02:20:26 +08:00
|
|
|
// GEN-NEXT: }
|
[flang][openmp] Check clauses allowed semantic with tablegen generated map
Summary:
This patch is enabling the generation of clauses enum sets for semantics check in Flang through
tablegen. Enum sets and directive - sets map is generated by the new tablegen infrsatructure for OpenMP
and other directive languages.
The semantic checks for OpenMP are modified to use this newly generated map.
Reviewers: DavidTruby, sscalpone, kiranchandramohan, ichoyjx, jdoerfert
Reviewed By: DavidTruby, ichoyjx
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83326
2020-07-12 00:42:05 +08:00
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_MAP
|
2020-08-11 22:43:56 +08:00
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES
|
|
|
|
// GEN-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_CLASSES
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: EMPTY_CLASS(Clausea);
|
2020-08-18 02:22:01 +08:00
|
|
|
// GEN-NEXT: WRAPPER_CLASS(Clauseb, std::list<IntExpr>);
|
|
|
|
// GEN-NEXT: WRAPPER_CLASS(Clausec, std::optional<Name>);
|
2020-08-11 22:43:56 +08:00
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST
|
|
|
|
// GEN-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: Clausea
|
|
|
|
// GEN-NEXT: , Clauseb
|
2020-08-18 02:22:01 +08:00
|
|
|
// GEN-NEXT: , Clausec
|
2020-08-11 22:43:56 +08:00
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #ifdef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES
|
|
|
|
// GEN-NEXT: #undef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: NODE(TdlClause, Clausea)
|
|
|
|
// GEN-NEXT: NODE(TdlClause, Clauseb)
|
2020-08-18 02:22:01 +08:00
|
|
|
// GEN-NEXT: NODE(TdlClause, Clausec)
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #endif // GEN_FLANG_DUMP_PARSE_TREE_CLAUSES
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #ifdef GEN_FLANG_CLAUSE_UNPARSE
|
|
|
|
// GEN-NEXT: #undef GEN_FLANG_CLAUSE_UNPARSE
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: void Before(const TdlClause::Clausea &) { Word("CLAUSEA"); }
|
|
|
|
// GEN-NEXT: void Unparse(const TdlClause::Clauseb &x) {
|
|
|
|
// GEN-NEXT: Word("CLAUSEB");
|
|
|
|
// GEN-NEXT: Put("(");
|
|
|
|
// GEN-NEXT: Walk(x.v, ",");
|
|
|
|
// GEN-NEXT: Put(")");
|
|
|
|
// GEN-NEXT: }
|
|
|
|
// GEN-NEXT: void Unparse(const TdlClause::Clausec &x) {
|
|
|
|
// GEN-NEXT: Word("CLAUSEC");
|
|
|
|
// GEN-NEXT: Put("(");
|
|
|
|
// GEN-NEXT: if (x.v.has_value())
|
|
|
|
// GEN-NEXT: Walk(x.v);
|
|
|
|
// GEN-NEXT: else
|
|
|
|
// GEN-NEXT: Put("*");
|
|
|
|
// GEN-NEXT: Put(")");
|
|
|
|
// GEN-NEXT: }
|
|
|
|
// GEN-EMPTY:
|
|
|
|
// GEN-NEXT: #endif // GEN_FLANG_CLAUSE_UNPARSE
|