Class DefinitionStmt<L extends LValue,R extends RValue>

java.lang.Object
pascal.taie.ir.stmt.DefinitionStmt<L,R>
Type Parameters:
L - type of left-hand side expression
R - type of right-hand side expression
All Implemented Interfaces:
Serializable, Stmt, Indexable
Direct Known Subclasses:
AssignStmt, Invoke

public abstract class DefinitionStmt<L extends LValue,R extends RValue> extends Object
Representation of all definition statements, i.e., exp1 = exp2.
See Also:
  • Field Details

    • index

      protected int index
    • lineNumber

      protected int lineNumber
  • Constructor Details

    • DefinitionStmt

      public DefinitionStmt()
  • Method Details

    • getLValue

      @Nullable public abstract L getLValue()
      Returns:
      the left-hand side expression. If this Stmt is an Invoke which does not have a left-hand side expression, e.g., o.m(...), then this method returns null; otherwise, it must return a non-null value.
    • getRValue

      public abstract R getRValue()
      Returns:
      the right-hand side expression.
    • getIndex

      public int getIndex()
      Specified by:
      getIndex in interface Indexable
      Specified by:
      getIndex in interface Stmt
      Returns:
      the index of this Stmt in the container IR.
    • setIndex

      public void setIndex(int index)
      Specified by:
      setIndex in interface Stmt
    • getLineNumber

      public int getLineNumber()
      Specified by:
      getLineNumber in interface Stmt
      Returns:
      the line number of this Stmt in the original source file. If the line number is unavailable, return -1.
    • setLineNumber

      public void setLineNumber(int lineNumber)
      Specified by:
      setLineNumber in interface Stmt
    • getDef

      public Optional<LValue> getDef()
      Specified by:
      getDef in interface Stmt
      Returns:
      the (optional) left-value expression defined in this Stmt. In Tai-e IR, each Stmt can define at most one expression.
    • getUses

      public Set<RValue> getUses()
      Specified by:
      getUses in interface Stmt
      Returns:
      a list of right-value expressions used in this Stmt.
    • canFallThrough

      public boolean canFallThrough()
      Specified by:
      canFallThrough in interface Stmt
      Returns:
      true if execution after this statement could continue at the following statement, otherwise false.