Skip to content

Commit 8f5a4d1

Browse files
committed
Rename ReifyQuotes to Staging
1 parent 8cf1385 commit 8f5a4d1

File tree

10 files changed

+19
-20
lines changed

10 files changed

+19
-20
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CompilationUnit(val source: SourceFile) {
2626
var pickled: Map[ClassSymbol, Array[Byte]] = Map()
2727

2828
/** Will be reset to `true` if contains `Quote`, `Splice` or calls to inline methods.
29-
* The information is used in phase ReifyQuotes in order to avoid traversing a quote-less tree.
29+
* The information is used in phase `Staging` in order to avoid traversing a quote-less tree.
3030
*/
3131
var containsQuotesSplicesOrInline: Boolean = false
3232

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Compiler {
4444
/** Phases dealing with TASTY tree pickling and unpickling */
4545
protected def picklerPhases: List[List[Phase]] =
4646
List(new Pickler) :: // Generate TASTY info
47-
List(new ReifyQuotes) :: // Turn quoted trees into explicit run-time data structures
47+
List(new Staging) :: // Inline calls, expand macros and turn quoted trees into explicit run-time data structures
4848
Nil
4949

5050
/** Phases dealing with the transformation from pickled trees to backend trees */

compiler/src/dotty/tools/dotc/decompiler/TASTYDecompiler.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package dotty.tools.dotc.decompiler
22

33
import dotty.tools.dotc.fromtasty._
44
import dotty.tools.dotc.core.Phases.Phase
5-
import dotty.tools.dotc.transform.ReifyQuotes
65

76
/** Compiler from tasty to user readable high text representation
87
* of the compiled scala code.

compiler/src/dotty/tools/dotc/quoted/QuoteCompiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import dotty.tools.dotc.core.StdNames.nme
1313
import dotty.tools.dotc.core.Symbols.defn
1414
import dotty.tools.dotc.core.Types.ExprType
1515
import dotty.tools.dotc.core.quoted.PickledQuotes
16-
import dotty.tools.dotc.transform.ReifyQuotes
16+
import dotty.tools.dotc.transform.Staging
1717
import dotty.tools.dotc.typer.FrontEnd
1818
import dotty.tools.dotc.util.Positions.Position
1919
import dotty.tools.dotc.util.SourceFile
@@ -30,7 +30,7 @@ class QuoteCompiler extends Compiler {
3030
List(List(new QuotedFrontend(putInClass = true)))
3131

3232
override protected def picklerPhases: List[List[Phase]] =
33-
List(List(new ReifyQuotes))
33+
List(List(new Staging))
3434

3535
override def newRun(implicit ctx: Context): ExprRun = {
3636
reset()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object Splicer {
3333
* and for `~xyz` the tree of `xyz` is interpreted for which the
3434
* resulting expression is returned as a `Tree`
3535
*
36-
* See: `ReifyQuotes`
36+
* See: `Staging`
3737
*/
3838
def splice(tree: Tree, pos: SourcePosition, classLoader: ClassLoader)(implicit ctx: Context): Tree = tree match {
3939
case Quoted(quotedTree) => quotedTree
@@ -63,7 +63,7 @@ object Splicer {
6363
* and for `~xyz` the tree of `xyz` is interpreted for which the
6464
* resulting expression is returned as a `Tree`
6565
*
66-
* See: `ReifyQuotes`
66+
* See: `Staging`
6767
*/
6868
def canBeSpliced(tree: Tree)(implicit ctx: Context): Boolean = tree match {
6969
case Quoted(_) => true

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala renamed to compiler/src/dotty/tools/dotc/transform/Staging.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ import dotty.tools.dotc.util.SourcePosition
6565
* For macro definitions we assume that we have a single ~ directly as the RHS.
6666
* The Splicer is used to check that the RHS will be interpretable (with the `Splicer`) once inlined.
6767
*/
68-
class ReifyQuotes extends MacroTransformWithImplicits {
68+
class Staging extends MacroTransformWithImplicits {
6969
import tpd._
70-
import ReifyQuotes._
70+
import Staging._
7171

7272
/** Classloader used for loading macros */
7373
private[this] var myMacroClassLoader: java.lang.ClassLoader = _
@@ -79,7 +79,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
7979
myMacroClassLoader
8080
}
8181

82-
override def phaseName: String = ReifyQuotes.name
82+
override def phaseName: String = Staging.name
8383

8484
override def checkPostCondition(tree: Tree)(implicit ctx: Context): Unit = {
8585
tree match {
@@ -420,7 +420,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
420420
else if (body.symbol == defn.DoubleClass) tag("DoubleTag")
421421
else pickleAsTasty()
422422
}
423-
else ReifyQuotes.toValue(body) match {
423+
else Staging.toValue(body) match {
424424
case Some(value) => pickleAsValue(value)
425425
case _ => pickleAsTasty()
426426
}
@@ -644,10 +644,10 @@ class ReifyQuotes extends MacroTransformWithImplicits {
644644
}
645645
}
646646

647-
object ReifyQuotes {
647+
object Staging {
648648
import tpd._
649649

650-
val name: String = "reifyQuotes"
650+
val name: String = "staging"
651651

652652
def toValue(tree: tpd.Tree): Option[Any] = tree match {
653653
case Literal(Constant(c)) => Some(c)

docs/docs/reference/changed/compiler-plugins.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import dotty.tools.dotc.core.Decorators._
6060
import dotty.tools.dotc.core.StdNames._
6161
import dotty.tools.dotc.core.Symbols._
6262
import dotty.tools.dotc.plugins.{PluginPhase, StandardPlugin}
63-
import dotty.tools.dotc.transform.{Pickler, ReifyQuotes}
63+
import dotty.tools.dotc.transform.{Pickler, Staging}
6464

6565
class DivideZero extends StandardPlugin {
6666
val name: String = "divideZero"
@@ -75,7 +75,7 @@ class DivideZeroPhase extends PluginPhase {
7575
val phaseName = "divideZero"
7676

7777
override val runsAfter = Set(Pickler.name)
78-
override val runsBefore = Set(ReifyQuotes.name)
78+
override val runsBefore = Set(Staging.name)
7979

8080
override def transformApply(tree: Apply)(implicit ctx: Context): Tree = {
8181
tree match {

docs/docs/reference/principled-meta-programming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ literals. So it could be done only if symbol literals were abolished.
627627

628628
Quotes and splices are primitive forms in the generated abstract
629629
syntax trees. They are eliminated in an expansion phase
630-
`ReifyQuotes`. This phase runs after typing and pickling.
630+
`Staging`. This phase runs after typing and pickling.
631631

632632
Macro-expansion works outside-in. If the outermost scope is a splice,
633633
the spliced AST will be evaluated in an interpreter. A call to a

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/plugin/DivideZero.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import transform.MegaPhase.MiniPhase
1010
import Decorators._
1111
import Symbols.Symbol
1212
import Constants.Constant
13-
import transform.{Pickler, ReifyQuotes}
13+
import transform.{Pickler, Staging}
1414

1515
/** Compiler plugin that emits an error when compiling a division by zero */
1616
class DivideZero extends PluginPhase with StandardPlugin {
@@ -20,7 +20,7 @@ class DivideZero extends PluginPhase with StandardPlugin {
2020
val phaseName = name
2121

2222
override val runsAfter = Set(Pickler.name)
23-
override val runsBefore = Set(ReifyQuotes.name)
23+
override val runsBefore = Set(Staging.name)
2424

2525
def init(options: List[String]): List[PluginPhase] = this :: Nil
2626

tests/plugins/neg/divideZero/plugin_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import transform.MegaPhase.MiniPhase
88
import Decorators._
99
import Symbols.Symbol
1010
import Constants.Constant
11-
import transform.{Pickler, ReifyQuotes}
11+
import transform.{Pickler, Staging}
1212
import StdNames._
1313

1414
class DivideZero extends PluginPhase with StandardPlugin {
@@ -18,7 +18,7 @@ class DivideZero extends PluginPhase with StandardPlugin {
1818
val phaseName = name
1919

2020
override val runsAfter = Set(Pickler.name)
21-
override val runsBefore = Set(ReifyQuotes.name)
21+
override val runsBefore = Set(Staging.name)
2222

2323
override def init(options: List[String]): List[PluginPhase] = this :: Nil
2424

0 commit comments

Comments
 (0)