Skip to content

Commit de8368d

Browse files
committed
Remove -resident setting
1 parent 2e33ba9 commit de8368d

File tree

3 files changed

+9
-43
lines changed

3 files changed

+9
-43
lines changed

src/dotty/tools/dotc/Bench.scala

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,7 @@ package dotc
88
import core.Contexts.Context
99
import reporting.Reporter
1010

11-
/* To do:
12-
* - simplify hk types
13-
* - have a second look at normalization (leave at method types if pt is method type?)
14-
* - Don't open package objects from class files if they are present in source
15-
* - Revise the way classes are inherited - when not followed by [...] or (...),
16-
* assume the unparameterized type and forward type parameters as we do now for the synthetic head class.
17-
*/
1811
object Bench extends Driver {
19-
def resident(compiler: Compiler): Reporter = unsupported("resident") /*loop { line =>
20-
val command = new CompilerCommand(line split "\\s+" toList, new Settings(scalacError))
21-
compiler.reporter.reset()
22-
new compiler.Run() compile command.files
23-
}*/
2412

2513
private var numRuns = 1
2614

@@ -29,29 +17,25 @@ object Bench extends Driver {
2917
private def ntimes(n: Int)(op: => Reporter): Reporter =
3018
(emptyReporter /: (0 until n)) ((_, _) => op)
3119

32-
override def doCompile(compiler: Compiler, fileNames: List[String], reporter: Option[Reporter] = None)
33-
(implicit ctx: Context): Reporter =
34-
if (new config.Settings.Setting.SettingDecorator[Boolean](ctx.base.settings.resident).value(ctx))
35-
resident(compiler)
36-
else
37-
ntimes(numRuns) {
38-
val start = System.nanoTime()
39-
val r = super.doCompile(compiler, fileNames, reporter)
40-
ctx.println(s"time elapsed: ${(System.nanoTime - start) / 1000000}ms")
41-
r
42-
}
20+
override def doCompile(compiler: Compiler, fileNames: List[String])(implicit ctx: Context): Reporter =
21+
ntimes(numRuns) {
22+
val start = System.nanoTime()
23+
val r = super.doCompile(compiler, fileNames)
24+
println(s"time elapsed: ${(System.nanoTime - start) / 1000000}ms")
25+
r
26+
}
4327

4428
def extractNumArg(args: Array[String], name: String, default: Int = 1): (Int, Array[String]) = {
4529
val pos = args indexOf name
4630
if (pos < 0) (default, args)
4731
else (args(pos + 1).toInt, (args take pos) ++ (args drop (pos + 2)))
4832
}
4933

50-
override def process(args: Array[String], rootCtx: Context, reporter: Option[Reporter] = None): Reporter = {
34+
override def process(args: Array[String], rootCtx: Context): Reporter = {
5135
val (numCompilers, args1) = extractNumArg(args, "#compilers")
5236
val (numRuns, args2) = extractNumArg(args1, "#runs")
5337
this.numRuns = numRuns
54-
ntimes(numCompilers)(super.process(args2, rootCtx, reporter))
38+
ntimes(numCompilers)(super.process(args2, rootCtx))
5539
}
5640
}
5741

src/dotty/tools/dotc/Main.scala

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/* NSC -- new Scala compiler
2-
* Copyright 2005-2013 LAMP/EPFL
3-
* @author Martin Odersky
4-
*/
51
package dotty.tools
62
package dotc
73

@@ -11,18 +7,5 @@ import reporting.Reporter
117
/* To do:
128
*/
139
object Main extends Driver {
14-
def resident(compiler: Compiler): Reporter = unsupported("resident") /*loop { line =>
15-
val command = new CompilerCommand(line split "\\s+" toList, new Settings(scalacError))
16-
compiler.reporter.reset()
17-
new compiler.Run() compile command.files
18-
}*/
19-
2010
override def newCompiler(): Compiler = new Compiler
21-
22-
override def doCompile(compiler: Compiler, fileNames: List[String], reporter: Option[Reporter] = None)(implicit ctx: Context): Reporter = {
23-
if (new config.Settings.Setting.SettingDecorator[Boolean](ctx.base.settings.resident).value(ctx))
24-
resident(compiler)
25-
else
26-
super.doCompile(compiler, fileNames, reporter)
27-
}
2811
}

src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ class ScalaSettings extends Settings.SettingGroup {
8181
val Xprintpos = BooleanSetting("-Xprint-pos", "Print tree positions, as offsets.")
8282
val printtypes = BooleanSetting("-Xprint-types", "Print tree types (debugging option).")
8383
val prompt = BooleanSetting("-Xprompt", "Display a prompt after each error (debugging option).")
84-
val resident = BooleanSetting("-Xresident", "Compiler stays resident: read source filenames from standard input.")
8584
val script = StringSetting("-Xscript", "object", "Treat the source file as a script and wrap it in a main method.", "")
8685
val mainClass = StringSetting("-Xmain-class", "path", "Class for manifest's Main-Class entry (only useful with -d <jar>)", "")
8786
val Xshowcls = StringSetting("-Xshow-class", "class", "Show internal representation of class.", "")

0 commit comments

Comments
 (0)