diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Standalone-c/Dialects.h | 24 | ||||
-rw-r--r-- | include/Standalone/StandaloneDialect.td | 2 | ||||
-rw-r--r-- | include/Standalone/StandaloneOps.h | 1 | ||||
-rw-r--r-- | include/Standalone/StandaloneOps.td | 5 |
4 files changed, 29 insertions, 3 deletions
diff --git a/include/Standalone-c/Dialects.h b/include/Standalone-c/Dialects.h new file mode 100644 index 0000000..b3e4775 --- /dev/null +++ b/include/Standalone-c/Dialects.h @@ -0,0 +1,24 @@ +//===- Dialects.h - CAPI for dialects -----------------------------*- C -*-===// +// +// This file is licensed 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 +// +//===----------------------------------------------------------------------===// + +#ifndef STANDALONE_C_DIALECTS_H +#define STANDALONE_C_DIALECTS_H + +#include "mlir-c/IR.h" + +#ifdef __cplusplus +extern "C" { +#endif + +MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Standalone, standalone); + +#ifdef __cplusplus +} +#endif + +#endif // STANDALONE_C_DIALECTS_H diff --git a/include/Standalone/StandaloneDialect.td b/include/Standalone/StandaloneDialect.td index a7fd789..1588601 100644 --- a/include/Standalone/StandaloneDialect.td +++ b/include/Standalone/StandaloneDialect.td @@ -30,7 +30,7 @@ def Standalone_Dialect : Dialect { // Base standalone operation definition. //===----------------------------------------------------------------------===// -class Standalone_Op<string mnemonic, list<OpTrait> traits = []> : +class Standalone_Op<string mnemonic, list<Trait> traits = []> : Op<Standalone_Dialect, mnemonic, traits>; #endif // STANDALONE_DIALECT diff --git a/include/Standalone/StandaloneOps.h b/include/Standalone/StandaloneOps.h index a56c286..a9006e0 100644 --- a/include/Standalone/StandaloneOps.h +++ b/include/Standalone/StandaloneOps.h @@ -12,6 +12,7 @@ #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/OpDefinition.h" +#include "mlir/Interfaces/InferTypeOpInterface.h" #include "mlir/Interfaces/SideEffectInterfaces.h" #define GET_OP_CLASSES diff --git a/include/Standalone/StandaloneOps.td b/include/Standalone/StandaloneOps.td index f6ba7a6..1098dc5 100644 --- a/include/Standalone/StandaloneOps.td +++ b/include/Standalone/StandaloneOps.td @@ -9,7 +9,8 @@ #ifndef STANDALONE_OPS #define STANDALONE_OPS -include "StandaloneDialect.td" +include "Standalone/StandaloneDialect.td" +include "mlir/Interfaces/InferTypeOpInterface.td" include "mlir/Interfaces/SideEffectInterfaces.td" def Standalone_FooOp : Standalone_Op<"foo", [NoSideEffect, @@ -25,7 +26,7 @@ def Standalone_FooOp : Standalone_Op<"foo", [NoSideEffect, Example: ```mlir - %0 = constant 2 : i32 + %0 = arith.constant 2 : i32 // Apply the foo operation to %0 %1 = standalone.foo %0 : i32 ``` |