summaryrefslogtreecommitdiff
path: root/sources/scalac/transformer
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/transformer
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/transformer')
-rw-r--r--sources/scalac/transformer/LambdaLift.java14
-rw-r--r--sources/scalac/transformer/LambdaLiftPhase.java7
2 files changed, 9 insertions, 12 deletions
diff --git a/sources/scalac/transformer/LambdaLift.java b/sources/scalac/transformer/LambdaLift.java
index 6e14e6ff66..5640938030 100644
--- a/sources/scalac/transformer/LambdaLift.java
+++ b/sources/scalac/transformer/LambdaLift.java
@@ -397,7 +397,7 @@ public class LambdaLift extends OwnerTransformer
Tree rhs1 = transform(rhs, sym);
if ((sym.flags & CAPTURED) != 0) {
assert sym.isLocal();
- Type boxedType = sym.typeAt(descr.nextPhase);
+ Type boxedType = sym.nextType();
Type unboxedType = boxedType.typeArgs()[0];
tpe1 = gen.mkType(tpe.pos, boxedType);
rhs1 = gen.New(
@@ -445,7 +445,7 @@ public class LambdaLift extends OwnerTransformer
sym = descr.proxy(sym, currentOwner);
}
Tree tree1 = copy.Ident(tree, sym).setType(
- sym.typeAt(descr.nextPhase));
+ sym.nextType());
if (name != sym.name) ((Ident)tree1).name = sym.name;
if ((sym.flags & CAPTURED) != 0) return gen.Select(tree1, Names.elem);
else return tree1;
@@ -482,7 +482,7 @@ public class LambdaLift extends OwnerTransformer
}
Symbol[] newtparams(Symbol owner) {
- Symbol[] tparams = owner.typeAt(descr.nextPhase).typeParams();
+ Symbol[] tparams = owner.nextType().typeParams();
int nfree = get(free.ftvs, owner).size();
assert nfree == tparams.length - owner.type().typeParams().length
: owner + " " + nfree + " " + tparams.length + " " + owner.type().firstParams().length;
@@ -492,7 +492,7 @@ public class LambdaLift extends OwnerTransformer
}
Symbol[] newparams(Symbol owner) {
- Symbol[] params = owner.typeAt(descr.nextPhase).firstParams();
+ Symbol[] params = owner.nextType().firstParams();
int nfree = get(free.fvs, owner).size();
assert nfree == params.length - owner.type().firstParams().length;
Symbol[] newparams = new Symbol[nfree];
@@ -537,10 +537,10 @@ public class LambdaLift extends OwnerTransformer
sym.updateInfo(
addParams(
addTypeParams(
- sym.infoAt(descr.nextPhase), oldtparams, newtparams),
+ sym.nextInfo(), oldtparams, newtparams),
newparams));
if (global.debug)
- global.log(sym + " has now type " + sym.typeAt(descr.nextPhase));
+ global.log(sym + " has now type " + sym.nextType());
}
} else if (sym.kind == CLASS) {
Symbol constr = sym.primaryConstructor();
@@ -641,7 +641,7 @@ public class LambdaLift extends OwnerTransformer
for (int i = 0; i < fparams.length; i++) {
Symbol farg = descr.proxy(fparams[i], currentOwner);
args1[args.length + i] =
- gen.Ident(pos, farg).setType(farg.typeAt(descr.nextPhase));
+ gen.Ident(pos, farg).setType(farg.nextType());
}
return args1;
} else {
diff --git a/sources/scalac/transformer/LambdaLiftPhase.java b/sources/scalac/transformer/LambdaLiftPhase.java
index e2181c5ccf..c4834e79cb 100644
--- a/sources/scalac/transformer/LambdaLiftPhase.java
+++ b/sources/scalac/transformer/LambdaLiftPhase.java
@@ -17,12 +17,9 @@ import java.util.ArrayList;
public class LambdaLiftPhase extends Phase implements Kinds, Modifiers {
- final int nextPhase;
-
/** Initializes this instance. */
public LambdaLiftPhase(Global global, PhaseDescriptor descriptor) {
super(global, descriptor);
- this.nextPhase = id + 1;
}
/** Applies this phase to the given compilation units. */
@@ -82,7 +79,7 @@ public class LambdaLiftPhase extends Phase implements Kinds, Modifiers {
switch (pre) {
case ThisType(_):
if (sym.kind == CLASS &&
- sym.primaryConstructor().isUpdated(nextPhase)) {
+ sym.primaryConstructor().isUpdatedAt(LambdaLiftPhase.this)) {
Symbol[] tparams = sym.primaryConstructor().nextInfo().typeParams();
int i = tparams.length;
while (i > 0 && (tparams[i-1].flags & SYNTHETIC) != 0)
@@ -138,7 +135,7 @@ public class LambdaLiftPhase extends Phase implements Kinds, Modifiers {
Symbol fowner = LambdaLift.asFunction(o);
if (fowner.isMethod()) {
if (fv.owner() == fowner) return fv;
- Type ft = (fowner.isUpdated(nextPhase)) ? fowner.typeAt(nextPhase)
+ Type ft = (fowner.isUpdatedAt(this)) ? fowner.nextType()
: fowner.type();
Symbol[] ownerparams = fv.isType() ? ft.typeParams()
: ft.firstParams();