Skip to content

Commit 8f2d3df

Browse files
committed
Rename "frontend" phase to "typer"
That makes it the same as for scalac. Aligning terminology helps switching between the two codebases. Also, "frontend" is a bit off, since it is technically two phases, not one.
1 parent 9aa7991 commit 8f2d3df

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ object CompilerCommand {
2323
| - (partial) phase names with an optional "+" suffix to include the next phase
2424
| - the string "all"
2525
| example: -Xprint:all prints all phases.
26-
| example: -Xprint:front,mixin prints the frontend and mixin phases.
26+
| example: -Xprint:typer,mixin prints the typer and mixin phases.
2727
| example: -Ylog:erasure+ logs the erasure phase and the phase after the erasure phase.
2828
| This is useful because during the tree transform of phase X, we often
2929
| already are in phase X + 1.

compiler/src/dotty/tools/dotc/typer/FrontEnd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ class FrontEnd extends Phase {
136136
}
137137

138138
object FrontEnd {
139-
val name: String = "frontend"
139+
val name: String = "typer"
140140
}

compiler/test/dotc/comptest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ object comptest extends ParallelTesting {
2525
dotcDir + "tools/dotc/core/Types.scala",
2626
dotcDir + "tools/dotc/ast/Trees.scala"
2727
),
28-
TestFlags("", Array("-Ylog:frontend", "-Xprompt"))
28+
TestFlags("", Array("-Ylog:typer", "-Xprompt"))
2929
)(TestGroup("comptest"))
3030
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import org.junit.Test
1919

2020
class PrintingTest {
2121
val testsDir = "tests/printing"
22-
val options = List("-Xprint:frontend", "-color:never", "-classpath", TestConfiguration.basicClasspath)
22+
val options = List("-Xprint:typer", "-color:never", "-classpath", TestConfiguration.basicClasspath)
2323

2424
private def fileContent(filePath: String): List[String] =
2525
if (new File(filePath).exists)

docs/docs/contributing/debugging.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ assertPositioned(tree.reporting(s"Tree is: $result"))
9191
`def (a: A) reporting(f: given WrappedResult[T] => String, p: Printer = Printers.default): A` is defined on all types. The function `f` can be written without the argument since the argument is `given`. The `result` variable is a part of the `WrapperResult` – a tiny framework powering the `reporting` function. Basically, whenever you are using `reporting` on an object `A`, you can use the `result: A` variable from this function and it will be equal to the object you are calling `reporting` on.
9292

9393
## Printing out trees after phases
94-
To print out the trees you are compiling after Frontend (scanner, parser, namer, typer) phase:
94+
To print out the trees you are compiling after the FrontEnd (scanner, parser, namer, typer) phases:
9595

9696
```shell
97-
dotc -Xprint:frontend ../issues/Playground.scala
97+
dotc -Xprint:typer ../issues/Playground.scala
9898
```
9999

100100
To print out the trees after Frontend and CollectSuperCalls phases:
101101

102102
```shell
103-
dotc -Xprint:frontend,collectSuperCalls ../issues/Playground.scala
103+
dotc -Xprint:typer,collectSuperCalls ../issues/Playground.scala
104104
```
105105

106106
To print out the trees after all phases:
@@ -176,7 +176,7 @@ And is to be used as:
176176
dotc -Yprint-pos ../issues/Playground.scala
177177
```
178178

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

181181
```scala
182182
package <empty>@<Playground.scala:1> {
@@ -204,7 +204,7 @@ package <empty>@<Playground.scala:1> {
204204
Every [Positioned](https://github.com/lampepfl/dotty/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.:
205205

206206
```shell
207-
dotc -Xprint:frontend -Yshow-tree-ids ../issues/Playground.scala
207+
dotc -Xprint:typer -Yshow-tree-ids ../issues/Playground.scala
208208
```
209209

210210
Gives:
@@ -363,4 +363,4 @@ trace.force(i"typing $tree", typr, show = true) { // ...
363363
```
364364

365365
### Reporter
366-
Defined in [Reporter.scala](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/reporting/Reporter.scala). Enables calls such as `ctx.log`, `ctx.error` etc. To enable, run dotc with `-Ylog:frontend` option.
366+
Defined in [Reporter.scala](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/reporting/Reporter.scala). Enables calls such as `ctx.log`, `ctx.error` etc. To enable, run dotc with `-Ylog:typer` option.

tests/pos-special/typeclass-scaling.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.annotation.tailrec
33

44
// The following command:
55
//
6-
// sc typeclass-scaling.scala -Xmax-inlines 100 -Xprint:front -color:never -pagewidth 1000 >& x
6+
// sc typeclass-scaling.scala -Xmax-inlines 100 -Xprint:typer -color:never -pagewidth 1000 >& x
77
//
88
// produces an output file with `wc` measures (lines/words/chars):
99
//

tests/pos/implicits2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Compile with
22
3-
dotc implicits2.scala -Xprint:front -Xprint-types -verbose
3+
dotc implicits2.scala -Xprint:typer -Xprint-types -verbose
44
55
and verify that the inserted wrapString comes from Predef. You should see
66

tests/pos/printbounds.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Test {
55

66
val x: Tree[_] = ???
77

8-
val y = x // With -Xprint:front this should print val x: Tree[_] = x
8+
val y = x // With -Xprint:typer this should print val x: Tree[_] = x
99
// used to print Tree[Nothing], which is confusing.
1010

1111
}

0 commit comments

Comments
 (0)