From ed5459550ef6fd8ed1c23cbe6cec8ba8a541c1e3 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 5 Dec 2010 19:42:17 +0000 Subject: 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. --- src/compiler/scala/tools/nsc/Global.scala | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/compiler/scala/tools/nsc/Global.scala') 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 --------------------------------------- -- cgit v1.2.3