File tree Expand file tree Collapse file tree 7 files changed +37
-13
lines changed Expand file tree Collapse file tree 7 files changed +37
-13
lines changed Original file line number Diff line number Diff line change @@ -326,7 +326,7 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
326326 val (classRoot, moduleRoot) = rootDenots(root.asClass)
327327 val classfileParser = new ClassfileParser (classfile, classRoot, moduleRoot)(ctx)
328328 val result = classfileParser.run()
329- if (ctx.settings. YretainTrees .value || ctx.settings. XlinkOptimise .value ) {
329+ if (mayLoadTreesFromTasty ) {
330330 result match {
331331 case Some (unpickler : tasty.DottyUnpickler ) =>
332332 classRoot.symbol.asClass.unpickler = unpickler
@@ -335,6 +335,9 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
335335 }
336336 }
337337 }
338+
339+ private def mayLoadTreesFromTasty (implicit ctx : Context ): Boolean =
340+ ctx.settings.YretainTrees .value || ctx.settings.XlinkOptimise .value || ctx.settings.tasty.value
338341}
339342
340343class SourcefileLoader (val srcfile : AbstractFile ) extends SymbolLoader {
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ class ReadTastyTreesFromClasses extends FrontEnd {
2020
2121 def readTASTY (unit : CompilationUnit )(implicit ctx : Context ): Option [CompilationUnit ] = unit match {
2222 case unit : TASTYCompilationUnit =>
23- assert(ctx.settings.YretainTrees .value)
2423 val className = unit.className.toTypeName
2524 def compilationUnit (className : TypeName ): Option [CompilationUnit ] = {
2625 tree(className).flatMap {
Original file line number Diff line number Diff line change @@ -1099,7 +1099,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
10991099 val target = JointCompilationSource (
11001100 testGroup.name,
11011101 Array (sourceFile),
1102- flags.withClasspath(tastySource.getPath) and " -Yretain-trees " ,
1102+ flags.withClasspath(tastySource.getPath) and " -tasty " ,
11031103 tastySource,
11041104 fromTasty = true
11051105 )
Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ case "$1" in
8181 # Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
8282 -Oshort) addJava " -XX:+TieredCompilation -XX:TieredStopAtLevel=1" && shift ;;
8383 -repl) PROG_NAME=" $ReplMain " && shift ;;
84- -tasty) addScala " -Yretain-trees" && PROG_NAME=" $CompilerMain " && shift ;;
8584 -compile) PROG_NAME=" $CompilerMain " && shift ;;
8685 -run) PROG_NAME=" $ReplMain " && shift ;;
8786 -bootcp) bootcp=true && shift ;;
Original file line number Diff line number Diff line change @@ -623,17 +623,11 @@ object Build {
623623 val args0 : List [String ] = spaceDelimited(" <arg>" ).parsed.toList
624624 val args = args0.filter(arg => arg != " -repl" )
625625
626- val tasty = args0.contains(" -tasty" )
627-
628626 val main =
629627 if (repl) " dotty.tools.repl.Main"
630628 else " dotty.tools.dotc.Main"
631629
632- val extraArgs =
633- if (tasty && ! args.contains(" -Yretain-trees" )) List (" -Yretain-trees" )
634- else Nil
635-
636- val fullArgs = main :: extraArgs ::: insertClasspathInArgs(args, dottyLib)
630+ val fullArgs = main :: insertClasspathInArgs(args, dottyLib)
637631
638632 (runMain in Compile ).toTask(fullArgs.mkString(" " , " " , " " ))
639633 }
Original file line number Diff line number Diff line change 22
33# check that benchmarks can run
44./project/scripts/sbt " dotty-bench-bootstrapped/jmh:run 1 1 tests/pos/alias.scala"
5+
6+
7+ # setup for `dotc`/`dotr` script tests
8+ ./project/scripts/sbt dist-bootstrapped/pack
9+
10+ # check that `dotc` compiles and `dotr` runs it
11+ echo " testing sbt dotc and dotr"
12+ mkdir out/scriptedtest0
13+ ./dist-bootstrapped/target/pack/bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest0
14+ ./dist-bootstrapped/target/pack/bin/dotr -classpath out/scriptedtest0 dotrtest.Test" > sbtdotr1.out
15+ if grep -e " dotr test ok" sbtdotr1.out; then
16+ echo " output ok"
17+ else
18+ exit -1
19+ fi
20+
21+
22+ # check that ` dotc` compiles and ` dotr` runs it
23+ echo " testing sbt dotc -tasty and dotr -classpath"
24+ mkdir out/scriptedtest1
25+ mkdir out/scriptedtest2
26+ ./dist-bootstrapped/target/pack/bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/
27+ ./dist-bootstrapped/target/pack/bin/dotc -tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test
28+ ./dist-bootstrapped/target/pack/bin/dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out
29+ if grep -e " dotr test ok" sbtdotr2.out; then
30+ echo " output ok"
31+ else
32+ exit -1
33+ fi
Original file line number Diff line number Diff line change 33# check that benchmarks can run
44./project/scripts/sbt " dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
55
6- # check that `dotc` compiles and `dotr` runs it
6+ # check that `sbt dotc` compiles and `sbt dotr` runs it
77echo " testing sbt dotc and dotr"
88mkdir out/scriptedtest0
99./project/scripts/sbt " ;dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest0 ;dotr -classpath out/scriptedtest0 dotrtest.Test" > sbtdotr1.out
1313 exit -1
1414fi
1515
16- # check that `dotc` compiles and `dotr` runs it
16+ # check that `sbt dotc` compiles and `sbt dotr` runs it
1717echo " testing sbt dotc -tasty and dotr -classpath"
1818mkdir out/scriptedtest1
1919mkdir out/scriptedtest2
You can’t perform that action at this time.
0 commit comments