Class SSAPropagationCallGraphBuilder.ConstraintVisitor
- java.lang.Object
-
- com.ibm.wala.ssa.SSAInstruction.Visitor
-
- com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder.ConstraintVisitor
-
- All Implemented Interfaces:
SSAInstruction.IVisitor
- Direct Known Subclasses:
AstSSAPropagationCallGraphBuilder.AstConstraintVisitor
- Enclosing class:
- SSAPropagationCallGraphBuilder
protected static class SSAPropagationCallGraphBuilder.ConstraintVisitor extends SSAInstruction.Visitor
A visitor that generates constraints based on statements in SSA form.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SSAPropagationCallGraphBuilder.ConstraintVisitor.DefaultInvariantComputer
protected static interface
SSAPropagationCallGraphBuilder.ConstraintVisitor.InvariantComputer
-
Field Summary
Fields Modifier and Type Field Description protected ISSABasicBlock
basicBlock
The basic block currently being processedprotected SSAPropagationCallGraphBuilder
builder
The governing call graph builder.protected DefUse
du
Def-use informationprotected IR
ir
The governing IRprotected CGNode
node
The node whose statements we are currently traversingprotected SymbolTable
symbolTable
Governing symbol tableprotected PropagationSystem
system
The governing propagation system, into which constraints are added
-
Constructor Summary
Constructors Constructor Description ConstraintVisitor(SSAPropagationCallGraphBuilder builder, CGNode node)
-
Method Summary
-
Methods inherited from class com.ibm.wala.ssa.SSAInstruction.Visitor
visitArrayLength, visitBinaryOp, visitComparison, visitConditionalBranch, visitConversion, visitGoto, visitInstanceof, visitMonitor, visitSwitch, visitUnaryOp
-
-
-
-
Field Detail
-
builder
protected final SSAPropagationCallGraphBuilder builder
The governing call graph builder. This field is used instead of an inner class in order to allow more flexible reuse of this visitor in subclasses
-
node
protected final CGNode node
The node whose statements we are currently traversing
-
ir
protected final IR ir
The governing IR
-
system
protected final PropagationSystem system
The governing propagation system, into which constraints are added
-
basicBlock
protected ISSABasicBlock basicBlock
The basic block currently being processed
-
symbolTable
protected final SymbolTable symbolTable
Governing symbol table
-
du
protected final DefUse du
Def-use information
-
-
Constructor Detail
-
ConstraintVisitor
public ConstraintVisitor(SSAPropagationCallGraphBuilder builder, CGNode node)
-
-
Method Detail
-
getBuilder
protected SSAPropagationCallGraphBuilder getBuilder()
-
getOptions
protected AnalysisOptions getOptions()
-
getAnalysisCache
protected AnalysisCache getAnalysisCache()
-
getPointerKeyForLocal
public PointerKey getPointerKeyForLocal(int valueNumber)
-
getFilteredPointerKeyForLocal
public FilteredPointerKey getFilteredPointerKeyForLocal(int valueNumber, FilteredPointerKey.TypeFilter filter)
-
getPointerKeyForReturnValue
public PointerKey getPointerKeyForReturnValue()
-
getPointerKeyForExceptionalReturnValue
public PointerKey getPointerKeyForExceptionalReturnValue()
-
getPointerKeyForStaticField
public PointerKey getPointerKeyForStaticField(IField f)
-
getPointerKeyForInstanceField
public PointerKey getPointerKeyForInstanceField(InstanceKey I, IField f)
-
getPointerKeyForArrayContents
public PointerKey getPointerKeyForArrayContents(InstanceKey I)
-
getInstanceKeyForAllocation
public InstanceKey getInstanceKeyForAllocation(NewSiteReference allocation)
-
getInstanceKeyForMultiNewArray
public InstanceKey getInstanceKeyForMultiNewArray(NewSiteReference allocation, int dim)
-
getInstanceKeyForConstant
public <T> InstanceKey getInstanceKeyForConstant(T S)
-
getInstanceKeyForPEI
public InstanceKey getInstanceKeyForPEI(ProgramCounter instr, TypeReference type)
-
getInstanceKeyForClassObject
public InstanceKey getInstanceKeyForClassObject(Object obj, TypeReference type)
-
getTargetForCall
public CGNode getTargetForCall(CGNode caller, CallSiteReference site, IClass recv, InstanceKey[] iKey)
-
contentsAreInvariant
protected boolean contentsAreInvariant(SymbolTable symbolTable, DefUse du, int valueNumber)
-
contentsAreInvariant
protected boolean contentsAreInvariant(SymbolTable symbolTable, DefUse du, int[] valueNumber)
-
getInvariantContents
protected InstanceKey[] getInvariantContents(int valueNumber)
-
getInvariantContents
protected InstanceKey[] getInvariantContents(SymbolTable symbolTable, DefUse du, CGNode node, int valueNumber)
-
getClassHierarchy
protected IClassHierarchy getClassHierarchy()
-
hasNoInterestingUses
protected boolean hasNoInterestingUses(int vn)
-
isRootType
protected boolean isRootType(IClass klass)
-
visitArrayLoad
public void visitArrayLoad(SSAArrayLoadInstruction instruction)
- Specified by:
visitArrayLoad
in interfaceSSAInstruction.IVisitor
- Overrides:
visitArrayLoad
in classSSAInstruction.Visitor
-
doVisitArrayLoad
protected void doVisitArrayLoad(int def, int arrayRef)
-
doVisitArrayStore
public void doVisitArrayStore(int arrayRef, int value)
-
visitArrayStore
public void visitArrayStore(SSAArrayStoreInstruction instruction)
- Specified by:
visitArrayStore
in interfaceSSAInstruction.IVisitor
- Overrides:
visitArrayStore
in classSSAInstruction.Visitor
-
visitCheckCast
public void visitCheckCast(SSACheckCastInstruction instruction)
- Specified by:
visitCheckCast
in interfaceSSAInstruction.IVisitor
- Overrides:
visitCheckCast
in classSSAInstruction.Visitor
-
visitReturn
public void visitReturn(SSAReturnInstruction instruction)
- Specified by:
visitReturn
in interfaceSSAInstruction.IVisitor
- Overrides:
visitReturn
in classSSAInstruction.Visitor
-
visitGet
public void visitGet(SSAGetInstruction instruction)
- Specified by:
visitGet
in interfaceSSAInstruction.IVisitor
- Overrides:
visitGet
in classSSAInstruction.Visitor
-
visitGetInternal
protected void visitGetInternal(int lval, int ref, boolean isStatic, FieldReference field)
-
visitPut
public void visitPut(SSAPutInstruction instruction)
- Specified by:
visitPut
in interfaceSSAInstruction.IVisitor
- Overrides:
visitPut
in classSSAInstruction.Visitor
-
visitPutInternal
public void visitPutInternal(int rval, int ref, boolean isStatic, FieldReference field)
-
processPutField
public void processPutField(int rval, int ref, IField f)
-
processPutStatic
protected void processPutStatic(int rval, FieldReference field, IField f)
-
visitInvoke
public void visitInvoke(SSAInvokeInstruction instruction)
- Specified by:
visitInvoke
in interfaceSSAInstruction.IVisitor
- Overrides:
visitInvoke
in classSSAInstruction.Visitor
-
visitInvokeInternal
protected void visitInvokeInternal(SSAAbstractInvokeInstruction instruction, SSAPropagationCallGraphBuilder.ConstraintVisitor.InvariantComputer invs)
-
visitNew
public void visitNew(SSANewInstruction instruction)
- Specified by:
visitNew
in interfaceSSAInstruction.IVisitor
- Overrides:
visitNew
in classSSAInstruction.Visitor
-
visitThrow
public void visitThrow(SSAThrowInstruction instruction)
- Specified by:
visitThrow
in interfaceSSAInstruction.IVisitor
- Overrides:
visitThrow
in classSSAInstruction.Visitor
-
visitGetCaughtException
public void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction)
- Specified by:
visitGetCaughtException
in interfaceSSAInstruction.IVisitor
- Overrides:
visitGetCaughtException
in classSSAInstruction.Visitor
-
visitPhi
public void visitPhi(SSAPhiInstruction instruction)
- Specified by:
visitPhi
in interfaceSSAInstruction.IVisitor
- Overrides:
visitPhi
in classSSAInstruction.Visitor
-
visitPi
public void visitPi(SSAPiInstruction instruction)
- Specified by:
visitPi
in interfaceSSAInstruction.IVisitor
- Overrides:
visitPi
in classSSAInstruction.Visitor
-
getBasicBlock
public ISSABasicBlock getBasicBlock()
-
setBasicBlock
public void setBasicBlock(ISSABasicBlock block)
The calling loop must call this in each iteration!
-
visitLoadMetadata
public void visitLoadMetadata(SSALoadMetadataInstruction instruction)
- Specified by:
visitLoadMetadata
in interfaceSSAInstruction.IVisitor
- Overrides:
visitLoadMetadata
in classSSAInstruction.Visitor
-
processClassInitializer
protected void processClassInitializer(IClass klass)
TODO: lift most of this logic to PropagationCallGraphBuilder Add a call to the class initializer from the root method.
-
-