236
|
1 //===- PythonTestCAPI.cpp - C API for the PythonTest dialect --------------===//
|
|
2 //
|
|
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
|
|
6 //
|
|
7 //===----------------------------------------------------------------------===//
|
|
8
|
|
9 #include "PythonTestCAPI.h"
|
|
10 #include "PythonTestDialect.h"
|
|
11 #include "mlir/CAPI/Registration.h"
|
|
12 #include "mlir/CAPI/Wrap.h"
|
|
13
|
|
14 MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(PythonTest, python_test,
|
|
15 python_test::PythonTestDialect)
|
|
16
|
|
17 bool mlirAttributeIsAPythonTestTestAttribute(MlirAttribute attr) {
|
|
18 return unwrap(attr).isa<python_test::TestAttrAttr>();
|
|
19 }
|
|
20
|
|
21 MlirAttribute mlirPythonTestTestAttributeGet(MlirContext context) {
|
|
22 return wrap(python_test::TestAttrAttr::get(unwrap(context)));
|
|
23 }
|
|
24
|
|
25 bool mlirTypeIsAPythonTestTestType(MlirType type) {
|
|
26 return unwrap(type).isa<python_test::TestTypeType>();
|
|
27 }
|
|
28
|
|
29 MlirType mlirPythonTestTestTypeGet(MlirContext context) {
|
|
30 return wrap(python_test::TestTypeType::get(unwrap(context)));
|
|
31 }
|