Skip to content

Commit 46a8de4

Browse files
SethTisuetgodzik
authored andcommitted
standardize on -Vprint:... (still support -Xprint:... as alias)
1 parent dd08f12 commit 46a8de4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+59
-59
lines changed

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
338338
profiler.onPhase(phase):
339339
try units = phase.runOn(units)
340340
catch case _: InterruptedException => cancelInterrupted()
341-
if (ctx.settings.Xprint.value.containsPhase(phase))
341+
if (ctx.settings.Vprint.value.containsPhase(phase))
342342
for (unit <- units)
343343
lastPrintedTree =
344344
printTree(lastPrintedTree)(using ctx.fresh.setPhase(phase.next).setCompilationUnit(unit))

compiler/src/dotty/tools/dotc/config/CliCommand.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ trait CliCommand:
3333
|<phases> means one or a comma-separated list of:
3434
| - (partial) phase names with an optional "+" suffix to include the next phase
3535
| - the string "all"
36-
| example: -Xprint:all prints all phases.
37-
| example: -Xprint:typer,mixin prints the typer and mixin phases.
36+
| example: -Vprint:all prints all phases.
37+
| example: -Vprint:typer,mixin prints the typer and mixin phases.
3838
| example: -Ylog:erasure+ logs the erasure phase and the phase after the erasure phase.
3939
| This is useful because during the tree transform of phase X, we often
4040
| already are in phase X + 1.

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private sealed trait PluginSettings:
154154
private sealed trait VerboseSettings:
155155
self: SettingGroup =>
156156
val Vhelp: Setting[Boolean] = BooleanSetting("-V", "Print a synopsis of verbose options.")
157-
val Xprint: Setting[List[String]] = PhasesSetting("-Vprint", "Print out program after", aliases = List("-Xprint"))
157+
val Vprint: Setting[List[String]] = PhasesSetting("-Vprint", "Print out program after", aliases = List("-Xprint"))
158158
val XshowPhases: Setting[Boolean] = BooleanSetting("-Vphases", "List compiler phases.", aliases = List("-Xshow-phases"))
159159

160160
val Vprofile: Setting[Boolean] = BooleanSetting("-Vprofile", "Show metrics about sources and internal representations to estimate compile-time complexity.")

compiler/src/dotty/tools/dotc/core/Phases.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ object Phases {
300300
* instance, it is possible to print trees after a given phase using:
301301
*
302302
* ```bash
303-
* $ ./bin/scalac -Xprint:<phaseNameHere> sourceFile.scala
303+
* $ ./bin/scalac -Vprint:<phaseNameHere> sourceFile.scala
304304
* ```
305305
*/
306306
def phaseName: String

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ abstract class Recheck extends Phase, SymTransformer:
149149
* can be retrieved with `knownType`
150150
*/
151151
private val keepAllTypes = inContext(ictx) {
152-
ictx.settings.Xprint.value.containsPhase(thisPhase)
152+
ictx.settings.Vprint.value.containsPhase(thisPhase)
153153
}
154154

155155
/** Should type of `tree` be kept in an attachment so that it can be retrieved with

compiler/test/dotty/tools/dotc/printing/PrintingTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PrintingTest {
2727
def options(phase: String, flags: List[String]) =
2828
val outDir = ParallelTesting.defaultOutputDir + "printing" + File.pathSeparator
2929
File(outDir).mkdirs()
30-
List(s"-Xprint:$phase", "-color:never", "-nowarn", "-d", outDir, "-classpath", TestConfiguration.basicClasspath) ::: flags
30+
List(s"-Vprint:$phase", "-color:never", "-nowarn", "-d", outDir, "-classpath", TestConfiguration.basicClasspath) ::: flags
3131

3232
private def compileFile(path: JPath, phase: String): Boolean = {
3333
val baseFilePath = path.toString.stripSuffix(".scala")

compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class SemanticdbTests:
138138
"-feature",
139139
"-deprecation",
140140
// "-Ydebug-flags",
141-
// "-Xprint:extractSemanticDB",
141+
// "-Vprint:extractSemanticDB",
142142
"-sourceroot", expectSrc.toString,
143143
"-classpath", target.toString,
144144
"-Xignore-scala2-macros",

compiler/test/dotty/tools/repl/ReplCompilerTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ object ReplCompilerTests:
422422

423423
end ReplCompilerTests
424424

425-
class ReplXPrintTyperTests extends ReplTest(ReplTest.defaultOptions :+ "-Xprint:typer"):
425+
class ReplXPrintTyperTests extends ReplTest(ReplTest.defaultOptions :+ "-Vprint:typer"):
426426
@Test def i9111 = initially {
427427
run("""|enum E {
428428
| case A

docs/_docs/contributing/debugging/ide-debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ And concatenate the output into the classpath argument, which should already con
140140

141141
In the `args` you can add any additional compiler option you want.
142142

143-
For instance you can add `-Xprint:all` to print all the generated trees after each mega phase.
143+
For instance you can add `-Vprint:all` to print all the generated trees after each mega phase.
144144

145145
Run `scalac -help` to get an overview of the available compiler options.
146146

docs/_docs/contributing/debugging/inspection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ Sometimes you may want to stop the compiler after a certain phase, for example t
6161
knock-on errors from occurring from a bug in an earlier phase. Use the flag
6262
`-Ystop-after:<phase-name>` to prevent any phases executing afterwards.
6363

64-
> e.g. `-Xprint:<phase>` where `phase` is a miniphase, will print after
64+
> e.g. `-Vprint:<phase>` where `phase` is a miniphase, will print after
6565
> the whole phase group is complete, which may be several miniphases after `phase`.
66-
> Instead you can use `-Ystop-after:<phase> -Xprint:<phase>` to stop
66+
> Instead you can use `-Ystop-after:<phase> -Vprint:<phase>` to stop
6767
> immediately after the miniphase and see the trees that you intended.
6868
6969
## Printing TASTy of a Class

0 commit comments

Comments
 (0)