diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-04-16 16:45:30 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-04-16 16:45:30 -0600 |
commit | 27de8a34f346cddef322c7b65555ddb803532d74 (patch) | |
tree | 85a3ec3cd22903c10622d56a54818566bb8a2162 /vaporize/library | |
parent | 2288a8cd8e63b928d2e382f936e4463b2e3803d1 (diff) |
Make symt a class variable in BoilSimp
Diffstat (limited to 'vaporize/library')
-rw-r--r-- | vaporize/library/ControlFlowGraph.java | 42 | ||||
-rw-r--r-- | vaporize/library/TotalSpill.java | 68 |
2 files changed, 34 insertions, 76 deletions
diff --git a/vaporize/library/ControlFlowGraph.java b/vaporize/library/ControlFlowGraph.java index 0153b38..787ef8f 100644 --- a/vaporize/library/ControlFlowGraph.java +++ b/vaporize/library/ControlFlowGraph.java @@ -7,35 +7,61 @@ import java.util.*; public class ControlFlowGraph<P, R> extends VInstr.VisitorPR<P, R, RuntimeException> { - public R visit(P p, VMemRead r) throws RuntimeException { + + public R visit(P p, VMemRead n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s)", + n.getClass().getSimpleName(), + n.sourcePos.toString()), true); return null; } - public R visit(P p, VMemWrite w) throws RuntimeException { + public R visit(P p, VMemWrite n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s)", + n.getClass().getSimpleName(), + n.sourcePos.toString()), true); return null; } - public R visit(P p, VAssign a) throws RuntimeException { + public R visit(P p, VAssign n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s)", + n.getClass().getSimpleName(), + n.sourcePos.toString()), true); return null; } - public R visit(P p, VBranch b) throws RuntimeException { + public R visit(P p, VBranch n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s)", + n.getClass().getSimpleName(), + n.sourcePos.toString()), true); return null; } - public R visit(P p, VGoto g) throws RuntimeException { + public R visit(P p, VGoto n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s)", + n.getClass().getSimpleName(), + n.sourcePos.toString()), true); return null; } - public R visit(P p, VCall c) throws RuntimeException { + public R visit(P p, VCall n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s)", + n.getClass().getSimpleName(), + n.sourcePos.toString()), true); return null; } - public R visit(P p, VBuiltIn c) throws RuntimeException { + public R visit(P p, VBuiltIn n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s:%s)", + n.getClass().getSimpleName(), + n.op.name, + n.sourcePos.toString()), true); return null; } - public R visit(P p, VReturn r) throws RuntimeException { + public R visit(P p, VReturn n) throws RuntimeException { + PrintFilter.print(String.format("%s (%s)", + n.getClass().getSimpleName(), + n.sourcePos.toString()), true); return null; } diff --git a/vaporize/library/TotalSpill.java b/vaporize/library/TotalSpill.java deleted file mode 100644 index cd75712..0000000 --- a/vaporize/library/TotalSpill.java +++ /dev/null @@ -1,68 +0,0 @@ -package vaporize.library; - -import cs132.vapor.ast.*; -import st.*; -import misc.*; -import java.util.*; - -public class TotalSpill<P, R> extends VInstr.VisitorPR<P, R, RuntimeException> { - - - public R visit(P p, VMemRead n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s)", - n.getClass().getSimpleName(), - n.sourcePos.toString()), true); - return null; - } - - public R visit(P p, VMemWrite n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s)", - n.getClass().getSimpleName(), - n.sourcePos.toString()), true); - return null; - } - - public R visit(P p, VAssign n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s)", - n.getClass().getSimpleName(), - n.sourcePos.toString()), true); - return null; - } - - public R visit(P p, VBranch n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s)", - n.getClass().getSimpleName(), - n.sourcePos.toString()), true); - return null; - } - - public R visit(P p, VGoto n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s)", - n.getClass().getSimpleName(), - n.sourcePos.toString()), true); - return null; - } - - public R visit(P p, VCall n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s)", - n.getClass().getSimpleName(), - n.sourcePos.toString()), true); - return null; - } - - public R visit(P p, VBuiltIn n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s:%s)", - n.getClass().getSimpleName(), - n.op.name, - n.sourcePos.toString()), true); - return null; - } - - public R visit(P p, VReturn n) throws RuntimeException { - PrintFilter.print(String.format("%s (%s)", - n.getClass().getSimpleName(), - n.sourcePos.toString()), true); - return null; - } - -} |