The first tree transform - eliminates some kinds of trees: Imports, NamedArgs - stubs out native methods - eliminates self tree in Template and self symbol in ClassInfo - collapses all type trees to trees of class TypeTree - converts idempotent expressions with constant types - drops branches of ifs using the rules if (true) A else B ==> A if (false) A else B ==> B
Check what the phase achieves, to be called at any point after it is finished.
Denotations with a symbol where
mayChange is false are guaranteed to be
unaffected by this transform, so
transformInfo need not be run. This
can save time, and more importantly, can help avoid forcing symbol completers.
A name given to the
Phase that can be used to debug the compiler. For
instance, it is possible to print trees after a given phase using:
$ ./bin/dotc -Xprint:<phaseNameHere> sourceFile.scala
Reorder statements so that module classes always come after their companion classes
Replace type tree
t of type
TypeTree(T), but record all
nested Bind nodes in annotations. These are interpreted in TreeTypeMaps
so that bound symbols can be properly copied.
eliminate self symbol in ClassInfo