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:
parent
2819d3c58a
commit
0aa64b3203
@ -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() {
|
||||
|
@ -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()));
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user