edu.cmu.cs.crystal.tac
Class AbstractTACBranchSensitiveTransferFunction<LE>
java.lang.Object
edu.cmu.cs.crystal.tac.AbstractTACBranchSensitiveTransferFunction<LE>
- Type Parameters:
LE
- LatticeElement subclass that represents the analysis knowledge.
- All Implemented Interfaces:
- IFlowAnalysisDefinition<LE>, ITACBranchSensitiveTransferFunction<LE>
- Direct Known Subclasses:
- MayAliasTransferFunction
public abstract class AbstractTACBranchSensitiveTransferFunction<LE>
- extends Object
- implements ITACBranchSensitiveTransferFunction<LE>
Abstract base class for defining branch-sensitive flow analyses
based on 3-address code instructions (TACInstruction
).
It returns LabeledSingleResult
s in all cases.
Override the transfer
methods for instructions that your analysis
needs to consider.
- Author:
- Kevin Bierhoff
Method Summary |
ITACAnalysisContext |
getAnalysisContext()
|
AnalysisDirection |
getAnalysisDirection()
Returns AnalysisDirection.FORWARD_ANALYSIS . |
void |
setAnalysisContext(ITACAnalysisContext analysisContext)
This method is used to pass a variable query interface to the
transfer function. |
IResult<LE> |
transfer(ArrayInitInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(BinaryOperation binop,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(CastInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(ConstructorCallInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(CopyInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(DotClassInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(EnhancedForConditionInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(InstanceofInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(LoadArrayInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(LoadFieldInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(LoadLiteralInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(MethodCallInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(NewArrayInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(NewObjectInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(ReturnInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(SourceVariableDeclaration instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(SourceVariableReadInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(StoreArrayInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(StoreFieldInstruction instr,
List<ILabel> labels,
LE value)
|
IResult<LE> |
transfer(UnaryOperation unop,
List<ILabel> labels,
LE value)
|
AbstractTACBranchSensitiveTransferFunction
public AbstractTACBranchSensitiveTransferFunction()
- Default constructor.
getAnalysisDirection
public AnalysisDirection getAnalysisDirection()
- Returns
AnalysisDirection.FORWARD_ANALYSIS
.
- Specified by:
getAnalysisDirection
in interface IFlowAnalysisDefinition<LE>
- Returns:
AnalysisDirection.FORWARD_ANALYSIS
.
getAnalysisContext
public ITACAnalysisContext getAnalysisContext()
setAnalysisContext
public void setAnalysisContext(ITACAnalysisContext analysisContext)
- Description copied from interface:
ITACBranchSensitiveTransferFunction
- This method is used to pass a variable query interface to the
transfer function. Transfer functions can, but do not
have to, store the passed object in one of their fields for future use.
The provided object can be used to find
Variable
objects for AST nodes.
- Specified by:
setAnalysisContext
in interface ITACBranchSensitiveTransferFunction<LE>
- Parameters:
analysisContext
- Interface to query for variables given AST nodes.
transfer
public IResult<LE> transfer(ArrayInitInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(BinaryOperation binop,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(CastInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(DotClassInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(ConstructorCallInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(CopyInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(EnhancedForConditionInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(InstanceofInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(LoadLiteralInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(LoadArrayInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(LoadFieldInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(MethodCallInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(NewArrayInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(NewObjectInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(ReturnInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(StoreArrayInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(StoreFieldInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(SourceVariableDeclaration instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(SourceVariableReadInstruction instr,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>
transfer
public IResult<LE> transfer(UnaryOperation unop,
List<ILabel> labels,
LE value)
- Specified by:
transfer
in interface ITACBranchSensitiveTransferFunction<LE>