From 0dbc3ea559200c7bc85f5de90fd6a64d921dab63 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Fri, 9 Apr 2010 17:10:33 +0000 Subject: Turn on specialization by default. No review. --- src/compiler/scala/tools/nsc/Global.scala | 2 +- src/compiler/scala/tools/nsc/settings/ScalaSettings.scala | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 15da6f6fec..3e54b68daf 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -512,7 +512,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable phasesSet += uncurry // uncurry, translate function values to anonymous classes phasesSet += tailCalls // replace tail calls by jumps - if (settings.specialize.value) + if (!settings.nospecialization.value) phasesSet += specializeTypes phasesSet += explicitOuter // replace C.this by explicit outer pointers, eliminate pattern matching phasesSet += erasure // erase types, add interfaces for traits diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index f9fd996add..fda0097226 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -45,6 +45,8 @@ trait ScalaSettings extends AbsScalaSettings with StandardScalaSettings { val optimise = BooleanSetting ("-optimise", "Generates faster bytecode by applying optimisations to the program") . withAbbreviation("-optimize") . withPostSetHook(_ => List(inline, Xcloselim, Xdce) foreach (_.value = true)) + val nospecialization = BooleanSetting ("-no-specialization", "Ignore @specialize annotations.") + /** * -X "Advanced" settings @@ -126,7 +128,6 @@ trait ScalaSettings extends AbsScalaSettings with StandardScalaSettings { ChoiceSetting ("-Ystruct-dispatch", "Selects dispatch method for structural refinement method calls", List("no-cache", "mono-cache", "poly-cache", "invoke-dynamic"), "poly-cache") . withHelpSyntax("-Ystruct-dispatch:") - val specialize = BooleanSetting ("-Yspecialize", "Specialize generic code on types.") val Yrangepos = BooleanSetting ("-Yrangepos", "Use range positions for syntax trees.") val Yidedebug = BooleanSetting ("-Yide-debug", "Generate, validate and output trees using the interactive compiler.") val Ybuilderdebug = ChoiceSetting ("-Ybuilder-debug", "Compile using the specified build manager", List("none", "refined", "simple"), "none") . -- cgit v1.2.3