aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/Compiler.scala
diff options
context:
space:
mode:
authorAdam Izraelevitz2016-11-07 20:04:19 -0500
committerGitHub2016-11-07 20:04:19 -0500
commit1052a92a44b738303636fd8776597d1ea1b84a51 (patch)
tree96eca9a00bf3031d74bb3fafd751b712114b0aee /src/main/scala/firrtl/Compiler.scala
parent907a2b2bff7023316a29e129aa9cbc04ba794c06 (diff)
Fix annotations (#366)
getMyAnnotations now returns Seq[Annotation] Changed test to check number of annotations is the same
Diffstat (limited to 'src/main/scala/firrtl/Compiler.scala')
-rw-r--r--src/main/scala/firrtl/Compiler.scala12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/scala/firrtl/Compiler.scala b/src/main/scala/firrtl/Compiler.scala
index 316c563b..2e155885 100644
--- a/src/main/scala/firrtl/Compiler.scala
+++ b/src/main/scala/firrtl/Compiler.scala
@@ -95,11 +95,10 @@ abstract class Transform {
* @param state The [[CircuitState]] form which to extract annotations
* @return A collection of annotations
*/
- final def getMyAnnotations(state: CircuitState): Option[Map[Named, Annotation]] =
- for {
- annotations <- state.annotations
- myAnnotations <- annotations.get(this.getClass)
- } yield myAnnotations
+ final def getMyAnnotations(state: CircuitState): Seq[Annotation] = state.annotations match {
+ case Some(annotations) => annotations.get(this.getClass)
+ case None => Nil
+ }
}
trait SimpleRun extends LazyLogging {
@@ -254,8 +253,7 @@ trait Compiler {
// annotations with the names in rmap's value.
for {
(oldName, newNames) <- rmap.toSeq
- transform2OldAnnos <- inAnnotationMap.get(oldName).toSeq
- oldAnno <- transform2OldAnnos.values
+ oldAnno <- inAnnotationMap.get(oldName)
newAnno <- oldAnno.update(newNames)
} yield newAnno
case _ => inAnnotationMap.annotations