llvm/tools/mlir/unittests/TableGen/PassGenTest.h.inc

/* Autogenerated by mlir-tblgen; don't manually edit */

#ifdef GEN_PASS_DECL
// Generate declarations for all passes.
#define GEN_PASS_DECL_TESTPASS
#define GEN_PASS_DECL_TESTPASSWITHCUSTOMCONSTRUCTOR
#define GEN_PASS_DECL_TESTPASSWITHOPTIONS
#undef GEN_PASS_DECL
#endif // GEN_PASS_DECL

//===----------------------------------------------------------------------===//
// TestPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_TESTPASS
std::unique_ptr<::mlir::Pass> createTestPass();
#undef GEN_PASS_DECL_TESTPASS
#endif // GEN_PASS_DECL_TESTPASS
#ifdef GEN_PASS_DEF_TESTPASS

namespace impl {
  std::unique_ptr<::mlir::Pass> createTestPass();
} // namespace impl
namespace impl {

template <typename DerivedT>
class TestPassBase : public ::mlir::OperationPass<> {
public:
  using Base = TestPassBase;

  TestPassBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
  TestPassBase(const TestPassBase &other) : ::mlir::OperationPass<>(other) {}
  TestPassBase& operator=(const TestPassBase &) = delete;
  TestPassBase(TestPassBase &&) = delete;
  TestPassBase& operator=(TestPassBase &&) = delete;
  ~TestPassBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("test");
  }
  ::llvm::StringRef getArgument() const override { return "test"; }

  ::llvm::StringRef getDescription() const override { return "Test pass"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("TestPass");
  }
  ::llvm::StringRef getName() const override { return "TestPass"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassBase<DerivedT>)

protected:
private:

  friend std::unique_ptr<::mlir::Pass> createTestPass() {
    return std::make_unique<DerivedT>();
  }
};
} // namespace impl

std::unique_ptr<::mlir::Pass> createTestPass() {
  return impl::createTestPass();
}
#undef GEN_PASS_DEF_TESTPASS
#endif // GEN_PASS_DEF_TESTPASS

//===----------------------------------------------------------------------===//
// TestPassWithCustomConstructor
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_TESTPASSWITHCUSTOMCONSTRUCTOR
#undef GEN_PASS_DECL_TESTPASSWITHCUSTOMCONSTRUCTOR
#endif // GEN_PASS_DECL_TESTPASSWITHCUSTOMCONSTRUCTOR
#ifdef GEN_PASS_DEF_TESTPASSWITHCUSTOMCONSTRUCTOR
namespace impl {

template <typename DerivedT>
class TestPassWithCustomConstructorBase : public ::mlir::OperationPass<> {
public:
  using Base = TestPassWithCustomConstructorBase;

  TestPassWithCustomConstructorBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
  TestPassWithCustomConstructorBase(const TestPassWithCustomConstructorBase &other) : ::mlir::OperationPass<>(other) {}
  TestPassWithCustomConstructorBase& operator=(const TestPassWithCustomConstructorBase &) = delete;
  TestPassWithCustomConstructorBase(TestPassWithCustomConstructorBase &&) = delete;
  TestPassWithCustomConstructorBase& operator=(TestPassWithCustomConstructorBase &&) = delete;
  ~TestPassWithCustomConstructorBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("test");
  }
  ::llvm::StringRef getArgument() const override { return "test"; }

