Skip to content

Commit a83ea81

Browse files
Merge pull request #3219 from dotty-staging/make-link-all-a-phase
Make LinkAll a proper phase
2 parents be01457 + b4425d1 commit a83ea81

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,24 @@ package dotty.tools.dotc.transform
33
import dotty.tools.dotc.CompilationUnit
44
import dotty.tools.dotc.ast.Trees._
55
import dotty.tools.dotc.ast.tpd
6+
import dotty.tools.dotc.core.Phases.Phase
67
import dotty.tools.dotc.core.Contexts._
78
import dotty.tools.dotc.core.SymDenotations.ClassDenotation
89
import dotty.tools.dotc.core.Symbols._
910
import dotty.tools.dotc.core.Flags._
10-
import dotty.tools.dotc.transform.TreeTransforms._
1111

1212
/** Loads all potentially reachable trees from tasty. ▲
1313
* Only performed on whole world optimization mode. ▲ ▲
1414
*
1515
* TODO: Next step is to only load compilation units reachable in the call graph
1616
*/
17-
class LinkAll extends MiniPhaseTransform {
17+
class LinkAll extends Phase {
1818
import tpd._
1919
import LinkAll._
2020

21-
override def phaseName = "linkAll"
21+
def phaseName: String = "linkAll"
2222

23-
/** Do not transform the any tree, runOn will traverse the trees and reload compilation units if needed */
24-
override def prepareForUnit(tree: tpd.Tree)(implicit ctx: Context): TreeTransform = NoTransform
23+
def run(implicit ctx: Context): Unit = ()
2524

2625
override def runOn(units: List[CompilationUnit])(implicit ctx: Context): List[CompilationUnit] = {
2726
/** Loads and processes new compilation units, possibly loading more units. */
@@ -35,7 +34,7 @@ class LinkAll extends MiniPhaseTransform {
3534
}
3635
}
3736

38-
if (ctx.settings.XlinkOptimise.value) super.runOn(allUnits(Set.empty, units.toSet, Set.empty))
37+
if (ctx.settings.XlinkOptimise.value) allUnits(Set.empty, units.toSet, Set.empty)
3938
else units
4039
}
4140

0 commit comments

Comments
 (0)