From aec15a3125e9baf9da7cd7cdebb01f881a4000a9 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Tue, 13 Feb 2018 12:46:35 +0100 Subject: [PATCH] Removed a bit of unused code. --- .../camelot64/kickc/model/ControlFlowBlock.java | 17 ----------------- .../camelot64/kickc/model/ControlFlowGraph.java | 9 --------- .../java/dk/camelot64/kickc/model/LValue.java | 1 + .../java/dk/camelot64/kickc/model/Label.java | 6 ------ .../dk/camelot64/kickc/test/TestPrograms.java | 2 +- 5 files changed, 2 insertions(+), 33 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/model/ControlFlowBlock.java b/src/main/java/dk/camelot64/kickc/model/ControlFlowBlock.java index 5535c0564..f6289b7a3 100644 --- a/src/main/java/dk/camelot64/kickc/model/ControlFlowBlock.java +++ b/src/main/java/dk/camelot64/kickc/model/ControlFlowBlock.java @@ -38,21 +38,6 @@ public class ControlFlowBlock { this.conditionalSuccessor = null; } - public ControlFlowBlock( - LabelRef label, - ScopeRef scope, - List statements, - LabelRef defaultSuccessor, - LabelRef conditionalSuccessor, - LabelRef callSuccessor) { - this.label = label; - this.scope = scope; - this.statements = statements; - this.defaultSuccessor = defaultSuccessor; - this.conditionalSuccessor = conditionalSuccessor; - this.callSuccessor = callSuccessor; - } - public LabelRef getLabel() { return label; } @@ -166,9 +151,7 @@ public class ControlFlowBlock { public boolean equals(Object o) { if(this == o) return true; if(o == null || getClass() != o.getClass()) return false; - ControlFlowBlock that = (ControlFlowBlock) o; - if(!label.equals(that.label)) return false; if(statements != null ? !statements.equals(that.statements) : that.statements != null) return false; if(defaultSuccessor != null ? !defaultSuccessor.equals(that.defaultSuccessor) : that.defaultSuccessor != null) diff --git a/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java b/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java index ac272a114..a49601daf 100644 --- a/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java +++ b/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java @@ -21,15 +21,6 @@ public class ControlFlowGraph { this.firstBlockRef = firstBlockRef; } - public ControlFlowGraph( - Map blocks, - LabelRef firstBlockRef, - List sequence) { - this.blocks = blocks; - this.firstBlockRef = firstBlockRef; - this.sequence = sequence; - } - public ControlFlowBlock getBlock(LabelRef symbol) { return blocks.get(symbol); } diff --git a/src/main/java/dk/camelot64/kickc/model/LValue.java b/src/main/java/dk/camelot64/kickc/model/LValue.java index 37b2f53b2..0978b1d8e 100644 --- a/src/main/java/dk/camelot64/kickc/model/LValue.java +++ b/src/main/java/dk/camelot64/kickc/model/LValue.java @@ -7,6 +7,7 @@ public interface LValue extends RValue { * Singleton signalling that an RValue is never assigned and can safely be discarded as rvalue in phi-functions. */ public static RValue VOID = new RValue() { + @Override public String toString() { return toString(null); diff --git a/src/main/java/dk/camelot64/kickc/model/Label.java b/src/main/java/dk/camelot64/kickc/model/Label.java index a2ffb7420..2e89833cc 100644 --- a/src/main/java/dk/camelot64/kickc/model/Label.java +++ b/src/main/java/dk/camelot64/kickc/model/Label.java @@ -17,12 +17,6 @@ public class Label implements Symbol { this.intermediate = intermediate; } - public Label( String name, boolean intermediate) { - this.name = name; - this.scope = null; - this.intermediate = intermediate; - } - @Override public String getLocalName() { return name; diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 14dc82475..dd9f83341 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -588,7 +588,7 @@ public class TestPrograms { int asmRes = KickAssembler.main2(new String[]{asmFile.getAbsolutePath(), "-log", asmLogFile.getAbsolutePath(), "-o", asmPrgFile.getAbsolutePath(), "-vicesymbols", "-showmem"}); System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out))); if(asmRes!=0) { - fail("KickAssembling file failed!"); + fail("KickAssembling file failed! "+kickAssOut.toString()); } }