com.ibm.wala.analysis.typeInference
Class TypeInference

java.lang.Object
  extended by com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver
      extended by com.ibm.wala.fixedpoint.impl.DefaultFixedPointSolver
          extended by com.ibm.wala.dataflow.ssa.SSAInference
              extended by com.ibm.wala.analysis.typeInference.TypeInference
All Implemented Interfaces:
FixedPointConstants, IFixedPointSolver, VerboseAction
Direct Known Subclasses:
AstTypeInference

public class TypeInference
extends SSAInference
implements FixedPointConstants

This class performs intraprocedural type propagation on an SSA IR.


Nested Class Summary
protected  class TypeInference.DeclaredTypeOperator
           
protected static class TypeInference.PrimitivePropagateOperator
           
protected  class TypeInference.TypeOperatorFactory
           
 class TypeInference.TypeVarFactory
           
protected static class TypeInference.TypeVariable
          A type variable in the dataflow system.
 
Nested classes/interfaces inherited from class com.ibm.wala.dataflow.ssa.SSAInference
SSAInference.OperatorFactory, SSAInference.VariableFactory
 
Field Summary
protected  TypeAbstraction BOTTOM
          A cone type for java.lang.Object
protected  IClassHierarchy cha
          The governing class hierarchy
protected  boolean doPrimitives
          should type inference track primitive types?
protected  IR ir
          The governing SSA form
 
Fields inherited from class com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver
DEFAULT_PERIODIC_MAINTENANCE_INTERVAL, DEFAULT_VERBOSE_INTERVAL, verbose, workList
 
Fields inherited from interface com.ibm.wala.fixpoint.FixedPointConstants
CHANGED, CHANGED_AND_FIXED, CHANGED_MASK, FIXED_MASK, NOT_CHANGED, NOT_CHANGED_AND_FIXED, SIDE_EFFECT_MASK
 
Constructor Summary
TypeInference(IR ir)
           
TypeInference(IR ir, boolean doPrimitives)
           
 
Method Summary
 TypeAbstraction getConstantPrimitiveType(int valueNumber)
           
 TypeAbstraction getConstantType(int valueNumber)
           
 IR getIR()
          Returns the ir.
 TypeAbstraction getType(int valueNumber)
          Method getType.
protected  void initialize()
           
protected  void initializeVariables()
          Initialize all lattice vars in the system.
protected  void initializeWorkList()
          Initialize the work list for iteration.j
 boolean isUndefined(int valueNumber)
           
 
Methods inherited from class com.ibm.wala.dataflow.ssa.SSAInference
getVariable, init, toString
 
Methods inherited from class com.ibm.wala.fixedpoint.impl.DefaultFixedPointSolver
getFixedPointSystem
 
Methods inherited from class com.ibm.wala.fixedpoint.impl.AbstractFixedPointSolver
addAllStatementsToWorkList, addToWorkList, changedVariable, emptyWorkList, getMaxEvalBetweenTopo, getMinSizeForTopSort, getNumberOfEvaluations, getPeriodicMaintainInterval, getStatements, getTopologicalGrowthFactor, getVerboseInterval, incNumberOfEvaluations, initForFirstSolve, isChanged, isFixed, isSideEffect, lineBreak, newStatement, newStatement, newStatement, newStatement, newStatement, orderStatements, performVerboseAction, periodicMaintenance, removeStatement, setMaxEvalBetweenTopo, setMinEquationsForTopSort, setTopologicalGrowthFactor, solve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ir

protected final IR ir
The governing SSA form


cha

protected final IClassHierarchy cha
The governing class hierarchy


BOTTOM

protected final TypeAbstraction BOTTOM
A cone type for java.lang.Object


doPrimitives

protected final boolean doPrimitives
should type inference track primitive types?

Constructor Detail

TypeInference

public TypeInference(IR ir,
                     boolean doPrimitives)

TypeInference

public TypeInference(IR ir)
Method Detail

initialize

protected void initialize()

initializeVariables

protected void initializeVariables()
Description copied from class: AbstractFixedPointSolver
Initialize all lattice vars in the system.

Specified by:
initializeVariables in class AbstractFixedPointSolver

initializeWorkList

protected void initializeWorkList()
Description copied from class: AbstractFixedPointSolver
Initialize the work list for iteration.j

Specified by:
initializeWorkList in class AbstractFixedPointSolver

getIR

public IR getIR()
Returns the ir.

Returns:
IR

getType

public TypeAbstraction getType(int valueNumber)
Method getType.

Parameters:
valueNumber -
Returns:
JavaTypeAbstraction

getConstantType

public TypeAbstraction getConstantType(int valueNumber)

getConstantPrimitiveType

public TypeAbstraction getConstantPrimitiveType(int valueNumber)

isUndefined

public boolean isUndefined(int valueNumber)