diff options
author | paltherr <paltherr@epfl.ch> | 2003-08-19 11:16:47 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-08-19 11:16:47 +0000 |
commit | a6b1f467d9e4014ed8bd1ac990055962e698e508 (patch) | |
tree | 56b2d84910be5f21df8f844a00c06a69014a4303 /sources | |
parent | 8222cb50fb57c1d406fbf8f4a79d5c97796a908c (diff) | |
download | scala-a6b1f467d9e4014ed8bd1ac990055962e698e508.tar.gz scala-a6b1f467d9e4014ed8bd1ac990055962e698e508.tar.bz2 scala-a6b1f467d9e4014ed8bd1ac990055962e698e508.zip |
- Changed freeze to never skip phases INITIAL a...
- Changed freeze to never skip phases INITIAL and TERMINAL
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/PhaseDescriptor.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/scalac/PhaseDescriptor.java b/sources/scalac/PhaseDescriptor.java index 17c296f3d6..4075d8a88f 100644 --- a/sources/scalac/PhaseDescriptor.java +++ b/sources/scalac/PhaseDescriptor.java @@ -31,19 +31,25 @@ public final class PhaseDescriptor { /** Freezes the given phases (patches flags and assigns ids). */ public static void freeze(PhaseDescriptor[] phases) { + // there are at least two phases: INITIAL and TERMINAL + assert phases.length >= 2; if (phases.length == 0) return; // propagate STOP and SKIP for (int i = 0; i < phases.length - 1; i++) { phases[i].flags |= (phases[i + 1].flags >>> 16) & (STOP | SKIP); phases[i+1].flags &= ~((STOP | SKIP) << 16); } - // add SKIP flags implied by STOP flag + // transform STOP flags into SKIP flags boolean stop = false; for (int i = 0; i < phases.length; i++) { stop |= phases[i].hasStopFlag(); if (stop) phases[i].flags |= SKIP; + if (stop) phases[i].flags &= ~STOP; } - // propagate other flags and freeze remaing phases + // remove SKIP flag on INITIAL and TERMINAL phases + phases[0].flags &= ~SKIP; + phases[phases.length - 1].flags &= ~SKIP; + // propagate other flags and freeze remaining phases PhaseDescriptor last = null; for (int i = 0; i < phases.length; i++) { if (phases[i].hasSkipFlag()) continue; |