public class Util
extends java.lang.Object
ControlFlowGraph.| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
endsWithConditionalBranch(ControlFlowGraph<? extends SSAInstruction,?> G,
IBasicBlock<?> b)
Does basic block b end with a conditional branch instruction?
|
static boolean |
endsWithSwitch(ControlFlowGraph<? extends SSAInstruction,?> G,
IBasicBlock<?> b)
Does basic block b end with a switch instruction?
|
static <I,T extends IBasicBlock<I>> |
getFallThruBlock(ControlFlowGraph<I,T> G,
T b)
Given that b falls through to the next basic block, what basic block does it fall through to?
|
static SSAInstruction |
getLastInstruction(ControlFlowGraph<? extends SSAInstruction,?> cfg,
IBasicBlock<?> b) |
static <I extends SSAInstruction,T extends IBasicBlock<I>> |
getNotTakenSuccessor(ControlFlowGraph<I,T> G,
T b)
Given that b ends with a conditional branch, return the basic block to which control transfers
if the branch is not taken.
|
static <I extends SSAInstruction,T extends IBasicBlock<I>> |
getSwitchLabel(ControlFlowGraph<I,T> G,
T b,
T s)
When a switch statement at the end of block b transfers control to block s, which case was
taken? TODO: Is this correct? Can't we have multiple cases that apply? Check on this.
|
static <I extends SSAInstruction,T extends IBasicBlock<I>> |
getTakenSuccessor(ControlFlowGraph<I,T> G,
T b)
Given that b ends with a conditional branch, return the basic block to which control transfers
if the branch is taken.
|
static <I extends SSAInstruction,T extends IBasicBlock<I>> |
isSwitchDefault(ControlFlowGraph<I,T> G,
T b,
T s)
Is block s the default case for the switch instruction which is the last instruction of block
b?
|
static <I extends SSAInstruction,T extends IBasicBlock<I>> |
resolveBranch(ControlFlowGraph<I,T> G,
T bb,
int c1,
int c2)
To which
IBasicBlock does control flow from basic block bb, which ends in a conditional
branch, when the conditional branch operands evaluate to the constants c1 and c2, respectively. |
static <I extends SSAInstruction,T extends IBasicBlock<I>> |
resolveSwitch(ControlFlowGraph<I,T> G,
T b,
int c)
When the tested value of the switch statement in b has value c, which basic block does control
transfer to.
|
static <I,T extends IBasicBlock<I>> |
whichPred(ControlFlowGraph<I,T> cfg,
T a,
T b)
Given that a is a predecessor of b in the cfg ..
|
public static SSAInstruction getLastInstruction(ControlFlowGraph<? extends SSAInstruction,?> cfg, IBasicBlock<?> b)
public static boolean endsWithConditionalBranch(ControlFlowGraph<? extends SSAInstruction,?> G, IBasicBlock<?> b)
public static boolean endsWithSwitch(ControlFlowGraph<? extends SSAInstruction,?> G, IBasicBlock<?> b)
public static <I,T extends IBasicBlock<I>> T getFallThruBlock(ControlFlowGraph<I,T> G, T b)
public static <I extends SSAInstruction,T extends IBasicBlock<I>> T getNotTakenSuccessor(ControlFlowGraph<I,T> G, T b)
public static <I extends SSAInstruction,T extends IBasicBlock<I>> T getTakenSuccessor(ControlFlowGraph<I,T> G, T b)
public static <I extends SSAInstruction,T extends IBasicBlock<I>> T resolveSwitch(ControlFlowGraph<I,T> G, T b, int c)
public static <I extends SSAInstruction,T extends IBasicBlock<I>> boolean isSwitchDefault(ControlFlowGraph<I,T> G, T b, T s)
public static <I extends SSAInstruction,T extends IBasicBlock<I>> int getSwitchLabel(ControlFlowGraph<I,T> G, T b, T s)
public static <I extends SSAInstruction,T extends IBasicBlock<I>> T resolveBranch(ControlFlowGraph<I,T> G, T bb, int c1, int c2)
IBasicBlock does control flow from basic block bb, which ends in a conditional
branch, when the conditional branch operands evaluate to the constants c1 and c2, respectively.
Callers must resolve the constant values from the SymbolTable before calling this
method. These integers are not value numbers;
public static <I,T extends IBasicBlock<I>> int whichPred(ControlFlowGraph<I,T> cfg, T a, T b)
When we enumerate the predecessors of b in order, which is the first index in this order in which a appears? Note that this order corresponds to the order of operands in a phi instruction.