|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.ssa.IR
public abstract class IR
An SSA IR
| Nested Class Summary | |
|---|---|
static interface |
IR.SSA2LocalMap
|
| Constructor Summary | |
|---|---|
protected |
IR(IMethod method,
SSAInstruction[] instructions,
SymbolTable symbolTable,
SSACFG cfg,
SSAOptions options)
Create an SSA form from a method created by the AstTranslator front end This entrypoint is used by the JavaScript -> WALA conversion. |
| Method Summary | |
|---|---|
IBasicBlock |
getBasicBlockForCatch(SSAGetCaughtExceptionInstruction instruction)
|
IBasicBlock |
getBasicBlockForInstruction(SSAInstruction s)
This is space-inefficient. |
IBasicBlock[] |
getBasicBlocksForCall(CallSiteReference site)
|
IntSet |
getCallInstructionIndices(CallSiteReference site)
|
SSAAbstractInvokeInstruction[] |
getCalls(CallSiteReference site)
|
SSACFG |
getControlFlowGraph()
Return the CFG for the method. |
SSACFG.BasicBlock |
getExitBlock()
|
SSAInstruction[] |
getInstructions()
Returns the instructions. |
protected abstract IR.SSA2LocalMap |
getLocalMap()
subclasses must provide a source name mapping, if they want one (or null otherwise) |
java.lang.String[] |
getLocalNames(int index,
int vn)
|
IMethod |
getMethod()
|
SSANewInstruction |
getNew(NewSiteReference site)
|
int |
getNewInstructionIndex(NewSiteReference site)
|
int |
getNumberOfParameters()
Method getNumberOfParameters. |
SSAOptions |
getOptions()
|
int |
getParameter(int i)
|
TypeReference |
getParameterType(int i)
Get the type reference that describes the ith parameter to this method. |
int[] |
getParameterValueNumbers()
Method getParameterValueNumbers. |
SSAInstruction |
getPEI(ProgramCounter pc)
|
SymbolTable |
getSymbolTable()
Returns the symbolTable. |
protected abstract java.lang.String |
instructionPosition(int instructionIndex)
|
boolean |
isEmptyIR()
TODO: why do we need this? We should enforce instructions == null if necessary, I think. |
java.util.Iterator<SSAInstruction> |
iterateAllInstructions()
|
java.util.Iterator<CallSiteReference> |
iterateCallSites()
|
java.util.Iterator<SSAInstruction> |
iterateCatchInstructions()
|
java.util.Iterator<NewSiteReference> |
iterateNewSites()
|
java.util.Iterator<SSAInstruction> |
iterateNormalInstructions()
|
java.util.Iterator<? extends SSAInstruction> |
iteratePhis()
Return an iterator of all phis for this IR. |
java.util.Iterator<? extends SSAInstruction> |
iteratePis()
Return an iterator of all pis for this IR. |
protected void |
setupLocationMap()
create mappings from callsites, new sites, and PEIs to instruction index |
java.lang.String |
toString()
|
java.lang.String |
toString(ValueDecorator d)
Create a string representation, with decoration for each variable |
void |
visitAllInstructions(SSAInstruction.Visitor v)
visit each instruction in this IR |
void |
visitNormalInstructions(SSAInstruction.Visitor v)
visit each normal (non-phi, non-pi, non-catch) instruction in this IR |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected IR(IMethod method,
SSAInstruction[] instructions,
SymbolTable symbolTable,
SSACFG cfg,
SSAOptions options)
method - the method to construct SSA form foroptions - governing ssa construction options| Method Detail |
|---|
protected abstract IR.SSA2LocalMap getLocalMap()
protected void setupLocationMap()
public java.lang.String toString()
toString in class java.lang.Objectprotected abstract java.lang.String instructionPosition(int instructionIndex)
public java.lang.String toString(ValueDecorator d)
d - an object which provides string decorators for variables in the IRpublic SSAInstruction[] getInstructions()
public SymbolTable getSymbolTable()
public SSACFG getControlFlowGraph()
public java.util.Iterator<? extends SSAInstruction> iteratePhis()
public java.util.Iterator<? extends SSAInstruction> iteratePis()
public int[] getParameterValueNumbers()
public int getParameter(int i)
i -
public TypeReference getParameterType(int i)
i -
public int getNumberOfParameters()
public IMethod getMethod()
public java.util.Iterator<SSAInstruction> iterateCatchInstructions()
public void visitNormalInstructions(SSAInstruction.Visitor v)
v - a visitorpublic void visitAllInstructions(SSAInstruction.Visitor v)
v - a visitorpublic java.util.Iterator<SSAInstruction> iterateNormalInstructions()
public java.util.Iterator<SSAInstruction> iterateAllInstructions()
public SSACFG.BasicBlock getExitBlock()
public SSAAbstractInvokeInstruction[] getCalls(CallSiteReference site)
site -
java.lang.IllegalArgumentException - if site is nullpublic IntSet getCallInstructionIndices(CallSiteReference site)
site -
java.lang.IllegalArgumentException - if site is nullpublic SSANewInstruction getNew(NewSiteReference site)
site -
public int getNewInstructionIndex(NewSiteReference site)
site -
public SSAInstruction getPEI(ProgramCounter pc)
pc - a program counter
public java.util.Iterator<NewSiteReference> iterateNewSites()
public java.util.Iterator<CallSiteReference> iterateCallSites()
public IBasicBlock[] getBasicBlocksForCall(CallSiteReference site)
site - a call site in this method
java.lang.IllegalArgumentException - if site is nullpublic IBasicBlock getBasicBlockForInstruction(SSAInstruction s)
public boolean isEmptyIR()
public java.lang.String[] getLocalNames(int index,
int vn)
index - an index into the IR instruction arrayvn - a value number
public IBasicBlock getBasicBlockForCatch(SSAGetCaughtExceptionInstruction instruction)
public SSAOptions getOptions()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||