aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Laeufer2021-05-21 12:58:02 -0700
committerGitHub2021-05-21 12:58:02 -0700
commitd35248c8efc8c7afb1b99ddea631be5e6537d46d (patch)
treeee475dcef04e81cfe1e0013c2f36e36d4d8be7f3
parentabb8b4c90e7218129783372235619be00a215d66 (diff)
Annotation: override getTargets for SingleTargetAnnotation (#2241)
-rw-r--r--src/main/scala/firrtl/annotations/Annotation.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/scala/firrtl/annotations/Annotation.scala b/src/main/scala/firrtl/annotations/Annotation.scala
index b5c9c7e0..8722c4fa 100644
--- a/src/main/scala/firrtl/annotations/Annotation.scala
+++ b/src/main/scala/firrtl/annotations/Annotation.scala
@@ -48,6 +48,9 @@ trait NoTargetAnnotation extends Annotation {
trait SingleTargetAnnotation[T <: Named] extends Annotation {
val target: T
+ // we can implement getTargets more efficiently since we know that we have exactly one target
+ override def getTargets: Seq[Target] = Seq(target)
+
/** Create another instance of this Annotation */
def duplicate(n: T): Annotation