# HG changeset patch # User Josef Eisl # Date 1411551280 -7200 # Node ID e92cf6db7a07f1cd21a6f1b784b33c3484bf8411 # Parent 9a980af18ec5ebecfa14c8a34e7beab5bbaa4a14 Handle deleted instructions in CFGPrinter. diff -r 9a980af18ec5 -r e92cf6db7a07 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Wed Sep 24 09:50:56 2014 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Wed Sep 24 11:34:40 2014 +0200 @@ -450,30 +450,35 @@ for (int i = 0; i < lirInstructions.size(); i++) { LIRInstruction inst = lirInstructions.get(i); - out.printf("nr %4d ", inst.id()).print(COLUMN_END); + if (inst == null) { + out.print("nr -1 ").print(COLUMN_END).print(" instruction ").print("").print(COLUMN_END); + out.println(COLUMN_END); + } else { + out.printf("nr %4d ", inst.id()).print(COLUMN_END); - final StringBuilder stateString = new StringBuilder(); - inst.forEachState(new StateProcedure() { + final StringBuilder stateString = new StringBuilder(); + inst.forEachState(new StateProcedure() { - @Override - protected void doState(LIRFrameState state) { - if (state.hasDebugInfo()) { - DebugInfo di = state.debugInfo(); - stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), di.getCalleeSaveInfo(), target.arch)); - } else { - stateString.append(debugInfoToString(state.topFrame, null, null, target.arch)); + @Override + protected void doState(LIRFrameState state) { + if (state.hasDebugInfo()) { + DebugInfo di = state.debugInfo(); + stateString.append(debugInfoToString(di.getBytecodePosition(), di.getReferenceMap(), di.getCalleeSaveInfo(), target.arch)); + } else { + stateString.append(debugInfoToString(state.topFrame, null, null, target.arch)); + } } + }); + if (stateString.length() > 0) { + int level = out.indentationLevel(); + out.adjustIndentation(-level); + out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(stateString.toString()).print(HOVER_END).print(COLUMN_END); + out.adjustIndentation(level); } - }); - if (stateString.length() > 0) { - int level = out.indentationLevel(); - out.adjustIndentation(-level); - out.print(" st ").print(HOVER_START).print("st").print(HOVER_SEP).print(stateString.toString()).print(HOVER_END).print(COLUMN_END); - out.adjustIndentation(level); + + out.print(" instruction ").print(inst.toString()).print(COLUMN_END); + out.println(COLUMN_END); } - - out.print(" instruction ").print(inst.toString()).print(COLUMN_END); - out.println(COLUMN_END); } end("IR"); }