summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-05 19:42:17 +0000
committerPaul Phillips <paulp@improving.org>2010-12-05 19:42:17 +0000
commited5459550ef6fd8ed1c23cbe6cec8ba8a541c1e3 (patch)
treece6a4a005aa5619c201aa63a75fdb2b98781d1b0 /src/compiler/scala/tools/nsc/Global.scala
parent77eb8fefec3e62ead95c7d409ec5a28f30289ec3 (diff)
downloadscala-ed5459550ef6fd8ed1c23cbe6cec8ba8a541c1e3.tar.gz
scala-ed5459550ef6fd8ed1c23cbe6cec8ba8a541c1e3.tar.bz2
scala-ed5459550ef6fd8ed1c23cbe6cec8ba8a541c1e3.zip
Cleaned up and brought up to date the help text...
Cleaned up and brought up to date the help text for -X and -Y options. Made some enhancements to PhasesSetting, which are documented if you run scalac -X or -Y. (Try it!) Disabled some dead settings and renamed others to reflect their current purpose. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index bb0e122dd6..261714452d 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -203,9 +203,9 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
/** Taking flag checking to a somewhat higher level. */
object opt {
- // True if the given PhasesSetting includes the current phase.
- def isActive(ph: Settings#PhasesSetting) = ph contains globalPhase.name
- def wasActive(ph: Settings#PhasesSetting) = ph contains globalPhase.prev.name
+ // protected implicit lazy val globalPhaseOrdering: Ordering[Phase] = Ordering[Int] on (_.id)
+ def isActive(ph: Settings#PhasesSetting) = ph containsPhase globalPhase
+ def wasActive(ph: Settings#PhasesSetting) = ph containsPhase globalPhase.prev
// Some(value) if setting has been set by user, None otherwise.
def optSetting[T](s: Settings#Setting): Option[T] =
@@ -557,11 +557,11 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
analyzer.typerFactory -> "the meat and potatoes: type the trees",
superAccessors -> "add super accessors in traits and nested classes",
pickler -> "serialize symbol tables",
- refchecks -> "reference and override checking, translate nested objects",
+ refchecks -> "reference/override checking, translate nested objects",
uncurry -> "uncurry, translate function values to anonymous classes",
tailCalls -> "replace tail calls by jumps",
specializeTypes -> "@specialized-driven class and method specialization",
- explicitOuter -> "C.this refs become outer pointers, translate pattern matches",
+ explicitOuter -> "this refs to outer pointers, translate patterns",
erasure -> "erase types, add interfaces for traits",
lazyVals -> "allocate bitmaps, translate lazy vals into lazified defs",
lambdaLift -> "move nested functions to top level",
@@ -617,9 +617,14 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
/** A description of the phases that will run */
def phaseDescriptions: String = {
val width = phaseNames map (_.length) max
- val fmt = "%" + width + "s %s\n"
+ val fmt = "%" + width + "s %2s %s\n"
- phaseDescriptors map (ph => fmt.format(ph.phaseName, phasesDescMap(ph))) mkString
+ val line1 = fmt.format("phase name", "id", "description")
+ val line2 = fmt.format("----------", "--", "-----------")
+ val descs = phaseDescriptors.zipWithIndex map {
+ case (ph, idx) => fmt.format(ph.phaseName, idx + 1, phasesDescMap(ph))
+ }
+ line1 :: line2 :: descs mkString
}
// ----------- Runs ---------------------------------------