summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-03-06 05:40:21 -0800
committerJames Iry <jamesiry@gmail.com>2013-03-06 05:40:21 -0800
commitb8c8299be52e1bffc0efec54bd7294510e36022e (patch)
tree52f122539a235e659167fa2fdf27633c1bc2a025 /src
parent32f04db6723b1c8d19f34499543b6b3dbc1f923d (diff)
parent3f0224c4de5b04f33e3de523c03d418b818af879 (diff)
downloadscala-b8c8299be52e1bffc0efec54bd7294510e36022e.tar.gz
scala-b8c8299be52e1bffc0efec54bd7294510e36022e.tar.bz2
scala-b8c8299be52e1bffc0efec54bd7294510e36022e.zip
Merge pull request #2205 from JamesIry/master_deoptimize
Add option to disable optimization
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 2c9c20666d..702071f906 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -43,6 +43,7 @@ trait ScalaSettings extends AbsScalaSettings
/** Internal use - syntax enhancements. */
private class EnableSettings[T <: BooleanSetting](val s: T) {
def enabling(toEnable: List[BooleanSetting]): s.type = s withPostSetHook (_ => toEnable foreach (_.value = s.value))
+ def disabling(toDisable: List[BooleanSetting]): s.type = s withPostSetHook (_ => toDisable foreach (_.value = !s.value))
def andThen(f: s.T => Unit): s.type = s withPostSetHook (setting => f(setting.value))
}
private implicit def installEnableSettings[T <: BooleanSetting](s: T) = new EnableSettings(s)
@@ -194,6 +195,7 @@ trait ScalaSettings extends AbsScalaSettings
*/
val future = BooleanSetting("-Xfuture", "Turn on future language features.") enabling futureSettings
val optimise = BooleanSetting("-optimise", "Generates faster bytecode by applying optimisations to the program") withAbbreviation "-optimize" enabling optimiseSettings
+ val nooptimise = BooleanSetting("-Ynooptimise", "Clears all the flags set by -optimise. Useful for testing optimizations in isolation.") withAbbreviation "-Ynooptimize" disabling optimise::optimiseSettings
val Xexperimental = BooleanSetting("-Xexperimental", "Enable experimental extensions.") enabling experimentalSettings
// Feature extensions