1 //===- StandaloneExtension.cpp - Extension module -------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "Standalone-c/Dialects.h"
10 #include "mlir/Bindings/Python/PybindAdaptors.h"
12 using namespace mlir::python::adaptors
;
14 PYBIND11_MODULE(_standaloneDialects
, m
) {
15 //===--------------------------------------------------------------------===//
17 //===--------------------------------------------------------------------===//
18 auto standaloneM
= m
.def_submodule("standalone");
22 [](MlirContext context
, bool load
) {
23 MlirDialectHandle handle
= mlirGetDialectHandle__standalone__();
24 mlirDialectHandleRegisterDialect(handle
, context
);
26 mlirDialectHandleLoadDialect(handle
, context
);
29 py::arg("context") = py::none(), py::arg("load") = true);