aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/AddDescriptionNodes.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/firrtl/AddDescriptionNodes.scala')
-rw-r--r--src/main/scala/firrtl/AddDescriptionNodes.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/scala/firrtl/AddDescriptionNodes.scala b/src/main/scala/firrtl/AddDescriptionNodes.scala
index 123ae6e3..90e38beb 100644
--- a/src/main/scala/firrtl/AddDescriptionNodes.scala
+++ b/src/main/scala/firrtl/AddDescriptionNodes.scala
@@ -28,6 +28,13 @@ case class DocStringAnnotation(target: Target, description: String) extends Desc
case Some(seq) => seq.map(n => this.copy(target = n))
}
}
+ override private[firrtl] def dedup: Option[(Any, Annotation, ReferenceTarget)] = this match {
+ case a @ DocStringAnnotation(refTarget: ReferenceTarget, _) =>
+ Some(((refTarget.pathlessTarget, description), copy(target = refTarget.pathlessTarget), refTarget))
+ case a @ DocStringAnnotation(pathTarget: InstanceTarget, _) =>
+ Some(((pathTarget.pathlessTarget, description), copy(target = pathTarget.pathlessTarget), pathTarget.asReference))
+ case _ => None
+ }
}
/**
@@ -42,6 +49,13 @@ case class AttributeAnnotation(target: Target, description: String) extends Desc
case Some(seq) => seq.map(n => this.copy(target = n))
}
}
+ override private[firrtl] def dedup: Option[(Any, Annotation, ReferenceTarget)] = this match {
+ case a @ AttributeAnnotation(refTarget: ReferenceTarget, _) =>
+ Some(((refTarget.pathlessTarget, description), copy(target = refTarget.pathlessTarget), refTarget))
+ case a @ AttributeAnnotation(pathTarget: InstanceTarget, _) =>
+ Some(((pathTarget.pathlessTarget, description), copy(target = pathTarget.pathlessTarget), pathTarget.asReference))
+ case _ => None
+ }
}
/**