Skip to content

Commit 878881a

Browse files
committed
Adapt to recent changes in transformers and phases
1 parent c113fa5 commit 878881a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
package dotty.tools.dotc
22
package transform
33

4-
import TreeTransforms.{ MiniPhaseTransform, TransformerInfo }
54
import ast.Trees._, ast.tpd, core._
65
import Contexts.Context, Types._, Decorators._, Symbols._, DenotTransformers._
76
import SymDenotations._, Scopes._, StdNames._, NameOps._, Names._
7+
import MegaPhase.MiniPhase
88

99
import scala.collection.mutable
1010

1111
/** Specializes classes that inherit from `FunctionN` where there exists a
1212
* specialized form.
1313
*/
14-
class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
14+
class SpecializeFunctions extends MiniPhase with InfoTransformer {
1515
import ast.tpd._
1616
val phaseName = "specializeFunctions"
1717
override def runsAfter = Set(classOf[ElimByName])
1818

1919
/** Transforms the type to include decls for specialized applys */
20-
def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context) = tp match {
20+
override def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context) = tp match {
2121
case tp: ClassInfo if !sym.is(Flags.Package) && (tp.decls ne EmptyScope) =>
2222
var newApplys = Map.empty[Name, Symbol]
2323

@@ -59,7 +59,7 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
5959
* generic applys to the specialized ones. Also inserts the specialized applys
6060
* in the template body.
6161
*/
62-
override def transformTemplate(tree: Template)(implicit ctx: Context, info: TransformerInfo) = {
62+
override def transformTemplate(tree: Template)(implicit ctx: Context) = {
6363
val applyBuf = new mutable.ListBuffer[Tree]
6464
val newBody = tree.body.mapConserve {
6565
case dt: DefDef if dt.name == nme.apply && dt.vparamss.length == 1 =>
@@ -97,7 +97,7 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
9797
}
9898

9999
/** Dispatch to specialized `apply`s in user code when available */
100-
override def transformApply(tree: Apply)(implicit ctx: Context, info: TransformerInfo) =
100+
override def transformApply(tree: Apply)(implicit ctx: Context) =
101101
tree match {
102102
case Apply(fun, args)
103103
if fun.symbol.name == nme.apply &&

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package dotty.tools.dotc
22
package transform
33

4-
import TreeTransforms.{ MiniPhaseTransform, TransformerInfo }
54
import ast.Trees._, ast.tpd, core._
65
import Contexts.Context, Types._, Decorators._, Symbols._, DenotTransformers._
76
import SymDenotations._, Scopes._, StdNames._, NameOps._, Names._
7+
import MegaPhase.MiniPhase
88

99
/** This phase synthesizes specialized methods for FunctionN, this is done
1010
* since there are no scala signatures in the bytecode for the specialized
@@ -14,7 +14,7 @@ import SymDenotations._, Scopes._, StdNames._, NameOps._, Names._
1414
* can hardcode them. This should, however be removed once we're using a
1515
* different standard library.
1616
*/
17-
class SpecializedApplyMethods extends MiniPhaseTransform with InfoTransformer {
17+
class SpecializedApplyMethods extends MiniPhase with InfoTransformer {
1818
import ast.tpd._
1919

2020
val phaseName = "specializedApplyMethods"
@@ -53,7 +53,7 @@ class SpecializedApplyMethods extends MiniPhaseTransform with InfoTransformer {
5353
}
5454

5555
/** Add symbols for specialized methods to FunctionN */
56-
def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context) = tp match {
56+
override def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context) = tp match {
5757
case tp: ClassInfo if defn.isPlainFunctionClass(sym) => {
5858
init()
5959
val newDecls = sym.name.functionArity match {
@@ -75,7 +75,7 @@ class SpecializedApplyMethods extends MiniPhaseTransform with InfoTransformer {
7575
}
7676

7777
/** Create bridge methods for FunctionN with specialized applys */
78-
override def transformTemplate(tree: Template)(implicit ctx: Context, info: TransformerInfo) = {
78+
override def transformTemplate(tree: Template)(implicit ctx: Context) = {
7979
val owner = tree.symbol.owner
8080
val additionalSymbols =
8181
if (owner eq func0) func0Applys

0 commit comments

Comments
 (0)