Class DefUse

java.lang.Object
pascal.taie.analysis.defuse.DefUse
All Implemented Interfaces:
StmtResult<MultiMap<Var,Stmt>>

public class DefUse extends Object implements StmtResult<MultiMap<Var,Stmt>>
Represents the analysis result of DefUseAnalysis, i.e., both def-use chain and use-def chain.
  • Method Details

    • getDefs

      public Set<Stmt> getDefs(Stmt stmt, Var var)
      Returns:
      definitions of var at stmt. If var is not used in stmt or it does not have any definitions, an empty set is returned.
    • getUses

      public Set<Stmt> getUses(Stmt stmt)
      Returns:
      uses of the variable defined by stmt. If stmt does not define any variable or the defined variable does not have any uses, an empty Set is returned.
    • isRelevant

      public boolean isRelevant(Stmt stmt)
      Specified by:
      isRelevant in interface StmtResult<MultiMap<Var,Stmt>>
      Returns:
      if stmt is relevant in this result.
    • getResult

      public MultiMap<Var,Stmt> getResult(Stmt stmt)
      StmtResult for def-use analysis. Note that this result only contains use-def chain, and it is mainly for testing purpose.
      Specified by:
      getResult in interface StmtResult<MultiMap<Var,Stmt>>
      Returns:
      analysis result of given stmt.