1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-03 12:07:26 +00:00

Only removing intermediates that contain lo/hi operator.

This commit is contained in:
jespergravgaard 2019-03-01 08:47:12 +01:00
parent ed2d992333
commit 20cce60f40

View File

@ -43,13 +43,14 @@ public class Pass1FixLValuesLoHi extends Pass1Base {
StatementLValue statementLValue = (StatementLValue) statement;
LvalueIntermediate intermediate = (LvalueIntermediate) statementLValue.getlValue();
StatementAssignment intermediateAssignment = getProgram().getGraph().getAssignment(intermediate.getVariable());
intermediates.add(intermediate.getVariable());
if(Operators.LOWBYTE.equals(intermediateAssignment.getOperator()) && intermediateAssignment.getrValue1() == null) {
// Found assignment to an intermediate low byte lValue <x = ...
fixLoHiLValue(programScope, statementsIt, statementLValue, intermediate, intermediateAssignment, Operators.SET_LOWBYTE);
intermediates.add(intermediate.getVariable());
} else if(Operators.HIBYTE.equals(intermediateAssignment.getOperator()) && intermediateAssignment.getrValue1() == null) {
// Found assignment to an intermediate low byte lValue >x = ...
fixLoHiLValue(programScope, statementsIt, statementLValue, intermediate, intermediateAssignment, Operators.SET_HIBYTE);
intermediates.add(intermediate.getVariable());
}
}
}