aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/options/package.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/firrtl/options/package.scala')
-rw-r--r--src/main/scala/firrtl/options/package.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/scala/firrtl/options/package.scala b/src/main/scala/firrtl/options/package.scala
index a0dcc194..8cf2875b 100644
--- a/src/main/scala/firrtl/options/package.scala
+++ b/src/main/scala/firrtl/options/package.scala
@@ -7,10 +7,15 @@ package object options {
implicit object StageOptionsView extends OptionsView[StageOptions] {
def view(options: AnnotationSeq): StageOptions = options
.collect { case a: StageOption => a }
- .foldLeft(StageOptions())((c, x) =>
+ .foldLeft(new StageOptions())((c, x) =>
x match {
case TargetDirAnnotation(a) => c.copy(targetDir = a)
- case InputAnnotationFileAnnotation(a) => c.copy(annotationFiles = a +: c.annotationFiles)
+ /* Insert input files at the head of the Seq for speed and because order shouldn't matter */
+ case InputAnnotationFileAnnotation(a) => c.copy(annotationFilesIn = a +: c.annotationFilesIn)
+ case OutputAnnotationFileAnnotation(a) => c.copy(annotationFileOut = Some(a))
+ /* Do NOT reorder program args. The order may matter. */
+ case ProgramArgsAnnotation(a) => c.copy(programArgs = c.programArgs :+ a)
+ case WriteDeletedAnnotation => c.copy(writeDeleted = true)
}
)
}