diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/DenotTransformers.scala (renamed from src/dotty/tools/dotc/core/Transformers.scala) | 18 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Periods.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 1 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/SamplePhase.scala | 6 |
7 files changed, 17 insertions, 18 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 9be2e2f43..0d6e341a6 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -361,7 +361,7 @@ object Contexts { * compiler run. */ class ContextBase extends ContextState - with Transformers.TransformerBase + with DenotTransformers.DenotTransformerBase with Denotations.DenotationsBase with Phases.PhasesBase { diff --git a/src/dotty/tools/dotc/core/Transformers.scala b/src/dotty/tools/dotc/core/DenotTransformers.scala index 9b8bb65a4..f41f1d171 100644 --- a/src/dotty/tools/dotc/core/Transformers.scala +++ b/src/dotty/tools/dotc/core/DenotTransformers.scala @@ -9,10 +9,10 @@ import Denotations._ import java.lang.AssertionError import dotty.tools.dotc.util.DotClass -object Transformers { +object DenotTransformers { - trait TransformerBase { self: ContextBase => - val infoTransformers = new TransformerGroup + trait DenotTransformerBase { self: ContextBase => + val denotTransformers = new DenotTransformerGroup } /** A transformer group contains a sequence of transformers, @@ -24,14 +24,14 @@ object Transformers { * full symbol denotations, refTransformers translate only symbol references * of type Unique/JointRefDenotation. */ - class TransformerGroup { + class DenotTransformerGroup { private val nxTransformer = - Array.fill[Transformer](MaxPossiblePhaseId + 1)(NoTransformer) + Array.fill[DenotTransformer](MaxPossiblePhaseId + 1)(NoTransformer) def nextTransformer(pid: PhaseId) = nxTransformer(pid) - def install(pid: PhaseId, transFn: TransformerGroup => Transformer): Unit = + def install(pid: PhaseId, transFn: DenotTransformerGroup => DenotTransformer): Unit = if ((pid > NoPhaseId) && (nxTransformer(pid).phaseId > pid)) { val trans = transFn(this) trans._phaseId = pid @@ -40,7 +40,7 @@ object Transformers { } /** A sentinel transformer object */ - object NoTransformer extends Transformer(this) { + object NoTransformer extends DenotTransformer(this) { _phaseId = MaxPossiblePhaseId + 1 override def lastPhaseId = phaseId - 1 // TODO JZ Probably off-by-N error here. MO: Don't think so: we want empty validity period. def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation = @@ -49,9 +49,9 @@ object Transformers { } /** A transformer transforms denotations at a given phase */ - abstract class Transformer(group: TransformerGroup) extends DotClass { + abstract class DenotTransformer(group: DenotTransformerGroup) extends DotClass { - private[Transformers] var _phaseId: PhaseId = _ + private[DenotTransformers] var _phaseId: PhaseId = _ /** The phase at the start of which the denotations are transformed */ def phaseId: PhaseId = _phaseId diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index fce5b1a16..bd1aedd75 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -11,7 +11,7 @@ import Symbols._ import Types._ import Periods._ import Flags._ -import Transformers._ +import DenotTransformers._ import Decorators._ import transform.Erasure import printing.Texts._ @@ -518,7 +518,7 @@ object Denotations { } else { // not found, cur points to highest existing variant var startPid = cur.validFor.lastPhaseId + 1 - val transformer = ctx.infoTransformers.nextTransformer(startPid) + val transformer = ctx.denotTransformers.nextTransformer(startPid) next = transformer.transform(cur).syncWithParents if (next eq cur) startPid = cur.validFor.firstPhaseId diff --git a/src/dotty/tools/dotc/core/Periods.scala b/src/dotty/tools/dotc/core/Periods.scala index 31fde2dac..592516531 100644 --- a/src/dotty/tools/dotc/core/Periods.scala +++ b/src/dotty/tools/dotc/core/Periods.scala @@ -34,7 +34,7 @@ abstract class Periods extends DotClass { self: Context => */ def stablePeriod = { var first = phaseId - val transformers = base.infoTransformers + val transformers = base.denotTransformers val nxTrans = transformers.nextTransformer(first) while (first - 1 > NoPhaseId && (transformers.nextTransformer(first - 1) eq nxTrans)) { diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 7fd5cdacc..08566e3db 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -2,7 +2,7 @@ package dotty.tools.dotc package core import Periods._, Contexts._, Symbols._, Denotations._, Names._, NameOps._, Annotations._ -import Types._, Flags._, Decorators._, Transformers._, StdNames._, Scopes._ +import Types._, Flags._, Decorators._, DenotTransformers._, StdNames._, Scopes._ import NameOps._ import Scopes.Scope import collection.mutable diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 3fc8a4f2c..ff70679b8 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -3,7 +3,6 @@ package dotc package core import Periods._ -import Transformers._ import Names._ import Scopes._ import Flags._ diff --git a/src/dotty/tools/dotc/transform/SamplePhase.scala b/src/dotty/tools/dotc/transform/SamplePhase.scala index 5a6578bea..137ab2eda 100644 --- a/src/dotty/tools/dotc/transform/SamplePhase.scala +++ b/src/dotty/tools/dotc/transform/SamplePhase.scala @@ -2,16 +2,16 @@ package dotty.tools.dotc package transform import TreeTransforms._ +import core.DenotTransformers._ import core.Denotations._ import core.Contexts._ import ast.Trees._ import ast.tpd.{Apply, Tree, cpy} -import core.Transformers._ class SamplePhase extends TreeTransformer { def init(implicit ctx: Context) = { - ctx.base.infoTransformers.install(id, new UncurryInfoTransform(_)) + ctx.base.denotTransformers.install(id, new UncurryDenotTransform(_)) } def name = "sample" @@ -20,7 +20,7 @@ class SamplePhase extends TreeTransformer { } -class UncurryInfoTransform(group: TransformerGroup) extends Transformer(group) { +class UncurryDenotTransform(group: DenotTransformerGroup) extends DenotTransformer(group) { def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation = ??? |