From 201f5245c18b151e58d0e944a701dbcdd927be03 Mon Sep 17 00:00:00 2001 From: Tarry Singh Date: Thu, 11 Jul 2024 11:14:22 +0000 Subject: [PATCH] mlir: add MLIR `index` type --- mlir/mlir.zig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mlir/mlir.zig b/mlir/mlir.zig index 0916ad7..35d60a7 100644 --- a/mlir/mlir.zig +++ b/mlir/mlir.zig @@ -1239,6 +1239,21 @@ pub const Type = struct { } }; +pub const IndexType = struct { + _inner: c.MlirType, + + pub usingnamespace MlirHelpers(IndexType, .{ + .is_null_fn = c.mlirTypeIsNull, + .dump_fn = c.mlirTypeDump, + .equal_fn = c.mlirTypeEqual, + .print_fn = c.mlirTypePrint, + }); + + pub fn init(ctx: Context) IndexType { + return IndexType.wrap(c.mlirIndexTypeGet(ctx.inner())); + } +}; + pub const IntegerTypes = enum { i1, i4,