From c127444f4a4dc1b922ae2afa385dbdeb0db7d7e4 Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Thu, 20 Feb 2020 13:26:31 -0500 Subject: 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 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- src/main/scala/firrtl/Compiler.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3