File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package dotty.tools.benchmarks
22
33import dotty .tools .dotc ._
44import core .Contexts .Context
5+ import dotty .tools .FatalError
6+ import reporting ._
57
68import org .openjdk .jmh .results .RunResult
79import org .openjdk .jmh .runner .Runner
@@ -85,6 +87,21 @@ class CompilerOptions {
8587}
8688
8789class Worker extends Driver {
90+ // override to avoid printing summary information
91+ override def doCompile (compiler : Compiler , fileNames : List [String ])(implicit ctx : Context ): Reporter =
92+ if (fileNames.nonEmpty)
93+ try {
94+ val run = compiler.newRun
95+ run.compile(fileNames)
96+ ctx.reporter
97+ }
98+ catch {
99+ case ex : FatalError =>
100+ ctx.error(ex.getMessage) // signals that we should fail compilation.
101+ ctx.reporter
102+ }
103+ else ctx.reporter
104+
88105 @ Benchmark
89106 def compile (state : CompilerOptions ): Unit = {
90107 val res = process(state.opts)
You can’t perform that action at this time.
0 commit comments