Skip to content

Commit

Permalink
[FIRRTL] Update parser for OMDeleted targets.
Browse files Browse the repository at this point in the history
All targets require the colon after the target kind, even OMDeleted.
  • Loading branch information
mikeurbach committed Mar 15, 2024
1 parent c848464 commit f1d478b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Dialect/FIRRTL/Transforms/ResolvePaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/Dialect/FIRRTL/resolve-paths-errors.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/Dialect/FIRRTL/resolve-paths.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
}
}

Expand All @@ -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
}
}
Expand Down

0 comments on commit f1d478b

Please sign in to comment.