diff options
| author | Schuyler Eldridge | 2020-02-20 13:26:31 -0500 |
|---|---|---|
| committer | GitHub | 2020-02-20 18:26:31 +0000 |
| commit | c127444f4a4dc1b922ae2afa385dbdeb0db7d7e4 (patch) | |
| tree | c4e00eab8005d871c9aba506db1cf14cd2edb792 | |
| parent | 6766c035f3b77d4793ef28041f08588c9faa5473 (diff) | |
Don't add ResolvePaths annotations if no targets (#1392)
Adds a case to CircuitState.resolvePaths such that if no targets are
requested, then no ResolvePaths annotations are added.
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| -rw-r--r-- | src/main/scala/firrtl/Compiler.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/Compiler.scala b/src/main/scala/firrtl/Compiler.scala index 81d219ea..2c5600de 100644 --- a/src/main/scala/firrtl/Compiler.scala +++ b/src/main/scala/firrtl/Compiler.scala @@ -58,9 +58,11 @@ case class CircuitState( * @param targets * @return */ - def resolvePaths(targets: Seq[CompleteTarget]): CircuitState = { - val newCS = new EliminateTargetPaths().runTransform(this.copy(annotations = ResolvePaths(targets) +: annotations )) - newCS.copy(form = form) + def resolvePaths(targets: Seq[CompleteTarget]): CircuitState = targets match { + case Nil => this + case _ => + val newCS = new EliminateTargetPaths().runTransform(this.copy(annotations = ResolvePaths(targets) +: annotations )) + newCS.copy(form = form) } /** Returns a new CircuitState with the targets of every annotation of a type in annoClasses |