  ::llvm::StringRef getDescription() const override { return "Test pass with custom constructor"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("TestPassWithCustomConstructor");
  }
  ::llvm::StringRef getName() const override { return "TestPassWithCustomConstructor"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassWithCustomConstructorBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_TESTPASSWITHCUSTOMCONSTRUCTOR
#endif // GEN_PASS_DEF_TESTPASSWITHCUSTOMCONSTRUCTOR

//===----------------------------------------------------------------------===//
// TestPassWithOptions
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_TESTPASSWITHOPTIONS
struct TestPassWithOptionsOptions {};
std::unique_ptr<::mlir::Pass> createTestPassWithOptions();
std::unique_ptr<::mlir::Pass> createTestPassWithOptions(TestPassWithOptionsOptions options);
#undef GEN_PASS_DECL_TESTPASSWITHOPTIONS
#endif // GEN_PASS_DECL_TESTPASSWITHOPTIONS
#ifdef GEN_PASS_DEF_TESTPASSWITHOPTIONS

namespace impl {
  std::unique_ptr<::mlir::Pass> createTestPassWithOptions();
} // namespace impl

namespace impl {
  std::unique_ptr<::mlir::Pass> createTestPassWithOptions(TestPassWithOptionsOptions options);
} // namespace impl
namespace impl {

template <typename DerivedT>
class TestPassWithOptionsBase : public ::mlir::OperationPass<> {
public:
  using Base = TestPassWithOptionsBase;

  TestPassWithOptionsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
  TestPassWithOptionsBase(const TestPassWithOptionsBase &other) : ::mlir::OperationPass<>(other) {}
  TestPassWithOptionsBase& operator=(const TestPassWithOptionsBase &) = delete;
  TestPassWithOptionsBase(TestPassWithOptionsBase &&) = delete;
  TestPassWithOptionsBase& operator=(TestPassWithOptionsBase &&) = delete;
  ~TestPassWithOptionsBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("test");
  }
  ::llvm::StringRef getArgument() const override { return "test"; }

  ::llvm::StringRef getDescription() const override { return "Test pass with options"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("TestPassWithOptions");
  }
  ::llvm::StringRef getName() const override { return "TestPassWithOptions"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassWithOptionsBase<DerivedT>)

  TestPassWithOptionsBase(TestPassWithOptionsOptions options) : TestPassWithOptionsBase() {
    testOption = std::move(options.testOption);
    testListOption = std::move(options.testListOption);
  }
protected:
  ::mlir::Pass::Option<int> testOption{*this, "testOption", ::llvm::cl::desc("Test option"), ::llvm::cl::init(0)};
  ::mlir::Pass::ListOption<int64_t> testListOption{*this, "test-list-option", ::llvm::cl::desc("Test list option")};
private:

  friend std::unique_ptr<::mlir::Pass> createTestPassWithOptions() {
    return std::make_unique<DerivedT>();
  }

  friend std::unique_ptr<::mlir::Pass> createTestPassWithOptions(TestPassWithOptionsOptions options) {
    return std::make_unique<DerivedT>(std::move(options));
  }
};
} // namespace impl

std::unique_ptr<::mlir::Pass> createTestPassWithOptions() {
  return impl::createTestPassWithOptions();
}

std::unique_ptr<::mlir::Pass> createTestPassWithOptions(TestPassWithOptionsOptions options) {
  return impl::createTestPassWithOptions(std::move(options));
}
#undef GEN_PASS_DEF_TESTPASSWITHOPTIONS
#endif // GEN_PASS_DEF_TESTPASSWITHOPTIONS
#ifdef GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// TestPass Registration
//===----------------------------------------------------------------------===//

inline void registerTestPass() {}

// Old registration code, kept for temporary backwards compatibility.
inline void registerTestPassPass() {}

//===----------------------------------------------------------------------===//
// TestPassWithCustomConstructor Registration
//===----------------------------------------------------------------------===//

inline void registerTestPassWithCustomConstructor() {}

// Old registration code, kept for temporary backwards compatibility.
inline void registerTestPassWithCustomConstructorPass() {}

//===----------------------------------------------------------------------===//
// TestPassWithOptions Registration
//===----------------------------------------------------------------------===//

inline void registerTestPassWithOptions() {}

// Old registration code, kept for temporary backwards compatibility.
inline void registerTestPassWithOptionsPass() {}

//===----------------------------------------------------------------------===//
// TableGenTest Registration
//===----------------------------------------------------------------------===//

inline void registerTableGenTestPasses() {}
#undef GEN_PASS_REGISTRATION
#endif // GEN_PASS_REGISTRATION
// Deprecated. Please use the new per-pass macros.
#ifdef GEN_PASS_CLASSES

template <typename DerivedT>
class TestPassBase : public ::mlir::OperationPass<> {
public:
  using Base = TestPassBase;

  TestPassBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
  TestPassBase(const TestPassBase &other) : ::mlir::OperationPass<>(other) {}
  TestPassBase& operator=(const TestPassBase &) = delete;
  TestPassBase(TestPassBase &&) = delete;
  TestPassBase& operator=(TestPassBase &&) = delete;
  ~TestPassBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("test");
  }
  ::llvm::StringRef getArgument() const override { return "test"; }

  ::llvm::StringRef getDescription() const override { return "Test pass"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("TestPass");
  }
  ::llvm::StringRef getName() const override { return "TestPass"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Register the dialects that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassBase<DerivedT>)

protected:
};

template <typename DerivedT>
class TestPassWithCustomConstructorBase : public ::mlir::OperationPass<> {
public:
  using Base = TestPassWithCustomConstructorBase;

  TestPassWithCustomConstructorBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
  TestPassWithCustomConstructorBase(const TestPassWithCustomConstructorBase &other) : ::mlir::OperationPass<>(other) {}
  TestPassWithCustomConstructorBase& operator=(const TestPassWithCustomConstructorBase &) = delete;
  TestPassWithCustomConstructorBase(TestPassWithCustomConstructorBase &&) = delete;
  TestPassWithCustomConstructorBase& operator=(TestPassWithCustomConstructorBase &&) = delete;
  ~TestPassWithCustomConstructorBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("test");
  }
  ::llvm::StringRef getArgument() const override { return "test"; }

  ::llvm::StringRef getDescription() const override { return "Test pass with custom constructor"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("TestPassWithCustomConstructor");
  }
  ::llvm::StringRef getName() const override { return "TestPassWithCustomConstructor"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Register the dialects that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassWithCustomConstructorBase<DerivedT>)

protected:
};

template <typename DerivedT>
class TestPassWithOptionsBase : public ::mlir::OperationPass<> {
public:
  using Base = TestPassWithOptionsBase;

  TestPassWithOptionsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
  TestPassWithOptionsBase(const TestPassWithOptionsBase &other) : ::mlir::OperationPass<>(other) {}
  TestPassWithOptionsBase& operator=(const TestPassWithOptionsBase &) = delete;
  TestPassWithOptionsBase(TestPassWithOptionsBase &&) = delete;
  TestPassWithOptionsBase& operator=(TestPassWithOptionsBase &&) = delete;
  ~TestPassWithOptionsBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("test");
  }
  ::llvm::StringRef getArgument() const override { return "test"; }

  ::llvm::StringRef getDescription() const override { return "Test pass with options"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("TestPassWithOptions");
  }
  ::llvm::StringRef getName() const override { return "TestPassWithOptions"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Register the dialects that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassWithOptionsBase<DerivedT>)

protected:
  ::mlir::Pass::Option<int> testOption{*this, "testOption", ::llvm::cl::desc("Test option"), ::llvm::cl::init(0)};
  ::mlir::Pass::ListOption<int64_t> testListOption{*this, "test-list-option", ::llvm::cl::desc("Test list option")};
};
#undef GEN_PASS_CLASSES
#endif // GEN_PASS_CLASSES