Skip to content

Commit f6ac9cd

Browse files
committed
standardize on -Vprint:... (still support -Xprint:... as alias)
1 parent 8fe16fe commit f6ac9cd

Some content is hidden

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

46 files changed

+62
-62
lines changed

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
@@ -145,7 +145,7 @@ private sealed trait PluginSettings:
145145
private sealed trait VerboseSettings:
146146
self: SettingGroup =>
147147
val Vhelp: Setting[Boolean] = BooleanSetting(VerboseSetting, "V", "Print a synopsis of verbose options.")
148-
val Xprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Vprint", "Print out program after", aliases = List("-Xprint"))
148+
val Vprint: Setting[List[String]] = PhasesSetting(VerboseSetting, "Xprint", "Print out program after", aliases = List("-Vprint"))
149149
val XshowPhases: Setting[Boolean] = BooleanSetting(VerboseSetting, "Vphases", "List compiler phases.", aliases = List("-Xshow-phases"))
150150

151151
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ abstract class Recheck extends Phase, SymTransformer:
184184

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

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
@@ -523,7 +523,7 @@ object ReplCompilerTests:
523523

524524
end ReplCompilerTests
525525

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

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ assertPositioned(tree.reporting(s"Tree is: $result"))
7272
To print out the trees you are compiling after the FrontEnd (scanner, parser, namer, typer) phases:
7373

7474
```shell
75-
scalac -Xprint:typer ../issues/Playground.scala
75+
scalac -Vprint:typer ../issues/Playground.scala
7676
```
7777

7878
To print out the trees after Frontend and CollectSuperCalls phases:
7979

8080
```shell
81-
scalac -Xprint:typer,collectSuperCalls ../issues/Playground.scala
81+
scalac -Vprint:typer,collectSuperCalls ../issues/Playground.scala
8282
```
8383

8484
To print out the trees after all phases:
8585

8686
```shell
87-
scalac -Xprint:all ../issues/Playground.scala
87+
scalac -Vprint:all ../issues/Playground.scala
8888
```
8989

9090
To find out the list of all the phases and their names, check out [this](https://github.com/scala/scala3/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/Compiler.scala#L34) line in `Compiler.scala`. Each `Phase` object has `phaseName` defined on it, this is the phase name.
@@ -154,7 +154,7 @@ And is to be used as:
154154
scalac -Yprint-pos ../issues/Playground.scala
155155
```
156156

157-
If used, all the trees output with `show` or via `-Xprint:typer` will also have positions attached to them, e.g.:
157+
If used, all the trees output with `show` or via `-Vprint:typer` will also have positions attached to them, e.g.:
158158

159159
```scala
160160
package <empty>@<Playground.scala:1> {
@@ -182,7 +182,7 @@ package <empty>@<Playground.scala:1> {
182182
Every [Positioned](https://github.com/scala/scala3/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/ast/Positioned.scala) (a parent class of `Tree`) object has a `uniqueId` field. It is an integer that is unique for that tree and doesn't change from compile run to compile run. You can output these IDs from any printer (such as the ones used by `.show` and `-Xprint`) via `-Yshow-tree-ids` flag, e.g.:
183183

184184
```shell
185-
scalac -Xprint:typer -Yshow-tree-ids ../issues/Playground.scala
185+
scalac -Vprint:typer -Yshow-tree-ids ../issues/Playground.scala
186186
```
187187

188188
Gives:

0 commit comments

Comments
 (0)