summaryrefslogtreecommitdiff
path: root/sources/scalac/PhaseDescriptor.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/PhaseDescriptor.java')
-rw-r--r--sources/scalac/PhaseDescriptor.java38
1 files changed, 31 insertions, 7 deletions
diff --git a/sources/scalac/PhaseDescriptor.java b/sources/scalac/PhaseDescriptor.java
index 602a329fb6..a57694961b 100644
--- a/sources/scalac/PhaseDescriptor.java
+++ b/sources/scalac/PhaseDescriptor.java
@@ -52,10 +52,10 @@ public final class PhaseDescriptor {
// propagate other flags and freeze remaining phases
PhaseDescriptor last = null;
for (int i = 0; i < phases.length; i++) {
+ phases[i].id = i;
if (phases[i].hasSkipFlag()) continue;
if (last != null) last.flags |= phases[i].flags >>> 16;
phases[i].flags &= 0x0000FFFF;
- phases[i].freeze(last);
last = phases[i];
}
}
@@ -110,12 +110,6 @@ public final class PhaseDescriptor {
return task;
}
- /** Freezes this phase by assigning it an identifier. */
- public void freeze(PhaseDescriptor prev) {
- assert id < 0 : "phase " + name + " already frozen";
- id = prev != null ? prev.id + 1 : 0;
- }
-
/** Creates the object implementing this phase. */
public Phase create(Global global) {
assert id >= 0 : "phase " + name + " not yet frozen";
@@ -154,6 +148,36 @@ public final class PhaseDescriptor {
flags |= flag << (prev ? 16 : 0);
}
+ /** Adds the SKIP flag. */
+ public void addSkipFlag() {
+ flags |= SKIP;
+ }
+
+ /** Adds the CHECK flag. */
+ public void addCheckFlag() {
+ flags |= CHECK;
+ }
+
+ /** Adds the PRINT flag. */
+ public void addPrintFlag() {
+ flags |= PRINT;
+ }
+
+ /** Adds the GRAPH flag. */
+ public void addGraphFlag() {
+ flags |= GRAPH;
+ }
+
+ /** Adds the STOP flag. */
+ public void addStopFlag() {
+ flags |= STOP;
+ }
+
+ /** Adds the LOG flag. */
+ public void addLogFlag() {
+ flags |= LOG;
+ }
+
/** Has this phase the SKIP flag? */
public boolean hasSkipFlag() {
return (flags & SKIP) != 0;