aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Periods.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-17 22:25:47 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-19 15:53:47 +0100
commit09d02bd3670b947da147aec40835822d894b17b0 (patch)
tree01e81ad97df8b0e3e59cb72b3b77893e1d6f1070 /src/dotty/tools/dotc/core/Periods.scala
parent5cbd2fbc8409b446f8751792b006693e1d091055 (diff)
downloaddotty-09d02bd3670b947da147aec40835822d894b17b0.tar.gz
dotty-09d02bd3670b947da147aec40835822d894b17b0.tar.bz2
dotty-09d02bd3670b947da147aec40835822d894b17b0.zip
Allow MiniPhase to be DenotTransformer
All MiniPhases now as are full-fledged phases, and are given their own periods and can register DenotTransformers. MiniPhases belonging to same group(list) will be squashed to single phase.
Diffstat (limited to 'src/dotty/tools/dotc/core/Periods.scala')
-rw-r--r--src/dotty/tools/dotc/core/Periods.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Periods.scala b/src/dotty/tools/dotc/core/Periods.scala
index 1c9fbf0c6..61f395c7d 100644
--- a/src/dotty/tools/dotc/core/Periods.scala
+++ b/src/dotty/tools/dotc/core/Periods.scala
@@ -32,8 +32,8 @@ abstract class Periods extends DotClass { self: Context =>
*/
def stablePeriod = {
var first = phaseId
- val nxTrans = ctx.base.nextTransformerId(first)
- while (first - 1 > NoPhaseId && (ctx.base.nextTransformerId(first - 1) == nxTrans)) {
+ val nxTrans = ctx.base.nextDenotTransformerId(first)
+ while (first - 1 > NoPhaseId && (ctx.base.nextDenotTransformerId(first - 1) == nxTrans)) {
first -= 1
}
Period(runId, first, nxTrans)
@@ -49,6 +49,8 @@ object Periods {
* runid 21 bits
* last phase id: 5 bits
* #phases before last: 5 bits
+ *
+ * // Dmitry: sign == 0 isn't actually always true, in some cases phaseId == -1 is used for shifts, that easily creates code < 0
*/
class Period(val code: Int) extends AnyVal {