From 1851f5e76018ec1df3b55dce6cc9a64c9497bf7a Mon Sep 17 00:00:00 2001 From: bd-912 Date: Fri, 26 Apr 2024 15:50:38 -0600 Subject: Rearrange directory structure --- vaporize/library/SpillEverywhere.java | 92 ----------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 vaporize/library/SpillEverywhere.java (limited to 'vaporize/library/SpillEverywhere.java') diff --git a/vaporize/library/SpillEverywhere.java b/vaporize/library/SpillEverywhere.java deleted file mode 100644 index 993bfa6..0000000 --- a/vaporize/library/SpillEverywhere.java +++ /dev/null @@ -1,92 +0,0 @@ -package vaporize.library; - -import cs132.vapor.ast.*; -import st.*; -import misc.*; -import java.util.*; - -public class SpillEverywhere extends VInstr.VisitorPR { - - private VaporProgram vp; - private Kettle kettle; - - public SpillEverywhere(VaporProgram vp, ArrayList vapor) { - this.vp = vp; - this.kettle = new Kettle(vapor); - - for (VFunction f : this.vp.functions) { - MinimalLogger.severe("Num : " + Arrays.toString(f.vars)); - this.kettle.replaceFunctionDeclare(f, 0, 0, 3); // use three registers for "spill everywhere" - for (VInstr s : f.body) { - s.accept("", this); - } - } - MinimalLogger.info(kettle.dump()); - } - - - public String visit(String p, VMemRead n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - - public String visit(String p, VMemWrite n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - - public String visit(String p, VAssign n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - - public String visit(String p, VBranch n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - - public String visit(String p, VGoto n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - - public String visit(String p, VCall n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - - public String visit(String p, VBuiltIn n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.op.name, - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - - public String visit(String p, VReturn n) throws RuntimeException { - MinimalLogger.info(String.format("->%s (%s:%s)", - n.getClass().getSimpleName(), - this.kettle.get(n).trim(), - n.sourcePos.toString())); - return null; - } - -} -- cgit v1.2.3