diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-11-13 08:13:05 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-11-13 08:13:05 +0000 |
commit | 5438ab13a944a0721816012a9be99a9d3141d7a9 (patch) | |
tree | 9034f3358b86b18fd04945d2e0c4618041969e14 /src/compiler/scala/tools/ant/Scalac.scala | |
parent | 16f241cfe73244de1b8600318c104f81596b3afa (diff) | |
download | scala-5438ab13a944a0721816012a9be99a9d3141d7a9.tar.gz scala-5438ab13a944a0721816012a9be99a9d3141d7a9.tar.bz2 scala-5438ab13a944a0721816012a9be99a9d3141d7a9.zip |
Fixed minor bugs in icode.
Diffstat (limited to 'src/compiler/scala/tools/ant/Scalac.scala')
-rw-r--r-- | src/compiler/scala/tools/ant/Scalac.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index 4d4116d1d2..a804c526ff 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -49,6 +49,7 @@ import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} * <li>addparams,</li> * <li>scalacdebugging,</li> * <li>deprecation,</li> + * <li>optimise,</li> * <li>unchecked,</li> * <li>failonerror.</li> * </ul> @@ -140,6 +141,8 @@ class Scalac extends MatchingTask { private var addParams: String = "" /** Instruct the compiler to generate deprecation information. */ private var deprecation: Option[Boolean] = None + /** Instruct the compiler to run optimizations. */ + private var optimise: Option[Boolean] = None /** Instruct the compiler to generate unchecked information. */ private var unchecked: Option[Boolean] = None /** Indicates whether compilation errors will fail the build; defaults to true. */ @@ -320,6 +323,15 @@ class Scalac extends MatchingTask { error("Unknown deprecation flag '" + input + "'") } + /** Set the <code>optimise</code> info attribute. + * @param input One of the flags <code>yes/no</code> or <code>on/off</code>. */ + def setOptimise(input: String) { + if (Flag.isPermissible(input)) + optimise = Some("yes" == input || "on" == input) + else + error("Unknown optimisation flag '" + input + "'") + } + /** Set the <code>unchecked</code> info attribute. * @param input One of the flags <code>yes/no</code> or <code>on/off</code>. */ def setUnchecked(input: String) { @@ -538,6 +550,7 @@ class Scalac extends MatchingTask { if (!usepredefs.isEmpty) settings.nopredefs.value = !usepredefs.get if (!debugInfo.isEmpty) settings.debuginfo.value = debugInfo.get if (!deprecation.isEmpty) settings.deprecation.value = deprecation.get + if (!optimise.isEmpty) settings.XO.value = optimise.get if (!unchecked.isEmpty) settings.unchecked.value = unchecked.get if (!assemname.isEmpty) settings.assemname.value = assemname.get |