1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-14 23:04:57 +00:00

Removed unused LValueLoHiByte.

This commit is contained in:
jespergravgaard 2017-12-27 22:48:26 +01:00
parent 4bcf51732b
commit 62a56f23fb
3 changed files with 0 additions and 68 deletions

View File

@ -161,7 +161,6 @@ public class Compiler {
assertions.add(new Pass2AssertBlocks(program));
assertions.add(new Pass2AssertNoCallParameters(program));
assertions.add(new Pass2AssertNoCallLvalues(program));
assertions.add(new Pass2AssertNoLvalueLoHi(program));
assertions.add(new Pass2AssertNoReturnValues(program));
assertions.add(new Pass2AssertNoProcs(program));
assertions.add(new Pass2AssertNoLabels(program));
@ -215,16 +214,13 @@ public class Compiler {
private void pass3Analysis() {
new Pass3AssertNoValueLists(program).check();
new Pass3BlockSequencePlanner(program).plan();
// Phi lifting ensures that all variables in phi-blocks are in different live range equivalence classes
new Pass3PhiLifting(program).perform();
new Pass3BlockSequencePlanner(program).plan();
getLog().append("CONTROL FLOW GRAPH - PHI LIFTED");
getLog().append(program.getGraph().toString(program));
pass2AssertSSA();
new Pass3AddNopBeforeCallOns(program).generate();
new PassNStatementIndices(program).generateStatementIndices();

View File

@ -1,36 +0,0 @@
package dk.camelot64.kickc.model;
/**
* The low/high-byte component of a word variable or pointer variable
*/
public class LvalueLoHiByte implements LValue {
private VariableRef variable;
/**
* The lo/hi operator ({@link Operator#LOWBYTE} or {@link Operator#HIBYTE}).
*/
private Operator operator;
public LvalueLoHiByte(Operator operator, VariableRef variable) {
this.variable = variable;
this.operator = operator;
}
public VariableRef getVariable() {
return variable;
}
public Operator getOperator() {
return operator;
}
@Override
public String toString(Program program) {
return operator.getOperator() + "(" + variable.toString(program) + ")";
}
public void setVariable(VariableRef variable) {
this.variable = variable;
}
}

View File

@ -1,28 +0,0 @@
package dk.camelot64.kickc.passes;
import dk.camelot64.kickc.model.*;
/** Asserts that the program does not contain any lo/hi lvalues (>plotter = $20) as they are replaced with =lo assignments ( plotter = plotter =lo $20 ) */
public class Pass2AssertNoLvalueLoHi extends Pass2SsaAssertion {
public Pass2AssertNoLvalueLoHi(Program program) {
super(program);
}
@Override
public void check() throws AssertionFailed {
ControlFlowGraphBaseVisitor<Void> checkCalls = new ControlFlowGraphBaseVisitor<Void>() {
@Override
public Void visitAssignment(StatementAssignment assignment) {
if(assignment.getlValue() instanceof LvalueLoHiByte) {
throw new AssertionFailed("No lValue lo/hi allowed! "+ assignment);
}
return null;
}
};
checkCalls.visitGraph(getGraph());
}
}