diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-15 17:10:24 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-03-18 16:06:33 +0100 |
commit | 1dbf020c43639b0c37e9005f2692871d39676ac7 (patch) | |
tree | b1855130096b99917845a715344ba6a768ede1fc /src/dotty/tools/dotc/core/Periods.scala | |
parent | 76ea699ac1a76ee6048d7fe8239d0a1126581429 (diff) | |
download | dotty-1dbf020c43639b0c37e9005f2692871d39676ac7.tar.gz dotty-1dbf020c43639b0c37e9005f2692871d39676ac7.tar.bz2 dotty-1dbf020c43639b0c37e9005f2692871d39676ac7.zip |
Refactored denotation transformers
Many small and large changes. Added samplePhase to demonstrate functionality.
To test functioning, run the compiler with args
tests/pos/uncurry.scala -Ylog:sample,terminal
Diffstat (limited to 'src/dotty/tools/dotc/core/Periods.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Periods.scala | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/core/Periods.scala b/src/dotty/tools/dotc/core/Periods.scala index 592516531..1c9fbf0c6 100644 --- a/src/dotty/tools/dotc/core/Periods.scala +++ b/src/dotty/tools/dotc/core/Periods.scala @@ -27,20 +27,16 @@ abstract class Periods extends DotClass { self: Context => /** The period containing the current period where denotations do not change. * We compute this by taking as first phase the first phase less or equal to - * the current phase that has the same "nextTransformer". As last phase - * we take the phaseId of the nextTransformer - 1. This has the advantage that - * it works even if no transformer is installed other than the sentinel - * NoTransformer, which is always installed automatically. + * the current phase that has the same "nextTransformerId". As last phase + * we take the next transformer id following the current phase. */ def stablePeriod = { var first = phaseId - val transformers = base.denotTransformers - val nxTrans = transformers.nextTransformer(first) - while (first - 1 > NoPhaseId && - (transformers.nextTransformer(first - 1) eq nxTrans)) { + val nxTrans = ctx.base.nextTransformerId(first) + while (first - 1 > NoPhaseId && (ctx.base.nextTransformerId(first - 1) == nxTrans)) { first -= 1 } - Period(runId, first, nxTrans.phaseId - 1) + Period(runId, first, nxTrans) } } |