diff options
| author | Adam Izraelevitz | 2016-11-07 20:04:19 -0500 |
|---|---|---|
| committer | GitHub | 2016-11-07 20:04:19 -0500 |
| commit | 1052a92a44b738303636fd8776597d1ea1b84a51 (patch) | |
| tree | 96eca9a00bf3031d74bb3fafd751b712114b0aee /src/main/scala/firrtl/Compiler.scala | |
| parent | 907a2b2bff7023316a29e129aa9cbc04ba794c06 (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.scala | 12 |
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 |
