1 //===- StandardDialect.cpp - C Interface for Standard 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 "mlir-c/StandardDialect.h" 10 #include "mlir-c/IR.h" 11 #include "mlir/CAPI/IR.h" 12 #include "mlir/CAPI/Support.h" 13 #include "mlir/Dialect/StandardOps/IR/Ops.h" 14 mlirContextRegisterStandardDialect(MlirContext context)15void mlirContextRegisterStandardDialect(MlirContext context) { 16 unwrap(context)->getDialectRegistry().insert<mlir::StandardOpsDialect>(); 17 } 18 mlirContextLoadStandardDialect(MlirContext context)19MlirDialect mlirContextLoadStandardDialect(MlirContext context) { 20 return wrap(unwrap(context)->getOrLoadDialect<mlir::StandardOpsDialect>()); 21 } 22 mlirStandardDialectGetNamespace()23MlirStringRef mlirStandardDialectGetNamespace() { 24 return wrap(mlir::StandardOpsDialect::getDialectNamespace()); 25 } 26