public class CFGVisualization extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
CFGVisualization.StringWrapper |
Modifier and Type | Field and Description |
---|---|
private static byte |
BLACK |
private static String |
CENTERED |
private static byte |
GRAY |
private static byte |
HIGHLIGHTED |
private IR |
ir |
private static String |
LEFT_JUSTIFIED |
private byte[] |
nodeToColour |
private BufferedWriter |
out |
private static byte |
UNVISITED |
Constructor and Description |
---|
CFGVisualization(IR ir,
String tag) |
Modifier and Type | Method and Description |
---|---|
private String |
determineFileName(IR ir,
String tag,
RVMMethod method) |
protected void |
dfsCFG(BasicBlock bb,
IR ir) |
protected String |
enumerateAndFormatInstructions(BasicBlock succBB) |
protected String |
formatCall(Instruction inst) |
protected String |
formatHighlighting(BasicBlock bb) |
protected String |
formatInstruction(Instruction inst)
Formats instructions.
|
void |
markBlockAsHighlighted(BasicBlock bb) |
protected CFGVisualization.StringWrapper |
setDirectionalEdges(BasicBlock succBB,
BasicBlock bb)
Generates control-flow edge descriptions for basic blocks.
|
void |
visualizeCFG() |
private static final String CENTERED
private static final String LEFT_JUSTIFIED
private static final byte UNVISITED
private static final byte HIGHLIGHTED
private static final byte GRAY
private static final byte BLACK
private final BufferedWriter out
private final byte[] nodeToColour
public CFGVisualization(IR ir, String tag) throws SecurityException, IOException
SecurityException
IOException
private String determineFileName(IR ir, String tag, RVMMethod method)
public void visualizeCFG() throws IOException
IOException
protected void dfsCFG(BasicBlock bb, IR ir) throws IOException
IOException
protected CFGVisualization.StringWrapper setDirectionalEdges(BasicBlock succBB, BasicBlock bb)
succBB
- successor basic blockbb
- current basic blockprotected String enumerateAndFormatInstructions(BasicBlock succBB)
protected String formatInstruction(Instruction inst)
inst
- an instructionprotected String formatCall(Instruction inst)
public void markBlockAsHighlighted(BasicBlock bb)
protected String formatHighlighting(BasicBlock bb)