Skip to content

Commit 60fa07a

Browse files
SethTisuesom-snytt
authored andcommitted
standardize on -Vprint:... (still support -Xprint:... as alias)
1 parent 0a4b6ec commit 60fa07a

Some content is hidden

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

47 files changed

+64
-64
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
367367
profiler.onPhase(phase):
368368
try units = phase.runOn(units)
369369
catch case _: InterruptedException => cancelInterrupted()
370-
if (ctx.settings.Xprint.value.containsPhase(phase))
370+
if (ctx.settings.Vprint.value.containsPhase(phase))
371371
for (unit <- units)
372372
def printCtx(unit: CompilationUnit) = phase.printingContext(
373373
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
@@ -31,8 +31,8 @@ trait CliCommand:
3131
|<phases> means one or a comma-separated list of:
3232
| - (partial) phase names with an optional "+" suffix to include the next phase
3333
| - the string "all"
34-
| example: -Xprint:all prints all phases.
35-
| example: -Xprint:typer,mixin prints the typer and mixin phases.
34+
| example: -Vprint:all prints all phases.
35+
| example: -Vprint:typer,mixin prints the typer and mixin phases.
3636
| example: -Ylog:erasure+ logs the erasure phase and the phase after the erasure phase.
3737
| This is useful because during the tree transform of phase X, we often
3838
| 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
@@ -144,7 +144,7 @@ private sealed trait PluginSettings:
144144
private sealed trait VerboseSettings:
145145
self: SettingGroup =>
146146
val Vhelp: Setting[Boolean] = BooleanSetting(VerboseSetting, "V", "Print a synopsis of verbose options.")
147-
val Xprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Vprint", "Print out program after", aliases = List("-Xprint"))
147+
val Vprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Vprint", "Print out program after", aliases = List("-Xprint"))
148148
val XshowPhases: Setting[Boolean] = BooleanSetting(VerboseSetting, "Vphases", "List compiler phases.", aliases = List("-Xshow-phases"))
149149

150150
val Vprofile: Setting[Boolean] = BooleanSetting(VerboseSetting, "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
@@ -314,7 +314,7 @@ object Phases {
314314
* instance, it is possible to print trees after a given phase using:
315315
*
316316
* ```bash
317-
* $ ./bin/scalac -Xprint:<phaseNameHere> sourceFile.scala
317+
* $ ./bin/scalac -Vprint:<phaseNameHere> sourceFile.scala
318318
* ```
319319
*/
320320
def phaseName: String

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ abstract class Recheck extends Phase, SymTransformer:
183183

184184
/** If true, remember the new types of nodes in this compilation unit
185185
* as an attachment in the unit's tpdTree node. By default, this is
186-
* enabled when -Xprint:cc is set. Can be overridden.
186+
* enabled when -Vprint:cc is set. Can be overridden.
187187
*/
188188
def keepNuTypes(using Context): Boolean =
189-
ctx.settings.Xprint.value.containsPhase(thisPhase)
189+
ctx.settings.Vprint.value.containsPhase(thisPhase)
190190

191191
def resetNuTypes()(using Context): Unit =
192192
nuTypes.clear(resetToInitial = false)

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
@@ -533,7 +533,7 @@ object ReplCompilerTests:
533533

534534
end ReplCompilerTests
535535

536-
class ReplXPrintTyperTests extends ReplTest(ReplTest.defaultOptions :+ "-Xprint:typer"):
536+
class ReplXPrintTyperTests extends ReplTest(ReplTest.defaultOptions :+ "-Vprint:typer"):
537537
@Test def i9111 = initially {
538538
run("""|enum E {
539539
| 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)