1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-10 12:31:09 +00:00

Added pass1 optimization removing empty blocks.

This commit is contained in:
jespergravgaard 2017-07-25 00:21:40 +02:00
parent 2819d3c58a
commit 0aa64b3203
7 changed files with 7 additions and 1 deletions

View File

@ -12,7 +12,7 @@ public class CompileLog {
public void append(String msg) {
log.append(msg);
log.append("\n");
System.out.printf(msg+"\n");
//System.out.printf(msg+"\n");
}
public StringBuilder getLog() {

View File

@ -153,6 +153,7 @@ public class Compiler {
Pass1EliminateEmptyBlocks pass1EliminateEmptyBlocks = new Pass1EliminateEmptyBlocks(program, log);
boolean blockEliminated = pass1EliminateEmptyBlocks.eliminate();
if(blockEliminated) {
log.append("CONTROL FLOW GRAPH");
log.append(program.getGraph().toString(program.getScope()));
}

View File

@ -152,6 +152,7 @@ INITIAL CONTROL FLOW GRAPH
Removing empty block @4
Removing empty block @5
Removing empty block @6
CONTROL FLOW GRAPH
@BEGIN: from
(byte) STAR ← (byte) 81
(byte[1000]) SCREEN ← (word) 1024

View File

@ -369,6 +369,7 @@ Removing empty block flip::@6
Removing empty block @3
Removing empty block plot::@4
Removing empty block @4
CONTROL FLOW GRAPH
@BEGIN: from
(byte[1000]) SCREEN ← (word) 1024
(byte[256]) buffer1 ← (word) 4096

View File

@ -61,6 +61,7 @@ INITIAL CONTROL FLOW GRAPH
Removing empty block @4
Removing empty block @5
Removing empty block @6
CONTROL FLOW GRAPH
@BEGIN: from
(byte) i ← (byte) 10
(byte) s ← (byte) 0

View File

@ -45,6 +45,7 @@ INITIAL CONTROL FLOW GRAPH
@END: from @2
Removing empty block @2
CONTROL FLOW GRAPH
@BEGIN: from
(byte[16]) p ← (word) 4352
(byte) i ← (byte) 5

View File

@ -54,6 +54,7 @@ sum::@1: from
Removing empty block sum::@1
Removing empty block @1
CONTROL FLOW GRAPH
@BEGIN: from
(byte~) $0 ← call sum (byte) 1 (byte) 2
(byte) s1 ← (byte~) $0