Sketch out parser/IR support for OperationInst, and a new Instruction base
class.
Introduce an Identifier class to MLIRContext to represent uniqued identifiers,
introduce string literal support to the lexer, introducing parser and printer
support etc.
PiperOrigin-RevId: 202592007
diff --git a/test/IR/parser-errors.mlir b/test/IR/parser-errors.mlir
index e60bf78..408fe13 100644
--- a/test/IR/parser-errors.mlir
+++ b/test/IR/parser-errors.mlir
@@ -44,7 +44,7 @@
bb40:
return
bb41:
-bb42: ; expected-error {{expected terminator}}
+bb42: ; expected-error {{expected operation name}}
return
}
@@ -57,3 +57,21 @@
mlfunc @no_return() {
} ; expected-error {{ML function must end with return statement}}
+
+; -----
+
+" ; expected-error {{expected}}
+"
+
+; -----
+
+" ; expected-error {{expected}}
+
+; -----
+
+cfgfunc @no_terminator() {
+bb40:
+ "foo"()
+ ""() ; expected-error {{empty operation name is invalid}}
+ return
+}
diff --git a/test/IR/parser.mlir b/test/IR/parser.mlir
index b7c28f7..d69192d 100644
--- a/test/IR/parser.mlir
+++ b/test/IR/parser.mlir
@@ -34,6 +34,8 @@
; CHECK-LABEL: cfgfunc @simpleCFG() {
cfgfunc @simpleCFG() {
bb42: ; CHECK: bb0:
+ "foo"() ; CHECK: "foo"()
+ "bar"() ; CHECK: "bar"()
return ; CHECK: return
} ; CHECK: }