#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Dialect.h"

#include "mlir/include/mlir/IR/DialectImplementation.h"  // from @llvm-project

// NOLINTNEXTLINE(misc-include-cleaner): Required to define {{ dialect_name }}Ops
{% if enable_attributes %}
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Attributes.h"
{% endif %}
{% if enable_ops %}
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Ops.h"
{% endif %}
{% if enable_types %}
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Types.h"
{% endif %}

// Generated definitions
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Dialect.cpp.inc"
{% if enable_attributes %}
#define GET_ATTRDEF_CLASSES
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Attributes.cpp.inc"
{% endif %}
{% if enable_types %}
#define GET_TYPEDEF_CLASSES
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Types.cpp.inc"
{% endif %}
{% if enable_ops %}
#define GET_OP_CLASSES
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Ops.cpp.inc"
{% endif %}

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

void {{ dialect_name }}Dialect::initialize() {
  {% if enable_attributes %}
  addAttributes<
#define GET_ATTRDEF_LIST
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Attributes.cpp.inc"
      >();
  {% endif %}
  {% if enable_types %}
  addTypes<
#define GET_TYPEDEF_LIST
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Types.cpp.inc"
      >();
  {% endif %}
  {% if enable_ops %}
  addOperations<
#define GET_OP_LIST
#include "lib/Dialect/{{ dialect_name }}/IR/{{ dialect_name }}Ops.cpp.inc"
      >();
  {% endif %}
}

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