llvm/mlir/include/mlir/IR/Dialect.h

//===- Dialect.h - IR Dialect Description -----------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines the 'dialect' abstraction.
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_IR_DIALECT_H
#define MLIR_IR_DIALECT_H

#include "mlir/IR/DialectRegistry.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/Support/TypeID.h"

namespace mlir {
class DialectAsmParser;
class DialectAsmPrinter;
class DialectInterface;
class OpBuilder;
class Type;

//===----------------------------------------------------------------------===//
// Dialect
//===----------------------------------------------------------------------===//

/// Dialects are groups of MLIR operations, types and attributes, as well as
/// behavior associated with the entire group.  For example, hooks into other
/// systems for constant folding, interfaces, default named types for asm
/// printing, etc.
///
/// Instances of the dialect object are loaded in a specific MLIRContext.
///
class Dialect {};

} // namespace mlir

namespace llvm {
/// Provide isa functionality for Dialects.
isa_impl<T, ::mlir::Dialect, std::enable_if_t<std::is_base_of< ::mlir::Dialect, T>::value>>;
isa_impl<T, ::mlir::Dialect, std::enable_if_t<std::is_base_of< ::mlir::DialectInterface, T>::value>>;
cast_retty_impl<T, ::mlir::Dialect *>;
cast_retty_impl<T, ::mlir::Dialect>;

cast_convert_val<T, ::mlir::Dialect, ::mlir::Dialect>;
cast_convert_val<T, ::mlir::Dialect *, ::mlir::Dialect *>;

} // namespace llvm

#endif