Skip to content

Rename -tasty to -from-tasty #3512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/Driver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import fromtasty.TASTYCompiler
class Driver extends DotClass {

protected def newCompiler(implicit ctx: Context): Compiler =
if (ctx.settings.tasty.value) new TASTYCompiler
if (ctx.settings.fromTasty.value) new TASTYCompiler
else new Compiler

protected def emptyReporter: Reporter = new StoreReporter(null)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ScalaSettings extends Settings.SettingGroup {
val language = MultiStringSetting("-language", "feature", "Enable one or more language features.")
val rewrite = OptionSetting[Rewrites]("-rewrite", "When used in conjunction with -language:Scala2 rewrites sources to migrate to new syntax")
val silentWarnings = BooleanSetting("-nowarn", "Silence all warnings.")
val tasty = BooleanSetting("-tasty", "Compile classes from tasty in classpath. The arguments are used as class names.")
val fromTasty = BooleanSetting("-from-tasty", "Compile classes from tasty in classpath. The arguments are used as class names.")

/** -X "Advanced" settings
*/
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class ClassfileLoader(val classfile: AbstractFile) extends SymbolLoader {
}

private def mayLoadTreesFromTasty(implicit ctx: Context): Boolean =
ctx.settings.YretainTrees.value || ctx.settings.XlinkOptimise.value || ctx.settings.tasty.value
ctx.settings.YretainTrees.value || ctx.settings.XlinkOptimise.value || ctx.settings.fromTasty.value
}

class SourcefileLoader(val srcfile: AbstractFile) extends SymbolLoader {
Expand Down
4 changes: 2 additions & 2 deletions compiler/test/dotty/tools/vulpix/ParallelTesting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
protected def compileFromTasty(flags0: TestFlags, suppressErrors: Boolean, targetDir: JFile): TestReporter = {
val tastyOutput = new JFile(targetDir.getPath + "_from-tasty")
tastyOutput.mkdir()
val flags = flags0 and ("-d", tastyOutput.getAbsolutePath) and "-tasty"
val flags = flags0 and ("-d", tastyOutput.getAbsolutePath) and "-from-tasty"

def hasTastyFileToClassName(f: JFile): String =
targetDir.toPath.relativize(f.toPath).toString.dropRight(".hasTasty".length).replace('/', '.')
Expand Down Expand Up @@ -1099,7 +1099,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
val target = JointCompilationSource(
testGroup.name,
Array(sourceFile),
flags.withClasspath(tastySource.getPath) and "-tasty",
flags.withClasspath(tastySource.getPath) and "-from-tasty",
tastySource,
fromTasty = true
)
Expand Down
4 changes: 2 additions & 2 deletions project/scripts/sbtBootstrappedTests
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ mkdir out/scriptedtest0


# check that `dotc` compiles and `dotr` runs it
echo "testing sbt dotc -tasty and dotr -classpath"
echo "testing sbt dotc -from-tasty and dotr -classpath"
mkdir out/scriptedtest1
mkdir out/scriptedtest2
./bin/dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/
./bin/dotc -tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test
./bin/dotc -from-tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test
# FIXME #3477
#./bin/dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out
#if grep -e "dotr test ok" sbtdotr2.out; then
Expand Down
4 changes: 2 additions & 2 deletions project/scripts/sbtTests
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ else
fi

# check that `sbt dotc` compiles and `sbt dotr` runs it
echo "testing sbt dotc -tasty and dotr -classpath"
echo "testing sbt dotc -from-tasty and dotr -classpath"
mkdir out/scriptedtest1
mkdir out/scriptedtest2
./project/scripts/sbt ";dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/; dotc -tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test; dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out
./project/scripts/sbt ";dotc tests/pos/sbtDotrTest.scala -d out/scriptedtest1/; dotc -from-tasty -classpath out/scriptedtest1/ -d out/scriptedtest2/ dotrtest.Test; dotr -classpath out/scriptedtest2/ dotrtest.Test" > sbtdotr2.out
cat sbtdotr2.out
if grep -e "dotr test ok" sbtdotr2.out; then
echo "output ok"
Expand Down