[PATCH] D86904: [mlir] Support for defining Types in tblgen

John Demme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 16:41:25 PDT 2020


jdd updated this revision to Diff 294829.
jdd added a comment.

Syncing w/ master & removing auto-parsing stuff


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86904/new/

https://reviews.llvm.org/D86904

Files:
  mlir/test/lib/Dialect/Test/TestTypeDefs.td
  mlir/test/mlir-tblgen/testdialect-typedefs.mlir
  mlir/test/mlir-tblgen/typedefs.td


Index: mlir/test/mlir-tblgen/typedefs.td
===================================================================
--- mlir/test/mlir-tblgen/typedefs.td
+++ mlir/test/mlir-tblgen/typedefs.td
@@ -89,7 +89,7 @@
     let genVerifyInvariantsDecl = 1;
     let parameters = (
         ins
-        "SignednessSemantics":$signedness, 
+        "SignednessSemantics":$signedness,
         TypeParameter<"unsigned", "Bitwdith of integer">:$width
     );
 
Index: mlir/test/mlir-tblgen/testdialect-typedefs.mlir
===================================================================
--- mlir/test/mlir-tblgen/testdialect-typedefs.mlir
+++ mlir/test/mlir-tblgen/testdialect-typedefs.mlir
@@ -20,5 +20,5 @@
 
 // CHECK: @structTest(%arg0: !test.struct<{field1,!test.smpla},{field2,!test.int<unsigned, 3>}>)
 func @structTest (%A : !test.struct< {field1, !test.smpla}, {field2, !test.int<none, 3>} > ) {
-  return 
+  return
 }
Index: mlir/test/lib/Dialect/Test/TestTypeDefs.td
===================================================================
--- mlir/test/lib/Dialect/Test/TestTypeDefs.td
+++ mlir/test/lib/Dialect/Test/TestTypeDefs.td
@@ -18,7 +18,7 @@
     let mnemonic = "smpla";
 
     let printer = [{ $_printer << "smpla"; }];
-    let parser = [{ return get(ctxt); }];
+    let parser = [{ return get($_ctxt); }];
 }
 
 // A more complex parameterized type
@@ -62,7 +62,7 @@
     int width;
     if ($_parser.parseInteger(width)) return Type();
     if ($_parser.parseGreater()) return Type();
-    return get(ctxt, signedness, width);   
+    return get(ctxt, signedness, width);
   }];
 
   let extraClassDeclaration = [{


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86904.294829.patch
Type: text/x-patch
Size: 1614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200928/7de93966/attachment.bin>


More information about the llvm-commits mailing list