# HG changeset patch # User Josef Eisl # Date 1396425583 -7200 # Node ID 31ded66cd2cb13c860be2e6f90bec7a090e270b3 # Parent b14cb2d9253db187811e38825f327e5ca45a7708 Use AbstractBlock in LabelRef. diff -r b14cb2d9253d -r 31ded66cd2cb graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Wed Apr 02 15:26:58 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Wed Apr 02 09:59:43 2014 +0200 @@ -250,7 +250,7 @@ assert suxIndex != -1 : "Block not in successor list of current block"; assert currentBlock instanceof Block; - return LabelRef.forSuccessor(res.getLIR(), (Block) currentBlock, suxIndex); + return LabelRef.forSuccessor(res.getLIR(), currentBlock, suxIndex); } /** diff -r b14cb2d9253d -r 31ded66cd2cb graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Wed Apr 02 15:26:58 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Wed Apr 02 09:59:43 2014 +0200 @@ -168,7 +168,7 @@ assert suxIndex != -1 : "Block not in successor list of current block"; assert gen.getCurrentBlock() instanceof Block; - return LabelRef.forSuccessor(gen.getResult().getLIR(), (Block) gen.getCurrentBlock(), suxIndex); + return LabelRef.forSuccessor(gen.getResult().getLIR(), gen.getCurrentBlock(), suxIndex); } public final void append(LIRInstruction op) { diff -r b14cb2d9253d -r 31ded66cd2cb graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java Wed Apr 02 15:26:58 2014 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LabelRef.java Wed Apr 02 09:59:43 2014 +0200 @@ -38,37 +38,37 @@ public final class LabelRef { private final LIR lir; - private final Block block; + private final AbstractBlock block; private final int suxIndex; /** * Returns a new reference to a successor of the given block. - * + * * @param block The base block that contains the successor list. * @param suxIndex The index of the successor. * @return The newly created label reference. */ - public static LabelRef forSuccessor(final LIR lir, final Block block, final int suxIndex) { + public static LabelRef forSuccessor(final LIR lir, final AbstractBlock block, final int suxIndex) { return new LabelRef(lir, block, suxIndex); } /** * Returns a new reference to a successor of the given block. - * + * * @param block The base block that contains the successor list. * @param suxIndex The index of the successor. */ - private LabelRef(final LIR lir, final Block block, final int suxIndex) { + private LabelRef(final LIR lir, final AbstractBlock block, final int suxIndex) { this.lir = lir; this.block = block; this.suxIndex = suxIndex; } - public Block getSourceBlock() { + public AbstractBlock getSourceBlock() { return block; } - public Block getTargetBlock() { + public AbstractBlock getTargetBlock() { return block.getSuccessors().get(suxIndex); }