java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.ir.DTypeInfo

public class DTypeInfo extends Object
Type information object used to collect typing results when propagating types through an SSA'ed IR.
  • Constructor Details

    • DTypeInfo

      public DTypeInfo(IDMethodContext ctx)
      Create a type information object.
      Parameters:
      ctx - method context in which type propagation takes place
  • Method Details

    • getContext

      public IDMethodContext getContext()
      Retrieve the IR context in which type propagation will take place.
      Returns:
      the method context
    • getTypeFactory

      public IJavaTypeFactory getTypeFactory()
      Retrieve the type factory associated with the method context.
      Returns:
      the type factory
    • recordConflict

      public void recordConflict(String msg, IDExpression exp, IJavaType currentType, IJavaType wantedType)
      Record a typing conflict.
      Parameters:
      msg - conflict description
      exp - expression whose type could not be reconciled
      currentType - current expression type
      wantedType - requested expression type
    • resetCounters

      public void resetCounters()
      Reset the type-change counters.
    • reset

      public void reset()
      Reset counters and recorded conflicts.
    • recordChanged

      public int recordChanged()
      Record a type update.
      Returns:
      the updated change count
    • getChangedCounter

      public int getChangedCounter()
      Retrieve the number of type updates.
      Returns:
      the change count
    • recordUnchanged

      public int recordUnchanged()
      Record an unchanged type propagation result.
      Returns:
      the updated unchanged count
    • getUnchangedCounter

      public int getUnchangedCounter()
      Retrieve the number of unchanged type propagation results.
      Returns:
      the unchanged count
    • getConflicts

      public List<DTypeInfo.TypingConlict> getConflicts()
      Retrieve the recorded typing conflicts.
      Returns:
      an unmodifiable list of conflicts
    • recordVariableCandidateType

      public void recordVariableCandidateType(int varid, IJavaType t)
      Record a candidate type for a variable.
      Parameters:
      varid - variable id
      t - candidate type
    • getVariableCandidateTypes

      public Set<IJavaType> getVariableCandidateTypes(int varid)
      Retrieve candidate types for a variable.
      Parameters:
      varid - variable id
      Returns:
      candidate types, or an empty set if none were recorded
    • getVariableCandidateTypes

      public Map<Integer,Set<IJavaType>> getVariableCandidateTypes()
      Retrieve all variable candidate types.
      Returns:
      the candidate type map keyed by variable id
    • toString

      public String toString()
      Overrides:
      toString in class Object