From 20cb48b07dedfc8abe1808fb8d914b2259ef697e Mon Sep 17 00:00:00 2001 From: Jesper Gravgaard Date: Fri, 14 Jul 2017 00:11:57 +0200 Subject: [PATCH] Working on predictability in output --- src/dk/camelot64/kickc/icl/ControlFlowGraph.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dk/camelot64/kickc/icl/ControlFlowGraph.java b/src/dk/camelot64/kickc/icl/ControlFlowGraph.java index 7dab4b8c2..9d32f92e9 100644 --- a/src/dk/camelot64/kickc/icl/ControlFlowGraph.java +++ b/src/dk/camelot64/kickc/icl/ControlFlowGraph.java @@ -1,9 +1,6 @@ package dk.camelot64.kickc.icl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; +import java.util.*; /** The control flow graph of the program. * The control flow graph is a set of connected basic blocks. */ @@ -100,6 +97,12 @@ public class ControlFlowGraph { predecessorBlocks.add(other); } } + Collections.sort(predecessorBlocks, new Comparator() { + @Override + public int compare(ControlFlowBlock o1, ControlFlowBlock o2) { + return o1.getLabel().getFullName().compareTo(o2.getLabel().getFullName()); + } + }); return predecessorBlocks; }