Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Don't add ResolvePaths annotations if no targets (#1392)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
seldridge and mergify[bot] authored Feb 20, 2020
1 parent 6766c03 commit c127444
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/scala/firrtl/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c127444

Please sign in to comment.