Being able to add custom dialects is one of the big missing pieces of the C API. This change should make it achievable via IRDL. Hopefully this should open custom dialect definition to non-C++ users of MLIR.
19 lines
717 B
C++
19 lines
717 B
C++
//===- IRDL.cpp - C Interface for IRDL dialect ----------------------------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "mlir-c/Dialect/IRDL.h"
|
|
#include "mlir/CAPI/Registration.h"
|
|
#include "mlir/Dialect/IRDL/IR/IRDL.h"
|
|
#include "mlir/Dialect/IRDL/IRDLLoading.h"
|
|
|
|
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(IRDL, irdl, mlir::irdl::IRDLDialect)
|
|
|
|
MlirLogicalResult mlirLoadIRDLDialects(MlirModule module) {
|
|
return wrap(mlir::irdl::loadDialects(unwrap(module)));
|
|
}
|