tip.cfg.dfa
Class ShapeAnalysis

java.lang.Object
  extended by tip.cfg.CFGAnalysisAdapter
      extended by tip.cfg.FlowAnalysis<EqualitySet<tip.cfg.dfa.ShapeAnalysis.TargetPair>>
          extended by tip.cfg.dfa.ShapeAnalysis
All Implemented Interfaces:
FixedPointAnalysis<EqualitySet<tip.cfg.dfa.ShapeAnalysis.TargetPair>>, ICFGAnalysis, PointsToMap

public class ShapeAnalysis
extends FlowAnalysis<EqualitySet<tip.cfg.dfa.ShapeAnalysis.TargetPair>>
implements PointsToMap

ShapeAnalysis implements the Shape analysis for computing points-to maps.

Author:
Johnni Winther, jw@brics.dk

Constructor Summary
ShapeAnalysis()
          Creates a new ShapeAnalysis.
 
Method Summary
 boolean caseCAssignPtrStmPoint(AAssignPtrStm node, CAssignPtrStmPoint point)
          Default implementation.
 boolean caseCAssignVarStmPoint(AAssignVarStm node, CAssignVarStmPoint point)
          Default implementation.
 String getVariableString(EqualitySet<tip.cfg.dfa.ShapeAnalysis.TargetPair> variable)
          Returns a textual representation of the variable variable.
 boolean isFlowSensitive()
           
 Map<Target,Set<Target>> pt(IProgramPoint point)
           
 Set<Target> pt(IProgramPoint point, ALocalDecl decl)
          Returns the pointer targets for the variable decl at the program point point.
 
Methods inherited from class tip.cfg.FlowAnalysis
defaultNode, end, getDependencySet, getLattice, getName, getVariable, getVariableStringForPoint, getVariableStringForPoint, setVariable, start
 
Methods inherited from class tip.cfg.CFGAnalysisAdapter
caseCBinopExpPoint, caseCBlockPoint, caseCDeclStmPoint, caseCDerefExpPoint, caseCFunctionCallExpPoint, caseCFunctionPtrCallExpPoint, caseCIfThenElseStmPoint, caseCIfThenStmPoint, caseCInputExpPoint, caseCIntConstExpPoint, caseCMallocExpPoint, caseCNullExpPoint, caseCOutputStmPoint, caseCPointerExpPoint, caseCReturnStmPoint, caseCVarExpPoint, caseCWhileStmPoint, caseEntryPoint, caseExitPoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tip.cfg.PointsToMap
getName
 
Methods inherited from interface tip.cfg.ICFGAnalysis
caseCBinopExpPoint, caseCBlockPoint, caseCDeclStmPoint, caseCDerefExpPoint, caseCFunctionCallExpPoint, caseCFunctionPtrCallExpPoint, caseCIfThenElseStmPoint, caseCIfThenStmPoint, caseCInputExpPoint, caseCIntConstExpPoint, caseCMallocExpPoint, caseCNullExpPoint, caseCOutputStmPoint, caseCPointerExpPoint, caseCReturnStmPoint, caseCVarExpPoint, caseCWhileStmPoint, caseEntryPoint, caseExitPoint
 

Constructor Detail

ShapeAnalysis

public ShapeAnalysis()
Creates a new ShapeAnalysis.

Method Detail

getVariableString

public String getVariableString(EqualitySet<tip.cfg.dfa.ShapeAnalysis.TargetPair> variable)
Description copied from interface: FixedPointAnalysis
Returns a textual representation of the variable variable.

Specified by:
getVariableString in interface FixedPointAnalysis<EqualitySet<tip.cfg.dfa.ShapeAnalysis.TargetPair>>
Parameters:
variable - the variable for which a text representation is returned
Returns:
a textual representation of the variable variable

caseCAssignVarStmPoint

public boolean caseCAssignVarStmPoint(AAssignVarStm node,
                                      CAssignVarStmPoint point)
Description copied from class: CFGAnalysisAdapter
Default implementation. Calls CFGAnalysisAdapter.defaultNode(Node,IProgramPoint).

Specified by:
caseCAssignVarStmPoint in interface ICFGAnalysis
Overrides:
caseCAssignVarStmPoint in class CFGAnalysisAdapter
Parameters:
node - the AAssignVarStm associated with point
point - the CAssignVarStmPoint calling the method
Returns:
true if the result of the analysis is changed.

caseCAssignPtrStmPoint

public boolean caseCAssignPtrStmPoint(AAssignPtrStm node,
                                      CAssignPtrStmPoint point)
Description copied from class: CFGAnalysisAdapter
Default implementation. Calls CFGAnalysisAdapter.defaultNode(Node,IProgramPoint).

Specified by:
caseCAssignPtrStmPoint in interface ICFGAnalysis
Overrides:
caseCAssignPtrStmPoint in class CFGAnalysisAdapter
Parameters:
node - the AAssignPtrStm associated with point
point - the CAssignPtrStmPoint calling the method
Returns:
true if the result of the analysis is changed.

pt

public Set<Target> pt(IProgramPoint point,
                      ALocalDecl decl)
Description copied from interface: PointsToMap
Returns the pointer targets for the variable decl at the program point point.

Specified by:
pt in interface PointsToMap
Parameters:
point - the program point for which the pointer targets are returned
decl - the variable for which the pointer targets are returned
Returns:
the pointer target for the decl at point

isFlowSensitive

public boolean isFlowSensitive()
Specified by:
isFlowSensitive in interface PointsToMap

pt

public Map<Target,Set<Target>> pt(IProgramPoint point)
Specified by:
pt in interface PointsToMap