org.jikesrvm.compilers.opt.ir
Class IREnumeration

java.lang.Object
  extended by org.jikesrvm.compilers.opt.ir.IREnumeration

public abstract class IREnumeration
extends Object

This class is not meant to be instantiated.

It simply serves as a place to collect the implementation of primitive IR enumerations.

None of these functions are meant to be called directly from anywhere except IR, Instruction, and BasicBlock.

General clients should use the higher level interfaces provided by those classes.


Nested Class Summary
static class IREnumeration.AllDefsEnum
          This class implements an Enumeration of Operands.
static class IREnumeration.AllInstructionsEnum
          This class implements an enumeration of instructions over all instructions for a basic block.
static class IREnumeration.AllUsesEnum
          This class implements an Enumeration of Operand.
 
Constructor Summary
IREnumeration()
           
 
Method Summary
private static void fail(String msg)
           
static Enumeration<BasicBlock> forwardBE(IR ir)
          A forward enumeration of all the basic blocks in the IR.
static Enumeration<Instruction> forwardGlobalIE(IR ir)
          A forward enumeration of all the instructions in the IR.
static Enumeration<Instruction> forwardIntraBlockIE(Instruction start, Instruction end)
          Forward intra basic block instruction enumerations from from start...last inclusive.
static Enumeration<BasicBlock> reverseBE(IR ir)
          A reverse enumeration of all the basic blocks in the IR.
static Enumeration<Instruction> reverseGlobalIE(IR ir)
          A reverse enumeration of all the instructions in the IR.
static Enumeration<Instruction> reverseIntraBlockIE(Instruction start, Instruction end)
          Reverse intra basic block instruction enumerations from from start...last inclusive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IREnumeration

public IREnumeration()
Method Detail

forwardIntraBlockIE

public static Enumeration<Instruction> forwardIntraBlockIE(Instruction start,
                                                           Instruction end)
Forward intra basic block instruction enumerations from from start...last inclusive.

NB: start and last _must_ be in the same basic block and must be in the proper relative order. This code does _not_ check this invariant, and will simply fail by eventually thowing a NoSuchElementException if it is not met. Caller's must be sure the invariants are met.

Parameters:
start - the instruction to start with
end - the instruction to end with
Returns:
an enumeration of the instructions from start to end

reverseIntraBlockIE

public static Enumeration<Instruction> reverseIntraBlockIE(Instruction start,
                                                           Instruction end)
Reverse intra basic block instruction enumerations from from start...last inclusive.

NB: start and last _must_ be in the same basic block and must be in the proper relative order. This code does _not_ check this invariant, and will simply fail by eventually thowing a NoSuchElementException if it is not met. Caller's must be sure the invariants are met.

Parameters:
start - the instruction to start with
end - the instruction to end with
Returns:
an enumeration of the instructions from start to end

forwardGlobalIE

public static Enumeration<Instruction> forwardGlobalIE(IR ir)
A forward enumeration of all the instructions in the IR.

Parameters:
ir - the IR to walk over
Returns:
a forward enumeration of the insturctions in ir

reverseGlobalIE

public static Enumeration<Instruction> reverseGlobalIE(IR ir)
A reverse enumeration of all the instructions in the IR.

Parameters:
ir - the IR to walk over
Returns:
a forward enumeration of the insturctions in ir

forwardBE

public static Enumeration<BasicBlock> forwardBE(IR ir)
A forward enumeration of all the basic blocks in the IR.

Parameters:
ir - the IR to walk over
Returns:
a forward enumeration of the basic blocks in ir

reverseBE

public static Enumeration<BasicBlock> reverseBE(IR ir)
A reverse enumeration of all the basic blocks in the IR.

Parameters:
ir - the IR to walk over
Returns:
a reverse enumeration of the basic blocks in ir

fail

private static void fail(String msg)
                  throws NoSuchElementException
Throws:
NoSuchElementException