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

#include "mlir/include/mlir/Transforms/Passes.h"  // from @llvm-project
#include "mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h"  // from @llvm-project

namespace mlir {
namespace heir {

#define GEN_PASS_DEF_{{ pass_name | upper }}
#include "lib/Transforms/{{ pass_name }}/{{ pass_name }}.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 heir
}  // namespace mlir
