#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_TESTPASS
#define GEN_PASS_DECL_TESTPASSWITHCUSTOMCONSTRUCTOR
#define GEN_PASS_DECL_TESTPASSWITHOPTIONS
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_TESTPASS
std::unique_ptr<::mlir::Pass> createTestPass();
#undef GEN_PASS_DECL_TESTPASS
#endif
#ifdef GEN_PASS_DEF_TESTPASS
namespace impl {
std::unique_ptr<::mlir::Pass> createTestPass();
}
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;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("test");
}
::llvm::StringRef getArgument() const override { return "test"; }
::llvm::StringRef getDescription() const override { return "Test pass"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestPass");
}
::llvm::StringRef getName() const override { return "TestPass"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassBase<DerivedT>)
protected:
private:
friend std::unique_ptr<::mlir::Pass> createTestPass() {
return std::make_unique<DerivedT>();
}
};
}
std::unique_ptr<::mlir::Pass> createTestPass() {
return impl::createTestPass();
}
#undef GEN_PASS_DEF_TESTPASS
#endif
#ifdef GEN_PASS_DECL_TESTPASSWITHCUSTOMCONSTRUCTOR
#undef GEN_PASS_DECL_TESTPASSWITHCUSTOMCONSTRUCTOR
#endif
#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;
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"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestPassWithCustomConstructor");
}
::llvm::StringRef getName() const override { return "TestPassWithCustomConstructor"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestPassWithCustomConstructorBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_TESTPASSWITHCUSTOMCONSTRUCTOR
#endif
#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
#ifdef GEN_PASS_DEF_TESTPASSWITHOPTIONS
namespace impl {
std::unique_ptr<::mlir::Pass> createTestPassWithOptions();
}
namespace impl {
std::unique_ptr<::mlir::Pass> createTestPassWithOptions(TestPassWithOptionsOptions options);
}
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;
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"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestPassWithOptions");
}
::llvm::StringRef getName() const override { return "TestPassWithOptions"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
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));
}
};
}
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
#ifdef GEN_PASS_REGISTRATION
inline void registerTestPass() { … }
inline void registerTestPassPass() { … }
inline void registerTestPassWithCustomConstructor() { … }
inline void registerTestPassWithCustomConstructorPass() { … }
inline void registerTestPassWithOptions() { … }
inline void registerTestPassWithOptionsPass() { … }
inline void registerTableGenTestPasses() { … }
#undef GEN_PASS_REGISTRATION
#endif
#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;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("test");
}
::llvm::StringRef getArgument() const override { return "test"; }
::llvm::StringRef getDescription() const override { return "Test pass"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestPass");
}
::llvm::StringRef getName() const override { return "TestPass"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
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;
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"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestPassWithCustomConstructor");
}
::llvm::StringRef getName() const override { return "TestPassWithCustomConstructor"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
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;
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"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("TestPassWithOptions");
}
::llvm::StringRef getName() const override { return "TestPassWithOptions"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
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