File tree 7 files changed +37
-13
lines changed 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 {
326
326
val (classRoot, moduleRoot) = rootDenots(root.asClass)
327
327
val classfileParser = new ClassfileParser (classfile, classRoot, moduleRoot)(ctx)
328
328
val result = classfileParser.run()
329
- if (ctx.settings. YretainTrees .value || ctx.settings. XlinkOptimise .value ) {
329
+ if (mayLoadTreesFromTasty ) {
330
330
result match {
331
331
case Some (unpickler : tasty.DottyUnpickler ) =>
332
332
classRoot.symbol.asClass.unpickler = unpickler
@@ -335,6 +335,9 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
335
335
}
336
336
}
337
337
}
338
+
339
+ private def mayLoadTreesFromTasty (implicit ctx : Context ): Boolean =
340
+ ctx.settings.YretainTrees .value || ctx.settings.XlinkOptimise .value || ctx.settings.tasty.value
338
341
}
339
342
340
343
class SourcefileLoader (val srcfile : AbstractFile ) extends SymbolLoader {
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ class ReadTastyTreesFromClasses extends FrontEnd {
20
20
21
21
def readTASTY (unit : CompilationUnit )(implicit ctx : Context ): Option [CompilationUnit ] = unit match {
22
22
case unit : TASTYCompilationUnit =>
23
- assert(ctx.settings.YretainTrees .value)
24
23
val className = unit.className.toTypeName
25
24
def compilationUnit (className : TypeName ): Option [CompilationUnit ] = {
26
25
tree(className).flatMap {
Original file line number Diff line number Diff line change @@ -1099,7 +1099,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
1099
1099
val target = JointCompilationSource (
1100
1100
testGroup.name,
1101
1101
Array (sourceFile),
1102
- flags.withClasspath(tastySource.getPath) and " -Yretain-trees " ,
1102
+ flags.withClasspath(tastySource.getPath) and " -tasty " ,
1103
1103
tastySource,
1104
1104
fromTasty = true
1105
1105
)
Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ case "$1" in
81
81
# Optimize for short-running applications, see https://github.com/lampepfl/dotty/issues/222
82
82
-Oshort) addJava " -XX:+TieredCompilation -XX:TieredStopAtLevel=1" && shift ;;
83
83
-repl) PROG_NAME=" $ReplMain " && shift ;;
84
- -tasty) addScala " -Yretain-trees" && PROG_NAME=" $CompilerMain " && shift ;;
85
84
-compile) PROG_NAME=" $CompilerMain " && shift ;;
86
85
-run) PROG_NAME=" $ReplMain " && shift ;;
87
86
-bootcp) bootcp=true && shift ;;
Original file line number Diff line number Diff line change @@ -623,17 +623,11 @@ object Build {
623
623
val args0 : List [String ] = spaceDelimited(" <arg>" ).parsed.toList
624
624
val args = args0.filter(arg => arg != " -repl" )
625
625
626
- val tasty = args0.contains(" -tasty" )
627
-
628
626
val main =
629
627
if (repl) " dotty.tools.repl.Main"
630
628
else " dotty.tools.dotc.Main"
631
629
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)
637
631
638
632
(runMain in Compile ).toTask(fullArgs.mkString(" " , " " , " " ))
639
633
}
Original file line number Diff line number Diff line change 2
2
3
3
# check that benchmarks can run
4
4
./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 3
3
# check that benchmarks can run
4
4
./project/scripts/sbt " dotty-bench/jmh:run 1 1 tests/pos/alias.scala"
5
5
6
- # check that `dotc` compiles and `dotr` runs it
6
+ # check that `sbt dotc` compiles and `sbt dotr` runs it
7
7
echo " testing sbt dotc and dotr"
8
8
mkdir out/scriptedtest0
9
9
./project/scripts/sbt " ;dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest0 ;dotr -classpath out/scriptedtest0 dotrtest.Test" > sbtdotr1.out
13
13
exit -1
14
14
fi
15
15
16
- # check that `dotc` compiles and `dotr` runs it
16
+ # check that `sbt dotc` compiles and `sbt dotr` runs it
17
17
echo " testing sbt dotc -tasty and dotr -classpath"
18
18
mkdir out/scriptedtest1
19
19
mkdir out/scriptedtest2
You can’t perform that action at this time.
0 commit comments