aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala
diff options
context:
space:
mode:
authorSchuyler Eldridge2020-02-20 13:26:31 -0500
committerGitHub2020-02-20 18:26:31 +0000
commitc127444f4a4dc1b922ae2afa385dbdeb0db7d7e4 (patch)
treec4e00eab8005d871c9aba506db1cf14cd2edb792 /src/main/scala
parent6766c035f3b77d4793ef28041f08588c9faa5473 (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>
Diffstat (limited to 'src/main/scala')
-rw-r--r--src/main/scala/firrtl/Compiler.scala8
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