Skip to content

Commit 4f27da1

Browse files
committed
Reuse extraArgs logic for dotc and scalac.
1 parent ab1080a commit 4f27da1

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

compilation/src/main/dotc/scala/tools/benchmark/BenchmarkDriver.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ trait BenchmarkDriver extends BaseBenchmarkDriver {
1616
ctx.setSetting(ctx.settings.d, tempDir.getAbsolutePath)
1717
ctx.setSetting(ctx.settings.language, List("Scala2"))
1818
val compiler = new dotty.tools.dotc.Compiler
19-
val args = compilerArgs ++ sourceFiles
20-
val reporter = dotty.tools.dotc.Bench.doCompile(compiler, args)
19+
val reporter = dotty.tools.dotc.Bench.doCompile(compiler, allArgs)
2120
assert(!reporter.hasErrors)
2221
}
2322
}

compilation/src/main/scala/scala/tools/nsc/ScalacBenchmark.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import scala.tools.benchmark.BenchmarkDriver
1717
trait BaseBenchmarkDriver {
1818
def source: String
1919
def extraArgs: String
20+
def extras: List[String] = if (extraArgs != null && extraArgs != "") extraArgs.split('|').toList else Nil
21+
def allArgs: List[String] = compilerArgs ++ extras ++ sourceFiles
2022
def corpusVersion: String
2123
def depsClasspath: String
2224
def tempDir: File

compilation/src/main/scalac/scala/tools/benchmark/BenchmarkDriver.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ trait BenchmarkDriver extends BaseBenchmarkDriver {
2828
}
2929
}
3030
val driver = new MainClass
31-
32-
val extras = if (extraArgs != null && extraArgs != "") extraArgs.split('|').toList else Nil
33-
val allArgs = compilerArgs ++ extras ++ sourceFiles
3431
driver.process(allArgs.toArray)
3532
assert(!driver.reporter.hasErrors)
3633
}

0 commit comments

Comments
 (0)