diff options
Diffstat (limited to 'boil/library/BoilSimp.java')
-rw-r--r-- | boil/library/BoilSimp.java | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/boil/library/BoilSimp.java b/boil/library/BoilSimp.java index 9e8d40a..fe54052 100644 --- a/boil/library/BoilSimp.java +++ b/boil/library/BoilSimp.java @@ -243,6 +243,15 @@ public class BoilSimp extends GJDepthFirst<String,SymbolTable> { mod += String.format("%s)\n", args); mod += n.f5.accept(this, symt); mod += n.f6.accept(this, symt); + + // spill out all class attributes, if they're not used, who cares + for (TypeInstance attr : symt.getMethod(id) + .getClassInstance() + .getLocals()) { + mod += String.format(" %s = this\n", + this.tf.alias(attr)); + } + mod += n.f7.accept(this, symt); mod += n.f8.accept(this, symt); mod += n.f9.accept(this, symt); @@ -451,9 +460,14 @@ public class BoilSimp extends GJDepthFirst<String,SymbolTable> { String mod = ""; mod += n.f0.accept(this, symt); mod += n.f1.accept(this, symt); - mod += n.f2.accept(this, symt); + String expr = n.f2.accept(this, symt); mod += n.f3.accept(this, symt); mod += n.f4.accept(this, symt); + TypeInstance tp1 = new TypeInstance("tp1", TypeEnum.ERROR); + + // mod += String.format(" %s = %s\n", + // this.tf.alias(tp1), + // expr); mod += String.format(" PrintIntS(%s)\n", this.tf.retrieveRecentList(1)); @@ -622,19 +636,14 @@ public class BoilSimp extends GJDepthFirst<String,SymbolTable> { mod += n.f4.accept(this, symt); mod += n.f5.accept(this, symt); - String call = String.format("call %s(%s", - this.tf.alias(tp2), - this.tf.alias(cur)); - - call += String.format(" %s)", - this.tf.retrieveRecentList(symt.getMethod(id2) - .getArguments() - .size())); + mod += String.format("call %s(%s", + this.tf.alias(tp2), + this.tf.alias(cur)); - TypeInstance tp3 = new TypeInstance("tp3", TypeEnum.ERROR); - mod += String.format(" %s = %s\n", - this.tf.alias(tp3), - call); + mod += String.format(" %s)", + this.tf.retrieveRecentList(symt.getMethod(id2) + .getArguments() + .size())); return mod; } |