@@ -7,16 +7,16 @@ import Periods._
77import Symbols ._
88import Types ._
99import Scopes ._
10- import typer .{FrontEnd , Typer , ImportInfo , RefChecks }
11- import reporting .{Reporter , ConsoleReporter }
10+ import typer .{FrontEnd , ImportInfo , RefChecks , Typer }
11+ import reporting .{ConsoleReporter , Reporter }
1212import Phases .Phase
1313import transform ._
1414import util .FreshNameCreator
1515import transform .TreeTransforms .{TreeTransform , TreeTransformer }
1616import core .DenotTransformers .DenotTransformer
1717import core .Denotations .SingleDenotation
18-
19- import dotty .tools .backend . jvm .{ LabelDefs , GenBCode , CollectSuperCalls }
18+ import dotty . tools . backend . jvm .{ CollectSuperCalls , GenBCode , LabelDefs }
19+ import dotty .tools .dotc . transform . linker . Simplify
2020
2121/** The central class of the dotc compiler. The job of a compiler is to create
2222 * runs, which process given `phases` in a given `rootContext`.
@@ -60,6 +60,9 @@ class Compiler {
6060 new HoistSuperArgs , // Hoist complex arguments of supercalls to enclosing scope
6161 new ClassOf ), // Expand `Predef.classOf` calls.
6262 List (new TryCatchPatterns , // Compile cases in try/catch
63+ new PatternConstantsFactorization , // extract common constant matches from patterns
64+ new PatternTypeFactorization , // extract common type matches from patterns
65+
6366 new PatternMatcher , // Compile pattern matches
6467 new ExplicitOuter , // Add accessors to outer classes from nested ones.
6568 new ExplicitSelf , // Make references to non-trivial self types explicit as casts
@@ -74,6 +77,7 @@ class Compiler {
7477 new ElimByName , // Expand by-name parameter references
7578 new AugmentScala2Traits , // Expand traits defined in Scala 2.11 to simulate old-style rewritings
7679 new ResolveSuper , // Implement super accessors and add forwarders to trait methods
80+ new Simplify , // Perform local optimizations, simplified versions of what linker does.
7781 new PrimitiveForwarders , // Add forwarders to trait methods that have a mismatch between generic and primitives
7882 new ArrayConstructors ), // Intercept creation of (non-generic) arrays and intrinsify.
7983 List (new Erasure ), // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements.
0 commit comments