summaryrefslogtreecommitdiff
path: root/sources/scalac/PhaseDescriptor.java
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-09-01 17:27:13 +0000
committerpaltherr <paltherr@epfl.ch>2003-09-01 17:27:13 +0000
commit860d5686c0af6d6afc5266aded4a269cc5e104b7 (patch)
treebf873b71c86463e0ccfdb269942f89afd4fafa5a /sources/scalac/PhaseDescriptor.java
parentcdbd9750f48ad8d3a5a8e3a7d1e4077b7a6988d7 (diff)
downloadscala-860d5686c0af6d6afc5266aded4a269cc5e104b7.tar.gz
scala-860d5686c0af6d6afc5266aded4a269cc5e104b7.tar.bz2
scala-860d5686c0af6d6afc5266aded4a269cc5e104b7.zip
- Replaced field Global.phases by fields Phase....
- Replaced field Global.phases by fields Phase.prev and Phase.next - Reorganized/Cleaned/Documented methods on infos, types and - closures in Symbol Removed method CompilerPhases.remove Add mehods - PhaseDescriptor.addXXXFlag
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;