From f1d478b71f2632a8a822bf6178d7ed07f8eea297 Mon Sep 17 00:00:00 2001 From: Mike Urbach Date: Fri, 15 Mar 2024 12:24:18 -0700 Subject: [PATCH] [FIRRTL] Update parser for OMDeleted targets. All targets require the colon after the target kind, even OMDeleted. --- lib/Dialect/FIRRTL/Transforms/ResolvePaths.cpp | 2 +- test/Dialect/FIRRTL/resolve-paths-errors.mlir | 2 +- test/Dialect/FIRRTL/resolve-paths.mlir | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Dialect/FIRRTL/Transforms/ResolvePaths.cpp b/lib/Dialect/FIRRTL/Transforms/ResolvePaths.cpp index 2566a6d139d7..fa690851e5fd 100644 --- a/lib/Dialect/FIRRTL/Transforms/ResolvePaths.cpp +++ b/lib/Dialect/FIRRTL/Transforms/ResolvePaths.cpp @@ -107,7 +107,7 @@ struct PathResolver { // OMDeleted nodes do not have a target, so it is impossible to resolve // them to a real path. We create a special constant for these path // values. - if (target.consume_front("OMDeleted")) { + if (target.consume_front("OMDeleted:")) { if (!target.empty()) return emitError(loc, "OMDeleted references can not have targets"); // Deleted targets are turned into OMReference targets with a dangling diff --git a/test/Dialect/FIRRTL/resolve-paths-errors.mlir b/test/Dialect/FIRRTL/resolve-paths-errors.mlir index 2b88483657a2..48a88f6f9747 100644 --- a/test/Dialect/FIRRTL/resolve-paths-errors.mlir +++ b/test/Dialect/FIRRTL/resolve-paths-errors.mlir @@ -12,7 +12,7 @@ firrtl.module @BadTargetKind() { firrtl.circuit "BadPathString" { firrtl.module @BadPathString() { // expected-error @below {{OMDeleted references can not have targets}} - %0 = firrtl.unresolved_path "OMDeleted:" + %0 = firrtl.unresolved_path "OMDeleted:~Foo|Bar>baz" } } diff --git a/test/Dialect/FIRRTL/resolve-paths.mlir b/test/Dialect/FIRRTL/resolve-paths.mlir index a491bc0e7678..f4ccc2dfbfbd 100644 --- a/test/Dialect/FIRRTL/resolve-paths.mlir +++ b/test/Dialect/FIRRTL/resolve-paths.mlir @@ -4,7 +4,7 @@ firrtl.circuit "Deleted" { firrtl.module @Deleted() { // CHECK: %0 = firrtl.path reference distinct[0]<> - %0 = firrtl.unresolved_path "OMDeleted" + %0 = firrtl.unresolved_path "OMDeleted:" } } @@ -15,7 +15,7 @@ firrtl.circuit "Deleted" { firrtl.module @Deleted(out %path : !firrtl.path) { // CHECK: %0 = firrtl.path reference distinct[0]<> // CHECK: propassign %path, %0 : !firrtl.path - %0 = firrtl.unresolved_path "OMDeleted" + %0 = firrtl.unresolved_path "OMDeleted:" firrtl.propassign %path, %0 : !firrtl.path } }