Théo Degioanni 1337622a49
[MLIR] Add IRDL dialect loading to C API (#91852)
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.
2024-05-11 19:45:34 +02:00

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)));
}