Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions llvm/test/TableGen/directive1.td
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def TDL_DirA : Directive<"dira"> {
// CHECK-EMPTY:
// CHECK-NEXT: static constexpr std::size_t Directive_enumSize = 1;
// CHECK-EMPTY:
// CHECK-NEXT: constexpr auto TDLD_dira = llvm::tdl::Directive::TDLD_dira;
// CHECK-NEXT: constexpr auto TDLD_dira = Directive::TDLD_dira;
// CHECK-EMPTY:
// CHECK-NEXT: enum class Clause {
// CHECK-NEXT: TDLC_clausea,
Expand All @@ -108,28 +108,28 @@ def TDL_DirA : Directive<"dira"> {
// CHECK-EMPTY:
// CHECK-NEXT: static constexpr std::size_t Clause_enumSize = 3;
// CHECK-EMPTY:
// CHECK-NEXT: constexpr auto TDLC_clausea = llvm::tdl::Clause::TDLC_clausea;
// CHECK-NEXT: constexpr auto TDLC_clauseb = llvm::tdl::Clause::TDLC_clauseb;
// CHECK-NEXT: constexpr auto TDLC_clausec = llvm::tdl::Clause::TDLC_clausec;
// CHECK-NEXT: constexpr auto TDLC_clausea = Clause::TDLC_clausea;
// CHECK-NEXT: constexpr auto TDLC_clauseb = Clause::TDLC_clauseb;
// CHECK-NEXT: constexpr auto TDLC_clausec = Clause::TDLC_clausec;
// CHECK-EMPTY:
// CHECK-NEXT: enum class AKind {
// CHECK-NEXT: TDLCV_vala=1,
// CHECK-NEXT: TDLCV_valb=2,
// CHECK-NEXT: TDLCV_valc=3,
// CHECK-NEXT: };
// CHECK-EMPTY:
// CHECK-NEXT: constexpr auto TDLCV_vala = llvm::tdl::AKind::TDLCV_vala;
// CHECK-NEXT: constexpr auto TDLCV_valb = llvm::tdl::AKind::TDLCV_valb;
// CHECK-NEXT: constexpr auto TDLCV_valc = llvm::tdl::AKind::TDLCV_valc;
// CHECK-NEXT: constexpr auto TDLCV_vala = AKind::TDLCV_vala;
// CHECK-NEXT: constexpr auto TDLCV_valb = AKind::TDLCV_valb;
// CHECK-NEXT: constexpr auto TDLCV_valc = AKind::TDLCV_valc;
// CHECK-EMPTY:
// CHECK-NEXT: // Enumeration helper functions
// CHECK-NEXT: LLVM_ABI Directive getTdlDirectiveKind(llvm::StringRef Str);
// CHECK-NEXT: LLVM_ABI Directive getTdlDirectiveKind(StringRef Str);
// CHECK-EMPTY:
// CHECK-NEXT: LLVM_ABI llvm::StringRef getTdlDirectiveName(Directive D);
// CHECK-NEXT: LLVM_ABI StringRef getTdlDirectiveName(Directive D);
// CHECK-EMPTY:
// CHECK-NEXT: LLVM_ABI Clause getTdlClauseKind(llvm::StringRef Str);
// CHECK-NEXT: LLVM_ABI Clause getTdlClauseKind(StringRef Str);
// CHECK-EMPTY:
// CHECK-NEXT: LLVM_ABI llvm::StringRef getTdlClauseName(Clause C);
// CHECK-NEXT: LLVM_ABI StringRef getTdlClauseName(Clause C);
// CHECK-EMPTY:
// CHECK-NEXT: /// Return true if \p C is a valid clause for \p D in version \p Version.
// CHECK-NEXT: LLVM_ABI bool isAllowedClauseForDirective(Directive D, Clause C, unsigned Version);
Expand All @@ -138,8 +138,8 @@ def TDL_DirA : Directive<"dira"> {
// CHECK-NEXT: LLVM_ABI Association getDirectiveAssociation(Directive D);
// CHECK-NEXT: LLVM_ABI Category getDirectiveCategory(Directive D);
// CHECK-NEXT: LLVM_ABI SourceLanguage getDirectiveLanguages(Directive D);
// CHECK-NEXT: LLVM_ABI AKind getAKind(StringRef);
// CHECK-NEXT: LLVM_ABI llvm::StringRef getTdlAKindName(AKind);
// CHECK-NEXT: LLVM_ABI AKind getAKind(StringRef Str);
// CHECK-NEXT: LLVM_ABI StringRef getTdlAKindName(AKind x);
// CHECK-EMPTY:
// CHECK-NEXT: } // namespace tdl
// CHECK-NEXT: } // namespace llvm
Expand All @@ -155,8 +155,8 @@ def TDL_DirA : Directive<"dira"> {
// 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: Clause::TDLC_clausea,
// IMPL-NEXT: Clause::TDLC_clauseb,
// IMPL-NEXT: };
// IMPL-EMPTY:
// IMPL-NEXT: static allowedOnceClauses_TDLD_dira {
Expand Down Expand Up @@ -311,29 +311,29 @@ def TDL_DirA : Directive<"dira"> {
// IMPL-EMPTY:
// IMPL-NEXT: #include "llvm/Support/ErrorHandling.h"
// IMPL-EMPTY:
// IMPL-NEXT: Directive llvm::tdl::getTdlDirectiveKind(llvm::StringRef Str) {
// IMPL-NEXT: return llvm::StringSwitch<Directive>(Str)
// IMPL-NEXT: llvm::tdl::Directive llvm::tdl::getTdlDirectiveKind(llvm::StringRef Str) {
// IMPL-NEXT: return 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: llvm::StringRef llvm::tdl::getTdlDirectiveName(llvm::tdl::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: llvm::tdl::Clause llvm::tdl::getTdlClauseKind(llvm::StringRef Str) {
// IMPL-NEXT: return StringSwitch<Clause>(Str)
// IMPL-NEXT: .Case("clausea",TDLC_clausea)
// IMPL-NEXT: .Case("clauseb",TDLC_clauseb)
// IMPL-NEXT: .Case("clausec",TDLC_clausec)
// IMPL-NEXT: .Default(TDLC_clauseb);
// IMPL-NEXT: }
// IMPL-EMPTY:
// IMPL-NEXT: llvm::StringRef llvm::tdl::getTdlClauseName(Clause Kind) {
// IMPL-NEXT: llvm::StringRef llvm::tdl::getTdlClauseName(llvm::tdl::Clause Kind) {
// IMPL-NEXT: switch (Kind) {
// IMPL-NEXT: case TDLC_clausea:
// IMPL-NEXT: return "clausea";
Expand All @@ -345,8 +345,8 @@ def TDL_DirA : Directive<"dira"> {
// IMPL-NEXT: llvm_unreachable("Invalid Tdl Clause kind");
// IMPL-NEXT: }
// IMPL-EMPTY:
// IMPL-NEXT: AKind llvm::tdl::getAKind(llvm::StringRef Str) {
// IMPL-NEXT: return llvm::StringSwitch<AKind>(Str)
// IMPL-NEXT: llvm::tdl::AKind llvm::tdl::getAKind(llvm::StringRef Str) {
// IMPL-NEXT: return StringSwitch<AKind>(Str)
// IMPL-NEXT: .Case("vala",TDLCV_vala)
// IMPL-NEXT: .Case("valb",TDLCV_valb)
// IMPL-NEXT: .Case("valc",TDLCV_valc)
Expand All @@ -365,9 +365,9 @@ def TDL_DirA : Directive<"dira"> {
// IMPL-NEXT: llvm_unreachable("Invalid Tdl AKind kind");
// 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);
// IMPL-NEXT: bool llvm::tdl::isAllowedClauseForDirective(llvm::tdl::Directive D, llvm::tdl::Clause C, unsigned Version) {
// IMPL-NEXT: assert(unsigned(D) <= Directive_enumSize);
// IMPL-NEXT: assert(unsigned(C) <= Clause_enumSize);
// IMPL-NEXT: switch (D) {
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: switch (C) {
Expand All @@ -385,24 +385,24 @@ def TDL_DirA : Directive<"dira"> {
// IMPL-EMPTY:
// IMPL-NEXT: llvm::tdl::Association llvm::tdl::getDirectiveAssociation(llvm::tdl::Directive Dir) {
// IMPL-NEXT: switch (Dir) {
// IMPL-NEXT: case llvm::tdl::Directive::TDLD_dira:
// IMPL-NEXT: return llvm::tdl::Association::None;
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: return Association::None;
// IMPL-NEXT: } // switch (Dir)
// IMPL-NEXT: llvm_unreachable("Unexpected directive");
// IMPL-NEXT: }
// IMPL-EMPTY:
// IMPL-NEXT: llvm::tdl::Category llvm::tdl::getDirectiveCategory(llvm::tdl::Directive Dir) {
// IMPL-NEXT: switch (Dir) {
// IMPL-NEXT: case llvm::tdl::TDLD_dira:
// IMPL-NEXT: return llvm::tdl::Category::Executable;
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: return Category::Executable;
// IMPL-NEXT: } // switch (Dir)
// IMPL-NEXT: llvm_unreachable("Unexpected directive");
// IMPL-NEXT: }
// IMPL-EMPTY:
// IMPL-NEXT: llvm::tdl::SourceLanguage llvm::tdl::getDirectiveLanguages(llvm::tdl::Directive D) {
// IMPL-NEXT: switch (D) {
// IMPL-NEXT: case llvm::tdl::TDLD_dira:
// IMPL-NEXT: return llvm::tdl::SourceLanguage::C | llvm::tdl::SourceLanguage::Fortran;
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: return SourceLanguage::C | SourceLanguage::Fortran;
// IMPL-NEXT: } // switch(D)
// IMPL-NEXT: llvm_unreachable("Unexpected directive");
// IMPL-NEXT: }
Expand Down
42 changes: 21 additions & 21 deletions llvm/test/TableGen/directive2.td
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ def TDL_DirA : Directive<"dira"> {
// CHECK-NEXT: static constexpr std::size_t Clause_enumSize = 4;
// CHECK-EMPTY:
// CHECK-NEXT: // Enumeration helper functions
// CHECK-NEXT: LLVM_ABI Directive getTdlDirectiveKind(llvm::StringRef Str);
// CHECK-NEXT: LLVM_ABI Directive getTdlDirectiveKind(StringRef Str);
// CHECK-EMPTY:
// CHECK-NEXT: LLVM_ABI llvm::StringRef getTdlDirectiveName(Directive D);
// CHECK-NEXT: LLVM_ABI StringRef getTdlDirectiveName(Directive D);
// CHECK-EMPTY:
// CHECK-NEXT: LLVM_ABI Clause getTdlClauseKind(llvm::StringRef Str);
// CHECK-NEXT: LLVM_ABI Clause getTdlClauseKind(StringRef Str);
// CHECK-EMPTY:
// CHECK-NEXT: LLVM_ABI llvm::StringRef getTdlClauseName(Clause C);
// CHECK-NEXT: LLVM_ABI StringRef getTdlClauseName(Clause C);
// CHECK-EMPTY:
// CHECK-NEXT: /// Return true if \p C is a valid clause for \p D in version \p Version.
// CHECK-NEXT: LLVM_ABI bool isAllowedClauseForDirective(Directive D, Clause C, unsigned Version);
Expand All @@ -127,8 +127,8 @@ def TDL_DirA : Directive<"dira"> {
// 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: Clause::TDLC_clausea,
// IMPL-NEXT: Clause::TDLC_clauseb,
// IMPL-NEXT: };
// IMPL-EMPTY:
// IMPL-NEXT: static allowedOnceClauses_TDLD_dira {
Expand Down Expand Up @@ -259,30 +259,30 @@ def TDL_DirA : Directive<"dira"> {
// IMPL-EMPTY:
// IMPL-NEXT: #include "llvm/Support/ErrorHandling.h"
// IMPL-EMPTY:
// IMPL-NEXT: Directive llvm::tdl::getTdlDirectiveKind(llvm::StringRef Str) {
// IMPL-NEXT: return llvm::StringSwitch<Directive>(Str)
// IMPL-NEXT: llvm::tdl::Directive llvm::tdl::getTdlDirectiveKind(llvm::StringRef Str) {
// IMPL-NEXT: return 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: llvm::StringRef llvm::tdl::getTdlDirectiveName(llvm::tdl::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: llvm::tdl::Clause llvm::tdl::getTdlClauseKind(llvm::StringRef Str) {
// IMPL-NEXT: return StringSwitch<Clause>(Str)
// IMPL-NEXT: .Case("clausea",TDLC_clauseb)
// IMPL-NEXT: .Case("clauseb",TDLC_clauseb)
// IMPL-NEXT: .Case("clausec",TDLC_clausec)
// IMPL-NEXT: .Case("claused",TDLC_clauseb)
// IMPL-NEXT: .Default(TDLC_clauseb);
// IMPL-NEXT: }
// IMPL-EMPTY:
// IMPL-NEXT: llvm::StringRef llvm::tdl::getTdlClauseName(Clause Kind) {
// IMPL-NEXT: llvm::StringRef llvm::tdl::getTdlClauseName(llvm::tdl::Clause Kind) {
// IMPL-NEXT: switch (Kind) {
// IMPL-NEXT: case TDLC_clausea:
// IMPL-NEXT: return "clausea";
Expand All @@ -296,9 +296,9 @@ def TDL_DirA : Directive<"dira"> {
// IMPL-NEXT: llvm_unreachable("Invalid Tdl Clause kind");
// 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);
// IMPL-NEXT: bool llvm::tdl::isAllowedClauseForDirective(llvm::tdl::Directive D, llvm::tdl::Clause C, unsigned Version) {
// IMPL-NEXT: assert(unsigned(D) <= Directive_enumSize);
// IMPL-NEXT: assert(unsigned(C) <= Clause_enumSize);
// IMPL-NEXT: switch (D) {
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: switch (C) {
Expand All @@ -316,24 +316,24 @@ def TDL_DirA : Directive<"dira"> {
// IMPL-EMPTY:
// IMPL-NEXT: llvm::tdl::Association llvm::tdl::getDirectiveAssociation(llvm::tdl::Directive Dir) {
// IMPL-NEXT: switch (Dir) {
// IMPL-NEXT: case llvm::tdl::Directive::TDLD_dira:
// IMPL-NEXT: return llvm::tdl::Association::Block;
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: return Association::Block;
// IMPL-NEXT: } // switch (Dir)
// IMPL-NEXT: llvm_unreachable("Unexpected directive");
// IMPL-NEXT: }
// IMPL-EMPTY:
// IMPL-NEXT: llvm::tdl::Category llvm::tdl::getDirectiveCategory(llvm::tdl::Directive Dir) {
// IMPL-NEXT: switch (Dir) {
// IMPL-NEXT: case llvm::tdl::TDLD_dira:
// IMPL-NEXT: return llvm::tdl::Category::Declarative;
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: return Category::Declarative;
// IMPL-NEXT: } // switch (Dir)
// IMPL-NEXT: llvm_unreachable("Unexpected directive");
// IMPL-NEXT: }
// IMPL-EMPTY:
// IMPL-NEXT: llvm::tdl::SourceLanguage llvm::tdl::getDirectiveLanguages(llvm::tdl::Directive D) {
// IMPL-NEXT: switch (D) {
// IMPL-NEXT: case llvm::tdl::TDLD_dira:
// IMPL-NEXT: return llvm::tdl::SourceLanguage::C | llvm::tdl::SourceLanguage::Fortran;
// IMPL-NEXT: case TDLD_dira:
// IMPL-NEXT: return SourceLanguage::C | SourceLanguage::Fortran;
// IMPL-NEXT: } // switch(D)
// IMPL-NEXT: llvm_unreachable("Unexpected directive");
// IMPL-NEXT: }
Expand Down
Loading