Skip to content
This repository
Newer
Older
100644 164 lines (146 sloc) 11.333 kb
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
1 /* NSC -- new Scala compiler
2 * Copyright 2005-2010 LAMP/EPFL
3 * @author Martin Odersky
4 */
5 // $Id$
6
e93c1a93 »
2010-04-11 Introduces scala.tools.cmd providing command li...
7 package scala.tools
8 package nsc
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
9 package settings
10
11 import annotation.elidable
e93c1a93 »
2010-04-11 Introduces scala.tools.cmd providing command li...
12 import scala.tools.util.PathResolver.Defaults
13 import scala.collection.mutable.HashSet
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
14
217415af »
2010-03-08 More progress toward immutable Settings, and va...
15 trait ScalaSettings extends AbsScalaSettings with StandardScalaSettings {
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
16 self: MutableSettings =>
17
e93c1a93 »
2010-04-11 Introduces scala.tools.cmd providing command li...
18 import Defaults.scalaUserClassPath
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
19
20 /** Set of settings */
217415af »
2010-03-08 More progress toward immutable Settings, and va...
21 protected lazy val allSettings = HashSet[Setting]()
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
22
23 /** Disable a setting */
24 def disable(s: Setting) = allSettings -= s
25
26 /**
27 * Temporary Settings
28 */
29 val suppressVTWarn = BooleanSetting ("-Ysuppress-vt-typer-warnings", "Suppress warnings from the typer when testing the virtual class encoding, NOT FOR FINAL!")
30
31 /**
32 * Standard settings
33 */
34 // argfiles is only for the help message
35 val argfiles = BooleanSetting ("@<file>", "A text file containing compiler arguments (options and source files)")
f427b1e6 »
2010-03-25 Altered classpath behavior when no default is g...
36 val classpath = PathSetting ("-classpath", "path", "Specify where to find user class files", scalaUserClassPath) .
217415af »
2010-03-08 More progress toward immutable Settings, and va...
37 withAbbreviation ("-cp")
38 val d = OutputSetting (outputDirs, ".")
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
39 val defines = DefinesSetting()
217415af »
2010-03-08 More progress toward immutable Settings, and va...
40 val optimise = BooleanSetting ("-optimise", "Generates faster bytecode by applying optimisations to the program") .
41 withAbbreviation("-optimize") .
42 withPostSetHook(_ => List(inline, Xcloselim, Xdce) foreach (_.value = true))
0dbc3ea5 »
2010-04-09 Turn on specialization by default. No review.
43 val nospecialization = BooleanSetting ("-no-specialization", "Ignore @specialize annotations.")
44
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
45
46 /**
47 * -X "Advanced" settings
48 */
49 val Xhelp = BooleanSetting ("-X", "Print a synopsis of advanced options")
50 val assemname = StringSetting ("-Xassem-name", "file", "Name of the output assembly (only relevant with -target:msil)", "").dependsOn(target, "msil")
51 val assemrefs = StringSetting ("-Xassem-path", "path", "List of assemblies referenced by the program (only relevant with -target:msil)", ".").dependsOn(target, "msil")
52 val assemextdirs = StringSetting ("-Xassem-extdirs", "dirs", "List of directories containing assemblies, defaults to `lib'", Defaults.scalaLibDir.path).dependsOn(target, "msil")
53 val sourcedir = StringSetting ("-Xsourcedir", "directory", "When -target:msil, the source folder structure is mirrored in output directory.", ".").dependsOn(target, "msil")
54 val checkInit = BooleanSetting ("-Xcheckinit", "Add runtime checks on field accessors. Uninitialized accesses result in an exception being thrown.")
55 val noassertions = BooleanSetting ("-Xdisable-assertions", "Generate no assertions and assumptions")
c452268c »
2010-03-23 Added some documentation to the methods in Pred...
56 val elidebelow = IntSetting ("-Xelide-below", "Generate calls to @elidable-marked methods only if method priority is greater than argument.",
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
57 elidable.ASSERTION, None, elidable.byName.get(_))
58 val noForwarders = BooleanSetting ("-Xno-forwarders", "Do not generate static forwarders in mirror classes")
59 val future = BooleanSetting ("-Xfuture", "Turn on future language features")
60 val genPhaseGraph = StringSetting ("-Xgenerate-phase-graph", "file", "Generate the phase graphs (outputs .dot files) to fileX.dot", "")
61 val XlogImplicits = BooleanSetting ("-Xlog-implicits", "Show more info on why some implicits are not applicable")
62 val Xmigration28 = BooleanSetting ("-Xmigration", "Warn about constructs whose behavior may have changed between 2.7 and 2.8")
63 val nouescape = BooleanSetting ("-Xno-uescape", "Disables handling of \\u unicode escapes")
64 val Xnojline = BooleanSetting ("-Xnojline", "Do not use JLine for editing")
65 val plugin = MultiStringSetting("-Xplugin", "file", "Load a plugin from a file")
66 val disable = MultiStringSetting("-Xplugin-disable", "plugin", "Disable a plugin")
67 val showPlugins = BooleanSetting ("-Xplugin-list", "Print a synopsis of loaded plugins")
68 val require = MultiStringSetting("-Xplugin-require", "plugin", "Abort unless a plugin is available")
69 val pluginsDir = StringSetting ("-Xpluginsdir", "path", "Path to search compiler plugins", Defaults.scalaPluginPath)
70 val Xprint = PhasesSetting ("-Xprint", "Print out program after")
71 val writeICode = BooleanSetting ("-Xprint-icode", "Log internal icode to *.icode files")
72 val Xprintpos = BooleanSetting ("-Xprint-pos", "Print tree positions (as offsets)")
73 val printtypes = BooleanSetting ("-Xprint-types", "Print tree types (debugging option)")
74 val prompt = BooleanSetting ("-Xprompt", "Display a prompt after each error (debugging option)")
75 val resident = BooleanSetting ("-Xresident", "Compiler stays resident, files to compile are read from standard input")
76 val script = StringSetting ("-Xscript", "object", "Compile as a script, wrapping the code into object.main()", "")
77 val Xshowcls = StringSetting ("-Xshow-class", "class", "Show class info", "")
78 val Xshowobj = StringSetting ("-Xshow-object", "object", "Show object info", "")
79 val showPhases = BooleanSetting ("-Xshow-phases", "Print a synopsis of compiler phases")
80 val sourceReader = StringSetting ("-Xsource-reader", "classname", "Specify a custom method for reading source files", "scala.tools.nsc.io.SourceReader")
ce223fe7 »
2010-09-16 closes #1569, #3731: refactored dependent metho...
81
4fb34731 »
2010-04-15 Removed a bunch of -Y warning options.
82 val Xwarnfatal = BooleanSetting ("-Xfatal-warnings", "Fail the compilation if there are any warnings.")
83 val Xwarninit = BooleanSetting ("-Xwarninit", "Warn about possible changes in initialization semantics")
84 val Xchecknull = BooleanSetting ("-Xcheck-null", "Emit warning on selection of nullable reference")
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
85
ce223fe7 »
2010-09-16 closes #1569, #3731: refactored dependent metho...
86 // Experimental Extensions
87 val Xexperimental = BooleanSetting ("-Xexperimental", "Enable experimental extensions") .
88 withPostSetHook(_ => List(YdepMethTpes, YmethodInfer) foreach (_.value = true)) //YvirtClasses,
89 val YdepMethTpes = BooleanSetting ("-Ydependent-method-types", "Allow dependent method types")
90 val YmethodInfer = BooleanSetting ("-Yinfer-argument-types", "Infer types for arguments of overriden methods")
91 val YvirtClasses = false // too embryonic to even expose as a -Y //BooleanSetting ("-Yvirtual-classes", "Support virtual classes")
92
217415af »
2010-03-08 More progress toward immutable Settings, and va...
93 /** Compatibility stubs for options whose value name did
94 * not previously match the option name.
95 */
96 def XO = optimise
97 def debuginfo = g
98 def dependenciesFile = dependencyfile
99 def nowarnings = nowarn
100 def outdir = d
101 def printLate = print
102
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
103 /**
104 * -Y "Private" settings
105 */
106 val Yhelp = BooleanSetting ("-Y", "Print a synopsis of private options")
107 val browse = PhasesSetting ("-Ybrowse", "Browse the abstract syntax tree after")
108 val check = PhasesSetting ("-Ycheck", "Check the tree at the end of")
109 val Xcloselim = BooleanSetting ("-Yclosure-elim", "Perform closure elimination")
110 val Ycompacttrees = BooleanSetting ("-Ycompact-trees", "Use compact tree printer when displaying trees")
111 val noCompletion = BooleanSetting ("-Yno-completion", "Disable tab-completion in the REPL")
112 val Xdce = BooleanSetting ("-Ydead-code", "Perform dead code elimination")
113 val debug = BooleanSetting ("-Ydebug", "Output debugging messages")
114 val Xdetach = BooleanSetting ("-Ydetach", "Perform detaching of remote closures")
115 // val doc = BooleanSetting ("-Ydoc", "Generate documentation")
116 val inline = BooleanSetting ("-Yinline", "Perform inlining when possible")
117 val Xlinearizer = ChoiceSetting ("-Ylinearizer", "Linearizer to use", List("normal", "dfs", "rpo", "dump"), "rpo") .
118 withHelpSyntax("-Ylinearizer:<which>")
119 val log = PhasesSetting ("-Ylog", "Log operations in")
217415af »
2010-03-08 More progress toward immutable Settings, and va...
120 val Ylogcp = BooleanSetting ("-Ylog-classpath", "Output information about what classpath is being applied.")
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
121 val Ynogenericsig = BooleanSetting ("-Yno-generic-signatures", "Suppress generation of generic signatures for Java")
122 val noimports = BooleanSetting ("-Yno-imports", "Compile without any implicit imports")
123 val nopredefs = BooleanSetting ("-Yno-predefs", "Compile without any implicit predefined values")
124 val Yrecursion = IntSetting ("-Yrecursion", "Recursion depth used when locking symbols", 0, Some(0, Int.MaxValue), (_: String) => None)
125 val selfInAnnots = BooleanSetting ("-Yself-in-annots", "Include a \"self\" identifier inside of annotations")
126 val Xshowtrees = BooleanSetting ("-Yshow-trees", "Show detailed trees when used in connection with -print:phase")
127 val skip = PhasesSetting ("-Yskip", "Skip")
128 val Xsqueeze = ChoiceSetting ("-Ysqueeze", "if on, creates compact code in matching", List("on","off"), "on") .
129 withHelpSyntax("-Ysqueeze:<enabled>")
130 val Ystatistics = BooleanSetting ("-Ystatistics", "Print compiler statistics")
131 val stop = PhasesSetting ("-Ystop", "Stop after phase")
132 val refinementMethodDispatch =
133 ChoiceSetting ("-Ystruct-dispatch", "Selects dispatch method for structural refinement method calls",
134 List("no-cache", "mono-cache", "poly-cache", "invoke-dynamic"), "poly-cache") .
135 withHelpSyntax("-Ystruct-dispatch:<method>")
136 val Yrangepos = BooleanSetting ("-Yrangepos", "Use range positions for syntax trees.")
137 val Yidedebug = BooleanSetting ("-Yide-debug", "Generate, validate and output trees using the interactive compiler.")
138 val Ybuilderdebug = ChoiceSetting ("-Ybuilder-debug", "Compile using the specified build manager", List("none", "refined", "simple"), "none") .
139 withHelpSyntax("-Ybuilder-debug:<method>")
140 val Ybuildmanagerdebug =
141 BooleanSetting ("-Ybuild-manager-debug", "Generate debug information for the Refined Build Manager compiler.")
142 val Ytyperdebug = BooleanSetting ("-Ytyper-debug", "Trace all type assignements")
143 val Ypmatdebug = BooleanSetting ("-Ypmat-debug", "Trace all pattern matcher activity.")
144 val Yrepldebug = BooleanSetting ("-Yrepl-debug", "Trace all repl activity.")
ce27db80 »
2010-04-25 Some overdue improvements in repl completion, w...
145 val Ycompletion = BooleanSetting ("-Ycompletion-debug", "Trace all tab completion activity.")
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
146 val Ypmatnaive = BooleanSetting ("-Ypmat-naive", "Desugar matches as naively as possible..")
dee314b7 »
2010-06-27 Removed unfinished Jenkins hashcode for final.
147 // val Yjenkins = BooleanSetting ("-Yjenkins-hashCodes", "Use jenkins hash algorithm for case class generated hashCodes.")
0c6cbdac »
2010-06-15 Disables NotNull checking unless -Ynotnull is g...
148 val Ynotnull = BooleanSetting ("-Ynotnull", "Enable the experimental and incomplete scala.NotNull")
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
149
150 // Warnings
4fb34731 »
2010-04-15 Removed a bunch of -Y warning options.
151 val Ywarndeadcode = BooleanSetting ("-Ywarn-dead-code", "Emit warnings for dead code")
152
5f9c20c2 »
2010-03-07 One minute too many trying to figure out where ...
153 /**
154 * "fsc-specific" settings.
155 */
156 val fscShutdown = BooleanSetting ("-shutdown", "Shutdown the fsc daemon")
157
158 /**
159 * -P "Plugin" settings
160 */
161 val pluginOptions = MultiStringSetting("-P", "plugin:opt", "Pass an option to a plugin") .
162 withHelpSyntax("-P:<plugin>:<opt>")
163 }
Something went wrong with that request. Please try again.