Interface IR

All Superinterfaces:
Indexer<Stmt>, Iterable<Stmt>, ResultHolder, Serializable
All Known Implementing Classes:
DefaultIR

public interface IR extends Iterable<Stmt>, Indexer<Stmt>, ResultHolder, Serializable
Intermediate representation for method body of non-abstract methods. Each IR contains the variables and statements defined in a method.
  • Method Details

    • getMethod

      JMethod getMethod()
      Returns:
      the method that defines the content of this IR.
    • getThis

      @Nullable Var getThis()
      Returns:
      the "this" variable in this IR. If the method is static, then returns null.
    • getParams

      List<Var> getParams()
      Returns:
      the parameters in this IR ("this" variable is excluded). The order of the parameters in the resulting list is the same as the order they are declared in the method.
    • getParam

      Var getParam(int i)
      Returns:
      the i-th parameter in this IR. The indexes start from 0.
    • isParam

      boolean isParam(Var var)
      Returns:
      true if var is a parameter of this IR.
    • isThisOrParam

      boolean isThisOrParam(Var var)
      Returns:
      true if var is "this" variable or a parameter of this IR.
    • getReturnVars

      List<Var> getReturnVars()
      Returns:
      all returned variables. If the method return type is void, then returns empty list.
    • getVar

      Var getVar(int i)
      Returns:
      the i-th Var in this IR. The indexes start from 0.
    • getVars

      List<Var> getVars()
      Returns:
      the variables in this IR.
    • getVarIndexer

      Indexer<Var> getVarIndexer()
      Returns:
      an indexer for the variables in this IR.
    • getStmt

      Stmt getStmt(int i)
      Returns:
      the i-th Stmt in this IR. The indexes start from 0.
    • getStmts

      List<Stmt> getStmts()
      Returns:
      a list of Stmts in this IR.
    • stmts

      default Stream<Stmt> stmts()
      Returns:
      a stream of Stmts in this IR.
    • invokes

      default Stream<Invoke> invokes(boolean includeIndy)
      Convenient method to obtain Invokes in this IR.
      Parameters:
      includeIndy - whether include invokedynamic in the result.
      Returns:
      a stream of Invokes in this IR.
    • iterator

      default Iterator<Stmt> iterator()
      Specified by:
      iterator in interface Iterable<Stmt>
      Returns:
      iterator of Stmts in this IR.
    • getExceptionEntries

      List<ExceptionEntry> getExceptionEntries()
      Returns:
      the exception entries in this IR.
      See Also: