Skip to content

Commit 22fbed0

Browse files
committed
Update plugin phases to remove LinkAll
1 parent 5d99e37 commit 22fbed0

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ReifyQuotes extends MacroTransformWithImplicits {
7272
myMacroClassLoader
7373
}
7474

75-
override def phaseName: String = "reifyQuotes"
75+
override def phaseName: String = ReifyQuotes.name
7676

7777
override def checkPostCondition(tree: Tree)(implicit ctx: Context): Unit = {
7878
tree match {
@@ -607,6 +607,8 @@ class ReifyQuotes extends MacroTransformWithImplicits {
607607
}
608608

609609
object ReifyQuotes {
610+
val name = "reifyQuotes"
611+
610612
def toValue(tree: Tree): Option[Any] = tree match {
611613
case Literal(Constant(c)) => Some(c)
612614
case Block(Nil, e) => toValue(e)

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.{LinkAll, Pickler}
63+
import dotty.tools.dotc.transform.{Pickler, ReifyQuotes}
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(LinkAll.name)
78+
override val runsBefore = Set(ReifyQuotes.name)
7979

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

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.{LinkAll, Pickler}
13+
import transform.{Pickler, ReifyQuotes}
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(LinkAll.name)
23+
override val runsBefore = Set(ReifyQuotes.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.{LinkAll, Pickler}
11+
import transform.{Pickler, ReifyQuotes}
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(LinkAll.name)
21+
override val runsBefore = Set(ReifyQuotes.name)
2222

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

0 commit comments

Comments
 (0)