From 49cf4f2457f321a8aec3d7606282e566c738e1a1 Mon Sep 17 00:00:00 2001 From: Valentin Clement Date: Tue, 23 Mar 2021 09:10:04 -0400 Subject: [PATCH] [openacc][openmp] Reduce number of generated file and prefer inclusion of .inc Follow up from D92955 and D83636. This patch makes the base cpp files OMP.cpp and ACC.cpp normal files and they now include the XXX.inc file generated by tablegen. This reduces the number of file generated by the DirectiveEmitter backend and makes it closer to the proposal in D83636. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D93560 --- include/llvm/Frontend/OpenACC/ACC.td | 1 - include/llvm/Frontend/OpenACC/CMakeLists.txt | 2 +- include/llvm/Frontend/OpenMP/CMakeLists.txt | 2 +- include/llvm/Frontend/OpenMP/OMP.td | 1 - include/llvm/TableGen/DirectiveEmitter.h | 4 - lib/Frontend/OpenACC/ACC.cpp | 19 ++ lib/Frontend/OpenACC/CMakeLists.txt | 7 +- lib/Frontend/OpenMP/CMakeLists.txt | 7 +- lib/Frontend/OpenMP/OMP.cpp | 19 ++ test/TableGen/directive1.td | 242 ++++++++------- test/TableGen/directive2.td | 281 +++++++++--------- test/TableGen/directive3.td | 1 - utils/TableGen/DirectiveEmitter.cpp | 48 ++- utils/TableGen/TableGen.cpp | 8 +- utils/TableGen/TableGenBackends.h | 1 - .../include/llvm/Frontend/OpenACC/BUILD.gn | 2 +- .../include/llvm/Frontend/OpenMP/BUILD.gn | 2 +- 17 files changed, 337 insertions(+), 310 deletions(-) create mode 100644 lib/Frontend/OpenACC/ACC.cpp create mode 100644 lib/Frontend/OpenMP/OMP.cpp diff --git a/include/llvm/Frontend/OpenACC/ACC.td b/include/llvm/Frontend/OpenACC/ACC.td index 44de0d87573..c68330665b0 100644 --- a/include/llvm/Frontend/OpenACC/ACC.td +++ b/include/llvm/Frontend/OpenACC/ACC.td @@ -23,7 +23,6 @@ def OpenACC : DirectiveLanguage { let clausePrefix = "ACCC_"; let makeEnumAvailableInNamespace = true; let enableBitmaskEnumInNamespace = true; - let includeHeader = "llvm/Frontend/OpenACC/ACC.h.inc"; let clauseEnumSetClass = "AccClauseSet"; let flangClauseBaseClass = "AccClause"; } diff --git a/include/llvm/Frontend/OpenACC/CMakeLists.txt b/include/llvm/Frontend/OpenACC/CMakeLists.txt index b8332e03ff8..558de3aa922 100644 --- a/include/llvm/Frontend/OpenACC/CMakeLists.txt +++ b/include/llvm/Frontend/OpenACC/CMakeLists.txt @@ -1,4 +1,4 @@ set(LLVM_TARGET_DEFINITIONS ACC.td) tablegen(LLVM ACC.h.inc --gen-directive-decl) -tablegen(LLVM ACC.inc --gen-directive-gen) +tablegen(LLVM ACC.inc --gen-directive-impl) add_public_tablegen_target(acc_gen) diff --git a/include/llvm/Frontend/OpenMP/CMakeLists.txt b/include/llvm/Frontend/OpenMP/CMakeLists.txt index 1359929b67c..e983cf5ca56 100644 --- a/include/llvm/Frontend/OpenMP/CMakeLists.txt +++ b/include/llvm/Frontend/OpenMP/CMakeLists.txt @@ -1,4 +1,4 @@ set(LLVM_TARGET_DEFINITIONS OMP.td) tablegen(LLVM OMP.h.inc --gen-directive-decl) -tablegen(LLVM OMP.inc --gen-directive-gen) +tablegen(LLVM OMP.inc --gen-directive-impl) add_public_tablegen_target(omp_gen) diff --git a/include/llvm/Frontend/OpenMP/OMP.td b/include/llvm/Frontend/OpenMP/OMP.td index abd636c07e9..7845e4bc98d 100644 --- a/include/llvm/Frontend/OpenMP/OMP.td +++ b/include/llvm/Frontend/OpenMP/OMP.td @@ -23,7 +23,6 @@ def OpenMP : DirectiveLanguage { let clausePrefix = "OMPC_"; let makeEnumAvailableInNamespace = true; let enableBitmaskEnumInNamespace = true; - let includeHeader = "llvm/Frontend/OpenMP/OMP.h.inc"; let clauseEnumSetClass = "OmpClauseSet"; let flangClauseBaseClass = "OmpClause"; } diff --git a/include/llvm/TableGen/DirectiveEmitter.h b/include/llvm/TableGen/DirectiveEmitter.h index b1757249670..5c4a736eb10 100644 --- a/include/llvm/TableGen/DirectiveEmitter.h +++ b/include/llvm/TableGen/DirectiveEmitter.h @@ -30,10 +30,6 @@ public: return Def->getValueAsString("clausePrefix"); } - StringRef getIncludeHeader() const { - return Def->getValueAsString("includeHeader"); - } - StringRef getClauseEnumSetClass() const { return Def->getValueAsString("clauseEnumSetClass"); } diff --git a/lib/Frontend/OpenACC/ACC.cpp b/lib/Frontend/OpenACC/ACC.cpp new file mode 100644 index 00000000000..1e0516021bc --- /dev/null +++ b/lib/Frontend/OpenACC/ACC.cpp @@ -0,0 +1,19 @@ +//===- ACC.cpp ------ Collection of helpers for OpenACC -------------------===// +// +// 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: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "llvm/Frontend/OpenACC/ACC.h.inc" + +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSwitch.h" +#include "llvm/Support/ErrorHandling.h" + +using namespace llvm; +using namespace acc; + +#define GEN_DIRECTIVES_IMPL +#include "llvm/Frontend/OpenACC/ACC.inc" diff --git a/lib/Frontend/OpenACC/CMakeLists.txt b/lib/Frontend/OpenACC/CMakeLists.txt index ba340ab9c56..f3520149786 100644 --- a/lib/Frontend/OpenACC/CMakeLists.txt +++ b/lib/Frontend/OpenACC/CMakeLists.txt @@ -1,9 +1,5 @@ -set(LLVM_TARGET_DEFINITIONS ${LLVM_MAIN_INCLUDE_DIR}/llvm/Frontend/OpenACC/ACC.td) -tablegen(LLVM ACC.cpp --gen-directive-impl) -add_public_tablegen_target(acc_cpp) - add_llvm_component_library(LLVMFrontendOpenACC - ACC.cpp # Generated by tablegen above + ACC.cpp ADDITIONAL_HEADER_DIRS ${LLVM_MAIN_INCLUDE_DIR}/llvm/Frontend @@ -11,7 +7,6 @@ add_llvm_component_library(LLVMFrontendOpenACC DEPENDS acc_gen - acc_cpp ) target_link_libraries(LLVMFrontendOpenACC LLVMSupport) diff --git a/lib/Frontend/OpenMP/CMakeLists.txt b/lib/Frontend/OpenMP/CMakeLists.txt index cc5d3a76687..17ca2c63327 100644 --- a/lib/Frontend/OpenMP/CMakeLists.txt +++ b/lib/Frontend/OpenMP/CMakeLists.txt @@ -1,9 +1,5 @@ -set(LLVM_TARGET_DEFINITIONS ${LLVM_MAIN_INCLUDE_DIR}/llvm/Frontend/OpenMP/OMP.td) -tablegen(LLVM OMP.cpp --gen-directive-impl) -add_public_tablegen_target(omp_cpp) - add_llvm_component_library(LLVMFrontendOpenMP - OMP.cpp # Generated by tablegen above + OMP.cpp OMPContext.cpp OMPIRBuilder.cpp @@ -14,7 +10,6 @@ add_llvm_component_library(LLVMFrontendOpenMP DEPENDS intrinsics_gen omp_gen - omp_cpp LINK_COMPONENTS Core diff --git a/lib/Frontend/OpenMP/OMP.cpp b/lib/Frontend/OpenMP/OMP.cpp new file mode 100644 index 00000000000..eac5d4168c5 --- /dev/null +++ b/lib/Frontend/OpenMP/OMP.cpp @@ -0,0 +1,19 @@ +//===- OMP.cpp ------ Collection of helpers for OpenMP --------------------===// +// +// 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: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "llvm/Frontend/OpenMP/OMP.h.inc" + +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSwitch.h" +#include "llvm/Support/ErrorHandling.h" + +using namespace llvm; +using namespace omp; + +#define GEN_DIRECTIVES_IMPL +#include "llvm/Frontend/OpenMP/OMP.inc" diff --git a/test/TableGen/directive1.td b/test/TableGen/directive1.td index a6995817526..b5fc08c15a5 100644 --- a/test/TableGen/directive1.td +++ b/test/TableGen/directive1.td @@ -1,6 +1,5 @@ // 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 -// RUN: llvm-tblgen -gen-directive-gen -I %p/../../include %s | FileCheck -match-full-lines %s -check-prefix=GEN include "llvm/Frontend/Directive/DirectiveBase.td" @@ -101,12 +100,143 @@ def TDL_DirA : Directive<"dira"> { // CHECK-NEXT: #endif // LLVM_Tdl_INC -// IMPL: #include "llvm/ADT/StringRef.h" -// IMPL-NEXT: #include "llvm/ADT/StringSwitch.h" -// IMPL-NEXT: #include "llvm/Support/ErrorHandling.h" +// IMPL: #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_SETS +// IMPL-NEXT: #undef GEN_FLANG_DIRECTIVE_CLAUSE_SETS // IMPL-EMPTY: -// IMPL-NEXT: using namespace llvm; -// IMPL-NEXT: using namespace tdl; +// IMPL-NEXT: namespace llvm { +// IMPL-NEXT: namespace tdl { +// IMPL-EMPTY: +// IMPL-NEXT: // Sets for dira +// IMPL-EMPTY: +// IMPL-NEXT: static allowedClauses_TDLD_dira { +// IMPL-NEXT: llvm::tdl::Clause::TDLC_clausea, +// IMPL-NEXT: llvm::tdl::Clause::TDLC_clauseb, +// IMPL-NEXT: }; +// IMPL-EMPTY: +// IMPL-NEXT: static allowedOnceClauses_TDLD_dira { +// IMPL-NEXT: }; +// IMPL-EMPTY: +// IMPL-NEXT: static allowedExclusiveClauses_TDLD_dira { +// IMPL-NEXT: }; +// IMPL-EMPTY: +// IMPL-NEXT: static requiredClauses_TDLD_dira { +// IMPL-NEXT: }; +// IMPL-NEXT: } // namespace tdl +// IMPL-NEXT: } // namespace llvm +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_SETS +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_MAP +// IMPL-NEXT: #undef GEN_FLANG_DIRECTIVE_CLAUSE_MAP +// IMPL-EMPTY: +// IMPL-NEXT: { +// IMPL-NEXT: {llvm::tdl::Directive::TDLD_dira, +// IMPL-NEXT: { +// IMPL-NEXT: llvm::tdl::allowedClauses_TDLD_dira, +// IMPL-NEXT: llvm::tdl::allowedOnceClauses_TDLD_dira, +// IMPL-NEXT: llvm::tdl::allowedExclusiveClauses_TDLD_dira, +// IMPL-NEXT: llvm::tdl::requiredClauses_TDLD_dira, +// IMPL-NEXT: } +// IMPL-NEXT: }, +// IMPL-NEXT: } +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_MAP +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_CLASSES +// IMPL-EMPTY: +// IMPL-NEXT: EMPTY_CLASS(Clausea); +// IMPL-NEXT: WRAPPER_CLASS(Clauseb, std::optional); +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST +// IMPL-EMPTY: +// IMPL-NEXT: Clausea +// IMPL-NEXT: , Clauseb +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES +// IMPL-NEXT: #undef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES +// IMPL-EMPTY: +// IMPL-NEXT: NODE(TdlClause, Clausea) +// IMPL-NEXT: NODE(TdlClause, Clauseb) +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_DUMP_PARSE_TREE_CLAUSES +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_UNPARSE +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_UNPARSE +// IMPL-EMPTY: +// IMPL-NEXT: void Before(const TdlClause::Clausea &) { Word("CLAUSEA"); } +// IMPL-NEXT: void Unparse(const TdlClause::Clauseb &x) { +// IMPL-NEXT: Word("CLAUSEB"); +// IMPL-NEXT: Walk("(", x.v, ")"); +// IMPL-NEXT: } +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_UNPARSE +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_CHECK_ENTER +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_CHECK_ENTER +// IMPL-EMPTY: +// IMPL-NEXT: void Enter(const parser::TdlClause::Clausea &); +// IMPL-NEXT: void Enter(const parser::TdlClause::Clauseb &); +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_CHECK_ENTER +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_KIND_MAP +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_KIND_MAP +// IMPL-EMPTY: +// IMPL-NEXT: if constexpr (std::is_same_v) +// IMPL-NEXT: return llvm::tdl::Clause::TDLC_clausea; +// IMPL-NEXT: if constexpr (std::is_same_v) +// IMPL-NEXT: return llvm::tdl::Clause::TDLC_clauseb; +// IMPL-NEXT: llvm_unreachable("Invalid Tdl Parser clause"); +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_KIND_MAP +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_CLANG_CLAUSE_CLASS +// IMPL-NEXT: #undef GEN_CLANG_CLAUSE_CLASS +// IMPL-EMPTY: +// IMPL-NEXT: #ifndef CLAUSE +// IMPL-NEXT: #define CLAUSE(Enum, Str, Implicit) +// IMPL-NEXT: #endif +// IMPL-NEXT: #ifndef CLAUSE_CLASS +// IMPL-NEXT: #define CLAUSE_CLASS(Enum, Str, Class) +// IMPL-NEXT: #endif +// IMPL-NEXT: #ifndef CLAUSE_NO_CLASS +// IMPL-NEXT: #define CLAUSE_NO_CLASS(Enum, Str) +// IMPL-NEXT: #endif +// IMPL-EMPTY: +// IMPL-NEXT: #define __CLAUSE(Name, Class) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, #Name, /* Implicit */ false) \ +// IMPL-NEXT: CLAUSE_CLASS(TDLC_##Name, #Name, Class) +// IMPL-NEXT: #define __CLAUSE_NO_CLASS(Name) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, #Name, /* Implicit */ false) \ +// IMPL-NEXT: CLAUSE_NO_CLASS(TDLC_##Name, #Name) +// IMPL-NEXT: #define __IMPLICIT_CLAUSE_CLASS(Name, Str, Class) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, Str, /* Implicit */ true) \ +// IMPL-NEXT: CLAUSE_CLASS(TDLC_##Name, Str, Class) +// IMPL-NEXT: #define __IMPLICIT_CLAUSE_NO_CLASS(Name, Str) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, Str, /* Implicit */ true) \ +// IMPL-NEXT: CLAUSE_NO_CLASS(TDLC_##Name, Str) +// IMPL-EMPTY: +// IMPL-NEXT: __CLAUSE_NO_CLASS(clausea) +// IMPL-NEXT: __CLAUSE_NO_CLASS(clauseb) +// IMPL-EMPTY: +// IMPL-NEXT: #undef __IMPLICIT_CLAUSE_NO_CLASS +// IMPL-NEXT: #undef __IMPLICIT_CLAUSE_CLASS +// IMPL-NEXT: #undef __CLAUSE +// IMPL-NEXT: #undef CLAUSE_NO_CLASS +// IMPL-NEXT: #undef CLAUSE_CLASS +// IMPL-NEXT: #undef CLAUSE +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_CLANG_CLAUSE_CLASS +// IMPL-EMPTY: + +// IMPL: #ifdef GEN_DIRECTIVES_IMPL +// IMPL-NEXT: #undef GEN_DIRECTIVES_IMPL // IMPL-EMPTY: // IMPL-NEXT: Directive llvm::tdl::getTdlDirectiveKind(llvm::StringRef Str) { // IMPL-NEXT: return llvm::StringSwitch(Str) @@ -177,102 +307,4 @@ def TDL_DirA : Directive<"dira"> { // IMPL-NEXT: llvm_unreachable("Invalid Tdl Directive kind"); // IMPL-NEXT: } // IMPL-EMPTY: - - - -// 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: -// GEN-NEXT: { -// 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: }, -// GEN-NEXT: } -// GEN-EMPTY: -// GEN-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_MAP -// 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); -// GEN-NEXT: WRAPPER_CLASS(Clauseb, std::optional); -// 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 -// 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) -// 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: Walk("(", x.v, ")"); -// GEN-NEXT: } -// GEN-EMPTY: -// GEN-NEXT: #endif // GEN_FLANG_CLAUSE_UNPARSE -// GEN-EMPTY: -// GEN-NEXT: #ifdef GEN_FLANG_CLAUSE_CHECK_ENTER -// GEN-NEXT: #undef GEN_FLANG_CLAUSE_CHECK_ENTER -// GEN-EMPTY: -// GEN-NEXT: void Enter(const parser::TdlClause::Clausea &); -// GEN-NEXT: void Enter(const parser::TdlClause::Clauseb &); -// GEN-EMPTY: -// GEN-NEXT: #endif // GEN_FLANG_CLAUSE_CHECK_ENTER -// GEN-EMPTY: -// GEN-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_KIND_MAP -// GEN-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_KIND_MAP -// GEN-EMPTY: -// GEN-NEXT: if constexpr (std::is_same_v) -// GEN-NEXT: return llvm::tdl::Clause::TDLC_clausea; -// GEN-NEXT: if constexpr (std::is_same_v) -// GEN-NEXT: return llvm::tdl::Clause::TDLC_clauseb; -// GEN-NEXT: llvm_unreachable("Invalid Tdl Parser clause"); -// GEN-EMPTY: -// GEN-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_KIND_MAP -// GEN-EMPTY: +// IMPL-NEXT: #endif // GEN_DIRECTIVES_IMPL diff --git a/test/TableGen/directive2.td b/test/TableGen/directive2.td index 1e02cbd01da..154d1e86ffb 100644 --- a/test/TableGen/directive2.td +++ b/test/TableGen/directive2.td @@ -1,6 +1,5 @@ // 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 -// RUN: llvm-tblgen -gen-directive-gen -I %p/../../include %s | FileCheck -match-full-lines %s -check-prefix=GEN include "llvm/Frontend/Directive/DirectiveBase.td" @@ -79,14 +78,143 @@ def TDL_DirA : Directive<"dira"> { // CHECK-NEXT: } // namespace llvm // CHECK-NEXT: #endif // LLVM_Tdl_INC -// IMPL: #include "tdl.h.inc" +// IMPL: #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_SETS +// IMPL-NEXT: #undef GEN_FLANG_DIRECTIVE_CLAUSE_SETS // IMPL-EMPTY: -// IMPL-NEXT: #include "llvm/ADT/StringRef.h" -// IMPL-NEXT: #include "llvm/ADT/StringSwitch.h" -// IMPL-NEXT: #include "llvm/Support/ErrorHandling.h" +// IMPL-NEXT: namespace llvm { +// IMPL-NEXT: namespace tdl { // IMPL-EMPTY: -// IMPL-NEXT: using namespace llvm; -// IMPL-NEXT: using namespace tdl; +// IMPL-NEXT: // Sets for dira +// IMPL-EMPTY: +// IMPL-NEXT: static allowedClauses_TDLD_dira { +// IMPL-NEXT: llvm::tdl::Clause::TDLC_clausea, +// IMPL-NEXT: llvm::tdl::Clause::TDLC_clauseb, +// IMPL-NEXT: }; +// IMPL-EMPTY: +// IMPL-NEXT: static allowedOnceClauses_TDLD_dira { +// IMPL-NEXT: }; +// IMPL-EMPTY: +// IMPL-NEXT: static allowedExclusiveClauses_TDLD_dira { +// IMPL-NEXT: }; +// IMPL-EMPTY: +// IMPL-NEXT: static requiredClauses_TDLD_dira { +// IMPL-NEXT: }; +// IMPL-NEXT: } // namespace tdl +// IMPL-NEXT: } // namespace llvm +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_SETS +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_DIRECTIVE_CLAUSE_MAP +// IMPL-NEXT: #undef GEN_FLANG_DIRECTIVE_CLAUSE_MAP +// IMPL-EMPTY: +// IMPL-NEXT: { +// IMPL-NEXT: {llvm::tdl::Directive::TDLD_dira, +// IMPL-NEXT: { +// IMPL-NEXT: llvm::tdl::allowedClauses_TDLD_dira, +// IMPL-NEXT: llvm::tdl::allowedOnceClauses_TDLD_dira, +// IMPL-NEXT: llvm::tdl::allowedExclusiveClauses_TDLD_dira, +// IMPL-NEXT: llvm::tdl::requiredClauses_TDLD_dira, +// IMPL-NEXT: } +// IMPL-NEXT: }, +// IMPL-NEXT: } +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_MAP +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_CLASSES +// IMPL-EMPTY: +// IMPL-NEXT: EMPTY_CLASS(Clausea); +// IMPL-NEXT: WRAPPER_CLASS(Clauseb, std::list); +// IMPL-NEXT: WRAPPER_CLASS(Clausec, std::optional); +// IMPL-NEXT: EMPTY_CLASS(Claused); +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST +// IMPL-EMPTY: +// IMPL-NEXT: Clausea +// IMPL-NEXT: , Clauseb +// IMPL-NEXT: , Clausec +// IMPL-NEXT: , Claused +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_PARSER_CLASSES_LIST +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES +// IMPL-NEXT: #undef GEN_FLANG_DUMP_PARSE_TREE_CLAUSES +// IMPL-EMPTY: +// IMPL-NEXT: NODE(TdlClause, Clausea) +// IMPL-NEXT: NODE(TdlClause, Clauseb) +// IMPL-NEXT: NODE(TdlClause, Clausec) +// IMPL-NEXT: NODE(TdlClause, Claused) +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_DUMP_PARSE_TREE_CLAUSES +// IMPL-EMPTY: +// IMPL-NEXT: #ifdef GEN_FLANG_CLAUSE_UNPARSE +// IMPL-NEXT: #undef GEN_FLANG_CLAUSE_UNPARSE +// IMPL-EMPTY: +// IMPL-NEXT: void Before(const TdlClause::Clausea &) { Word("CLAUSEA"); } +// IMPL-NEXT: void Unparse(const TdlClause::Clauseb &x) { +// IMPL-NEXT: Word("CLAUSEB"); +// IMPL-NEXT: Put("("); +// IMPL-NEXT: Walk(x.v, ","); +// IMPL-NEXT: Put(")"); +// IMPL-NEXT: } +// IMPL-NEXT: void Unparse(const TdlClause::Clausec &x) { +// IMPL-NEXT: Word("CLAUSEC"); +// IMPL-NEXT: Put("("); +// IMPL-NEXT: if (x.v.has_value()) +// IMPL-NEXT: Walk(x.v); +// IMPL-NEXT: else +// IMPL-NEXT: Put("*"); +// IMPL-NEXT: Put(")"); +// IMPL-NEXT: } +// IMPL-NEXT: void Before(const TdlClause::Claused &) { Word("CLAUSED"); } +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_FLANG_CLAUSE_UNPARSE + +// IMPL: #ifdef GEN_CLANG_CLAUSE_CLASS +// IMPL-NEXT: #undef GEN_CLANG_CLAUSE_CLASS +// IMPL-EMPTY: +// IMPL-NEXT: #ifndef CLAUSE +// IMPL-NEXT: #define CLAUSE(Enum, Str, Implicit) +// IMPL-NEXT: #endif +// IMPL-NEXT: #ifndef CLAUSE_CLASS +// IMPL-NEXT: #define CLAUSE_CLASS(Enum, Str, Class) +// IMPL-NEXT: #endif +// IMPL-NEXT: #ifndef CLAUSE_NO_CLASS +// IMPL-NEXT: #define CLAUSE_NO_CLASS(Enum, Str) +// IMPL-NEXT: #endif +// IMPL-EMPTY: +// IMPL-NEXT: #define __CLAUSE(Name, Class) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, #Name, /* Implicit */ false) \ +// IMPL-NEXT: CLAUSE_CLASS(TDLC_##Name, #Name, Class) +// IMPL-NEXT: #define __CLAUSE_NO_CLASS(Name) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, #Name, /* Implicit */ false) \ +// IMPL-NEXT: CLAUSE_NO_CLASS(TDLC_##Name, #Name) +// IMPL-NEXT: #define __IMPLICIT_CLAUSE_CLASS(Name, Str, Class) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, Str, /* Implicit */ true) \ +// IMPL-NEXT: CLAUSE_CLASS(TDLC_##Name, Str, Class) +// IMPL-NEXT: #define __IMPLICIT_CLAUSE_NO_CLASS(Name, Str) \ +// IMPL-NEXT: CLAUSE(TDLC_##Name, Str, /* Implicit */ true) \ +// IMPL-NEXT: CLAUSE_NO_CLASS(TDLC_##Name, Str) +// IMPL-EMPTY: +// IMPL-NEXT: __IMPLICIT_CLAUSE_NO_CLASS(clausea, "clausea") +// IMPL-NEXT: __CLAUSE_NO_CLASS(clauseb) +// IMPL-NEXT: __CLAUSE(clausec, ClauseC) +// IMPL-NEXT: __IMPLICIT_CLAUSE_CLASS(claused, "claused", ClauseD) +// IMPL-EMPTY: +// IMPL-NEXT: #undef __IMPLICIT_CLAUSE_NO_CLASS +// IMPL-NEXT: #undef __IMPLICIT_CLAUSE_CLASS +// IMPL-NEXT: #undef __CLAUSE +// IMPL-NEXT: #undef CLAUSE_NO_CLASS +// IMPL-NEXT: #undef CLAUSE_CLASS +// IMPL-NEXT: #undef CLAUSE +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_CLANG_CLAUSE_CLASS + +// IMPL: #ifdef GEN_DIRECTIVES_IMPL +// IMPL-NEXT: #undef GEN_DIRECTIVES_IMPL // IMPL-EMPTY: // IMPL-NEXT: Directive llvm::tdl::getTdlDirectiveKind(llvm::StringRef Str) { // IMPL-NEXT: return llvm::StringSwitch(Str) @@ -142,140 +270,5 @@ def TDL_DirA : Directive<"dira"> { // IMPL-NEXT: } // IMPL-NEXT: llvm_unreachable("Invalid Tdl Directive kind"); // IMPL-NEXT: } - - -// 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: -// GEN-NEXT: { -// 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: }, -// GEN-NEXT: } -// GEN-EMPTY: -// GEN-NEXT: #endif // GEN_FLANG_DIRECTIVE_CLAUSE_MAP -// 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); -// GEN-NEXT: WRAPPER_CLASS(Clauseb, std::list); -// GEN-NEXT: WRAPPER_CLASS(Clausec, std::optional); -// GEN-NEXT: EMPTY_CLASS(Claused); -// 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 -// GEN-NEXT: , Clausec -// GEN-NEXT: , Claused -// 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) -// GEN-NEXT: NODE(TdlClause, Clausec) -// GEN-NEXT: NODE(TdlClause, Claused) -// 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-NEXT: void Before(const TdlClause::Claused &) { Word("CLAUSED"); } -// GEN-EMPTY: -// GEN-NEXT: #endif // GEN_FLANG_CLAUSE_UNPARSE - -// GEN: #ifdef GEN_CLANG_CLAUSE_CLASS -// GEN-NEXT: #undef GEN_CLANG_CLAUSE_CLASS -// GEN-EMPTY: -// GEN-NEXT: #ifndef CLAUSE -// GEN-NEXT: #define CLAUSE(Enum, Str, Implicit) -// GEN-NEXT: #endif -// GEN-NEXT: #ifndef CLAUSE_CLASS -// GEN-NEXT: #define CLAUSE_CLASS(Enum, Str, Class) -// GEN-NEXT: #endif -// GEN-NEXT: #ifndef CLAUSE_NO_CLASS -// GEN-NEXT: #define CLAUSE_NO_CLASS(Enum, Str) -// GEN-NEXT: #endif -// GEN-EMPTY: -// GEN-NEXT: #define __CLAUSE(Name, Class) \ -// GEN-NEXT: CLAUSE(TDLC_##Name, #Name, /* Implicit */ false) \ -// GEN-NEXT: CLAUSE_CLASS(TDLC_##Name, #Name, Class) -// GEN-NEXT: #define __CLAUSE_NO_CLASS(Name) \ -// GEN-NEXT: CLAUSE(TDLC_##Name, #Name, /* Implicit */ false) \ -// GEN-NEXT: CLAUSE_NO_CLASS(TDLC_##Name, #Name) -// GEN-NEXT: #define __IMPLICIT_CLAUSE_CLASS(Name, Str, Class) \ -// GEN-NEXT: CLAUSE(TDLC_##Name, Str, /* Implicit */ true) \ -// GEN-NEXT: CLAUSE_CLASS(TDLC_##Name, Str, Class) -// GEN-NEXT: #define __IMPLICIT_CLAUSE_NO_CLASS(Name, Str) \ -// GEN-NEXT: CLAUSE(TDLC_##Name, Str, /* Implicit */ true) \ -// GEN-NEXT: CLAUSE_NO_CLASS(TDLC_##Name, Str) -// GEN-EMPTY: -// GEN-NEXT: __IMPLICIT_CLAUSE_NO_CLASS(clausea, "clausea") -// GEN-NEXT: __CLAUSE_NO_CLASS(clauseb) -// GEN-NEXT: __CLAUSE(clausec, ClauseC) -// GEN-NEXT: __IMPLICIT_CLAUSE_CLASS(claused, "claused", ClauseD) -// GEN-EMPTY: -// GEN-NEXT: #undef __IMPLICIT_CLAUSE_NO_CLASS -// GEN-NEXT: #undef __IMPLICIT_CLAUSE_CLASS -// GEN-NEXT: #undef __CLAUSE -// GEN-NEXT: #undef CLAUSE_NO_CLASS -// GEN-NEXT: #undef CLAUSE_CLASS -// GEN-NEXT: #undef CLAUSE -// GEN-EMPTY: -// GEN-NEXT: #endif // GEN_CLANG_CLAUSE_CLASS - +// IMPL-EMPTY: +// IMPL-NEXT: #endif // GEN_DIRECTIVES_IMPL diff --git a/test/TableGen/directive3.td b/test/TableGen/directive3.td index 8af4594f299..2a82b5ebcb4 100644 --- a/test/TableGen/directive3.td +++ b/test/TableGen/directive3.td @@ -1,6 +1,5 @@ // RUN: not llvm-tblgen -gen-directive-decl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s // RUN: not llvm-tblgen -gen-directive-impl -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s -// RUN: not llvm-tblgen -gen-directive-gen -I %p/../../include %s 2>&1 | FileCheck -match-full-lines %s include "llvm/Frontend/Directive/DirectiveBase.td" diff --git a/utils/TableGen/DirectiveEmitter.cpp b/utils/TableGen/DirectiveEmitter.cpp index b331fd9c061..b21bf369d18 100644 --- a/utils/TableGen/DirectiveEmitter.cpp +++ b/utils/TableGen/DirectiveEmitter.cpp @@ -758,37 +758,11 @@ void GenerateClauseClassMacro(const DirectiveLanguage &DirLang, OS << "#undef CLAUSE\n"; } -// Generate the implementation section for the enumeration in the directive -// language. -void EmitDirectivesGen(RecordKeeper &Records, raw_ostream &OS) { - const auto DirLang = DirectiveLanguage{Records}; - if (DirLang.HasValidityErrors()) - return; - - EmitDirectivesFlangImpl(DirLang, OS); - - GenerateClauseClassMacro(DirLang, OS); -} - -// Generate the implementation for the enumeration in the directive +// Generate the implemenation for the enumeration in the directive // language. This code can be included in library. -void EmitDirectivesImpl(RecordKeeper &Records, raw_ostream &OS) { - const auto DirLang = DirectiveLanguage{Records}; - if (DirLang.HasValidityErrors()) - return; - - if (!DirLang.getIncludeHeader().empty()) - OS << "#include \"" << DirLang.getIncludeHeader() << "\"\n\n"; - - OS << "#include \"llvm/ADT/StringRef.h\"\n"; - OS << "#include \"llvm/ADT/StringSwitch.h\"\n"; - OS << "#include \"llvm/Support/ErrorHandling.h\"\n"; - OS << "\n"; - OS << "using namespace llvm;\n"; - llvm::SmallVector Namespaces; - llvm::SplitString(DirLang.getCppNamespace(), Namespaces, "::"); - for (auto Ns : Namespaces) - OS << "using namespace " << Ns << ";\n"; +void EmitDirectivesBasicImpl(const DirectiveLanguage &DirLang, + raw_ostream &OS) { + IfDefScope Scope("GEN_DIRECTIVES_IMPL", OS); // getDirectiveKind(StringRef Str) GenerateGetKind(DirLang.getDirectives(), OS, "Directive", DirLang, @@ -814,4 +788,18 @@ void EmitDirectivesImpl(RecordKeeper &Records, raw_ostream &OS) { GenerateIsAllowedClause(DirLang, OS); } +// Generate the implemenation section for the enumeration in the directive +// language. +void EmitDirectivesImpl(RecordKeeper &Records, raw_ostream &OS) { + const auto DirLang = DirectiveLanguage{Records}; + if (DirLang.HasValidityErrors()) + return; + + EmitDirectivesFlangImpl(DirLang, OS); + + GenerateClauseClassMacro(DirLang, OS); + + EmitDirectivesBasicImpl(DirLang, OS); +} + } // namespace llvm diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp index a4b16179cdf..24c11c8bc83 100644 --- a/utils/TableGen/TableGen.cpp +++ b/utils/TableGen/TableGen.cpp @@ -57,7 +57,6 @@ enum ActionType { GenAutomata, GenDirectivesEnumDecl, GenDirectivesEnumImpl, - GenDirectivesEnumGen, }; namespace llvm { @@ -139,9 +138,7 @@ cl::opt Action( clEnumValN(GenDirectivesEnumDecl, "gen-directive-decl", "Generate directive related declaration code (header file)"), clEnumValN(GenDirectivesEnumImpl, "gen-directive-impl", - "Generate directive related implementation code"), - clEnumValN(GenDirectivesEnumGen, "gen-directive-gen", - "Generate directive related implementation code part"))); + "Generate directive related implementation code"))); cl::OptionCategory PrintEnumsCat("Options for -print-enums"); cl::opt Class("class", cl::desc("Print Enum list for this class"), @@ -275,9 +272,6 @@ bool LLVMTableGenMain(raw_ostream &OS, RecordKeeper &Records) { case GenDirectivesEnumImpl: EmitDirectivesImpl(Records, OS); break; - case GenDirectivesEnumGen: - EmitDirectivesGen(Records, OS); - break; } return false; diff --git a/utils/TableGen/TableGenBackends.h b/utils/TableGen/TableGenBackends.h index ed0057c697c..71db8dc77b0 100644 --- a/utils/TableGen/TableGenBackends.h +++ b/utils/TableGen/TableGenBackends.h @@ -93,7 +93,6 @@ void EmitExegesis(RecordKeeper &RK, raw_ostream &OS); void EmitAutomata(RecordKeeper &RK, raw_ostream &OS); void EmitDirectivesDecl(RecordKeeper &RK, raw_ostream &OS); void EmitDirectivesImpl(RecordKeeper &RK, raw_ostream &OS); -void EmitDirectivesGen(RecordKeeper &RK, raw_ostream &OS); } // End llvm namespace diff --git a/utils/gn/secondary/llvm/include/llvm/Frontend/OpenACC/BUILD.gn b/utils/gn/secondary/llvm/include/llvm/Frontend/OpenACC/BUILD.gn index 995b7f29e52..c6d80b2be3f 100644 --- a/utils/gn/secondary/llvm/include/llvm/Frontend/OpenACC/BUILD.gn +++ b/utils/gn/secondary/llvm/include/llvm/Frontend/OpenACC/BUILD.gn @@ -8,7 +8,7 @@ tablegen("ACC") { tablegen("ACCcpp") { visibility = [ ":acc_gen" ] - args = [ "-gen-directive-gen" ] + args = [ "-gen-directive-impl" ] output_name = "ACC.inc" td_file = "ACC.td" } diff --git a/utils/gn/secondary/llvm/include/llvm/Frontend/OpenMP/BUILD.gn b/utils/gn/secondary/llvm/include/llvm/Frontend/OpenMP/BUILD.gn index 04bfdd6f313..d99b8b5a1e2 100644 --- a/utils/gn/secondary/llvm/include/llvm/Frontend/OpenMP/BUILD.gn +++ b/utils/gn/secondary/llvm/include/llvm/Frontend/OpenMP/BUILD.gn @@ -9,7 +9,7 @@ tablegen("OMPh") { tablegen("OMP") { visibility = [ ":public_tablegen" ] - args = [ "-gen-directive-gen" ] + args = [ "-gen-directive-impl" ] } # Groups all tablegen() calls that create .inc files that are included in