#include "lib/Dialect/{{ dialect_name }}/Transforms/{{ pass_name }}.h"

#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Ops.h"
#include "mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h"  // from @llvm-project

namespace mlir {
namespace heir {
namespace {{ dialect_namespace }} {

#define GEN_PASS_DEF_{{ pass_name | upper }}
#include "lib/Dialect/{{ dialect_name }}/Transforms/Passes.h.inc"

struct {{ pass_name }} : impl::{{ pass_name }}Base<{{ pass_name }}> {
  using {{ pass_name }}Base::{{ pass_name }}Base;

  void runOnOperation() override {
    MLIRContext *context = &getContext();
    RewritePatternSet patterns(context);

    // FIXME: implement pass
    patterns.add<>(context);

    // TODO (#1221): Investigate whether folding (default: on) can be skipped here.
    (void)applyPatternsGreedily(getOperation(), std::move(patterns));
  }
};

}  // namespace {{ dialect_namespace }}
}  // namespace heir
}  // namespace mlir
