#include "mlir/IR/Dialect.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/DialectInterface.h"
#include "mlir/IR/DialectRegistry.h"
#include "mlir/IR/ExtensibleDialect.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/IR/Operation.h"
#include "mlir/Support/TypeID.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SmallVectorExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Regex.h"
#include <memory>
#define DEBUG_TYPE …
usingnamespacemlir;
usingnamespacedetail;
Dialect::Dialect(StringRef name, MLIRContext *context, TypeID id)
: … { … }
Dialect::~Dialect() = default;
LogicalResult Dialect::verifyRegionArgAttribute(Operation *, unsigned, unsigned,
NamedAttribute) { … }
LogicalResult Dialect::verifyRegionResultAttribute(Operation *, unsigned,
unsigned, NamedAttribute) { … }
Attribute Dialect::parseAttribute(DialectAsmParser &parser, Type type) const { … }
Type Dialect::parseType(DialectAsmParser &parser) const { … }
std::optional<Dialect::ParseOpHook>
Dialect::getParseOperationHook(StringRef opName) const { … }
llvm::unique_function<void(Operation *, OpAsmPrinter &printer)>
Dialect::getOperationPrinter(Operation *op) const { … }
bool Dialect::isValidNamespace(StringRef str) { … }
void Dialect::addInterface(std::unique_ptr<DialectInterface> interface) { … }
DialectInterface::~DialectInterface() = default;
MLIRContext *DialectInterface::getContext() const { … }
DialectInterfaceCollectionBase::DialectInterfaceCollectionBase(
MLIRContext *ctx, TypeID interfaceKind, StringRef interfaceName) { … }
DialectInterfaceCollectionBase::~DialectInterfaceCollectionBase() = default;
const DialectInterface *
DialectInterfaceCollectionBase::getInterfaceFor(Operation *op) const { … }
DialectExtensionBase::~DialectExtensionBase() = default;
void dialect_extension_detail::handleUseOfUndefinedPromisedInterface(
Dialect &dialect, TypeID interfaceRequestorID, TypeID interfaceID,
StringRef interfaceName) { … }
void dialect_extension_detail::handleAdditionOfUndefinedPromisedInterface(
Dialect &dialect, TypeID interfaceRequestorID, TypeID interfaceID) { … }
bool dialect_extension_detail::hasPromisedInterface(Dialect &dialect,
TypeID interfaceRequestorID,
TypeID interfaceID) { … }
namespace {
template <typename Fn>
void applyExtensionsFn(
Fn &&applyExtension,
const llvm::MapVector<TypeID, std::unique_ptr<DialectExtensionBase>>
&extensions) { … }
}
DialectRegistry::DialectRegistry() { … }
DialectAllocatorFunctionRef
DialectRegistry::getDialectAllocator(StringRef name) const { … }
void DialectRegistry::insert(TypeID typeID, StringRef name,
const DialectAllocatorFunction &ctor) { … }
void DialectRegistry::insertDynamic(
StringRef name, const DynamicDialectPopulationFunction &ctor) { … }
void DialectRegistry::applyExtensions(Dialect *dialect) const { … }
void DialectRegistry::applyExtensions(MLIRContext *ctx) const { … }
bool DialectRegistry::isSubsetOf(const DialectRegistry &rhs) const { … }