@@ -3,25 +3,24 @@ package dotty.tools.dotc.transform
3
3
import dotty .tools .dotc .CompilationUnit
4
4
import dotty .tools .dotc .ast .Trees ._
5
5
import dotty .tools .dotc .ast .tpd
6
+ import dotty .tools .dotc .core .Phases .Phase
6
7
import dotty .tools .dotc .core .Contexts ._
7
8
import dotty .tools .dotc .core .SymDenotations .ClassDenotation
8
9
import dotty .tools .dotc .core .Symbols ._
9
10
import dotty .tools .dotc .core .Flags ._
10
- import dotty .tools .dotc .transform .TreeTransforms ._
11
11
12
12
/** Loads all potentially reachable trees from tasty. ▲
13
13
* Only performed on whole world optimization mode. ▲ ▲
14
14
*
15
15
* TODO: Next step is to only load compilation units reachable in the call graph
16
16
*/
17
- class LinkAll extends MiniPhaseTransform {
17
+ class LinkAll extends Phase {
18
18
import tpd ._
19
19
import LinkAll ._
20
20
21
- override def phaseName = " linkAll"
21
+ def phaseName : String = " linkAll"
22
22
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 = ()
25
24
26
25
override def runOn (units : List [CompilationUnit ])(implicit ctx : Context ): List [CompilationUnit ] = {
27
26
/** Loads and processes new compilation units, possibly loading more units. */
@@ -35,8 +34,8 @@ class LinkAll extends MiniPhaseTransform {
35
34
}
36
35
}
37
36
38
- if (ctx.settings.XlinkOptimise .value) super .runOn( allUnits(Set .empty, units.toSet, Set .empty) )
39
- else super .runOn( units)
37
+ if (ctx.settings.XlinkOptimise .value) allUnits(Set .empty, units.toSet, Set .empty)
38
+ else units
40
39
}
41
40
42
41
/** Collects all class denotations that may need to be loaded. */
0 commit comments