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

#ifdef GEN_PASS_DECL
// Generate declarations for all passes.
#define GEN_PASS_DECL_FORMEXPRESSIONSPASS
#define GEN_PASS_DECL_WRAPFUNCINCLASSPASS
#undef GEN_PASS_DECL
#endif // GEN_PASS_DECL

//===----------------------------------------------------------------------===//
// FormExpressionsPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_FORMEXPRESSIONSPASS
std::unique_ptr<::mlir::Pass> createFormExpressionsPass();
#undef GEN_PASS_DECL_FORMEXPRESSIONSPASS
#endif // GEN_PASS_DECL_FORMEXPRESSIONSPASS
#ifdef GEN_PASS_DEF_FORMEXPRESSIONSPASS

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

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

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

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

  ::llvm::StringRef getDescription() const override { return R"PD(Form C-style expressions from C-operator ops)PD"; }

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

  /// 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 {
    registry.insert<emitc::EmitCDialect>();
  }

  /// 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(FormExpressionsPassBase<DerivedT>)

protected:
private:

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

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

//===----------------------------------------------------------------------===//
// WrapFuncInClassPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_WRAPFUNCINCLASSPASS
struct WrapFuncInClassPassOptions {
  std::string funcName = "operator()";
};
std::unique_ptr<::mlir::Pass> createWrapFuncInClassPass();
std::unique_ptr<::mlir::Pass> createWrapFuncInClassPass(WrapFuncInClassPassOptions options);
#undef GEN_PASS_DECL_WRAPFUNCINCLASSPASS
#endif // GEN_PASS_DECL_WRAPFUNCINCLASSPASS
#ifdef GEN_PASS_DEF_WRAPFUNCINCLASSPASS

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

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

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

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

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

  ::llvm::StringRef getDescription() const override { return R"PD(Wrap functions in classes, using arguments as fields.)PD"; }

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

  /// 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 {
    registry.insert<emitc::EmitCDialect>();
  }

  /// 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(WrapFuncInClassPassBase<DerivedT>)

  WrapFuncInClassPassBase(WrapFuncInClassPassOptions options) : WrapFuncInClassPassBase() {
    funcName = std::move(options.funcName);
  }
protected:
  ::mlir::Pass::Option<std::string> funcName{*this, "func-name", ::llvm::cl::desc(R"PO(The name of the newly generated member function with body matching the input function.)PO"), ::llvm::cl::init("operator()")};
private:

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

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

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

std::unique_ptr<::mlir::Pass> createWrapFuncInClassPass(WrapFuncInClassPassOptions options) {
  return impl::createWrapFuncInClassPass(std::move(options));
}
#undef GEN_PASS_DEF_WRAPFUNCINCLASSPASS
#endif // GEN_PASS_DEF_WRAPFUNCINCLASSPASS
#ifdef GEN_PASS_REGISTRATION
// Generate registrations for all passes.
#define GEN_PASS_REGISTRATION_FORMEXPRESSIONSPASS
#define GEN_PASS_REGISTRATION_WRAPFUNCINCLASSPASS
#endif // GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// FormExpressionsPass Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_FORMEXPRESSIONSPASS

inline void registerFormExpressionsPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return createFormExpressionsPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerFormExpressionsPassPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return createFormExpressionsPass();
  });
}

#undef GEN_PASS_REGISTRATION_FORMEXPRESSIONSPASS
#endif // GEN_PASS_REGISTRATION_FORMEXPRESSIONSPASS

//===----------------------------------------------------------------------===//
// WrapFuncInClassPass Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_WRAPFUNCINCLASSPASS

inline void registerWrapFuncInClassPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return createWrapFuncInClassPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerWrapFuncInClassPassPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return createWrapFuncInClassPass();
  });
}

#undef GEN_PASS_REGISTRATION_WRAPFUNCINCLASSPASS
#endif // GEN_PASS_REGISTRATION_WRAPFUNCINCLASSPASS
#ifdef GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// EmitC Registration
//===----------------------------------------------------------------------===//

inline void registerEmitCPasses() {
  registerFormExpressionsPass();
  registerWrapFuncInClassPass();
}
#undef GEN_PASS_REGISTRATION
#endif // GEN_PASS_REGISTRATION
#ifdef GEN_PASS_CLASSES
#error "GEN_PASS_CLASSES is deprecated; use per-pass macros"
#undef GEN_PASS_CLASSES
#endif // GEN_PASS_CLASSES
