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

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

//===----------------------------------------------------------------------===//
// LegalizeDataValuesInRegion
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_LEGALIZEDATAVALUESINREGION
struct LegalizeDataValuesInRegionOptions {
  bool hostToDevice = true;
  bool applyToAccDataConstruct = true;
};
std::unique_ptr<::mlir::Pass> createLegalizeDataValuesInRegion();
std::unique_ptr<::mlir::Pass> createLegalizeDataValuesInRegion(LegalizeDataValuesInRegionOptions options);
#undef GEN_PASS_DECL_LEGALIZEDATAVALUESINREGION
#endif // GEN_PASS_DECL_LEGALIZEDATAVALUESINREGION
#ifdef GEN_PASS_DEF_LEGALIZEDATAVALUESINREGION

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

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

template <typename DerivedT>
class LegalizeDataValuesInRegionBase : public ::mlir::OperationPass<mlir::func::FuncOp> {
public:
  using Base = LegalizeDataValuesInRegionBase;

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

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

  ::llvm::StringRef getDescription() const override { return "Legalizes SSA values in compute regions with results from data clause operations"; }

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

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

  LegalizeDataValuesInRegionBase(LegalizeDataValuesInRegionOptions options) : LegalizeDataValuesInRegionBase() {
    hostToDevice = std::move(options.hostToDevice);
    applyToAccDataConstruct = std::move(options.applyToAccDataConstruct);
  }
protected:
  ::mlir::Pass::Option<bool> hostToDevice{*this, "host-to-device", ::llvm::cl::desc("Replace varPtr uses with accPtr if true. Replace accPtr uses with varPtr if false"), ::llvm::cl::init(true)};
  ::mlir::Pass::Option<bool> applyToAccDataConstruct{*this, "apply-to-acc-data-construct", ::llvm::cl::desc("Replaces varPtr uses with accPtr for acc compute regions contained within acc.data or acc.declare region."), ::llvm::cl::init(true)};
private:

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

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

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

std::unique_ptr<::mlir::Pass> createLegalizeDataValuesInRegion(LegalizeDataValuesInRegionOptions options) {
  return impl::createLegalizeDataValuesInRegion(std::move(options));
}
#undef GEN_PASS_DEF_LEGALIZEDATAVALUESINREGION
#endif // GEN_PASS_DEF_LEGALIZEDATAVALUESINREGION
#ifdef GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// LegalizeDataValuesInRegion Registration
//===----------------------------------------------------------------------===//

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

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

//===----------------------------------------------------------------------===//
// OpenACC Registration
//===----------------------------------------------------------------------===//

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

template <typename DerivedT>
class LegalizeDataValuesInRegionBase : public ::mlir::OperationPass<mlir::func::FuncOp> {
public:
  using Base = LegalizeDataValuesInRegionBase;

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

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

  ::llvm::StringRef getDescription() const override { return "Legalizes SSA values in compute regions with results from data clause operations"; }

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

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

protected:
  ::mlir::Pass::Option<bool> hostToDevice{*this, "host-to-device", ::llvm::cl::desc("Replace varPtr uses with accPtr if true. Replace accPtr uses with varPtr if false"), ::llvm::cl::init(true)};
  ::mlir::Pass::Option<bool> applyToAccDataConstruct{*this, "apply-to-acc-data-construct", ::llvm::cl::desc("Replaces varPtr uses with accPtr for acc compute regions contained within acc.data or acc.declare region."), ::llvm::cl::init(true)};
};
#undef GEN_PASS_CLASSES
#endif // GEN_PASS_CLASSES
