Package icyllis.arc3d.compiler.analysis

# Class Analysis

java.lang.Object
icyllis.arc3d.compiler.analysis.Analysis

public final class Analysis extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Analysis()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static boolean`
  `hasSideEffects(Expression expr)`
  Determines if `expr` has any side effects.
  `static boolean`
  `isCompileTimeConstant(Expression expr)`
  Determines if `expr` is a compile-time constant (composed of just constructors and literals).
  `static boolean`
  `isSameExpressionTree(Expression left, Expression right)`
  Returns true if both expression trees are the same.
  `static boolean`
  `isTrivialExpression(Expression expr)`
  `static boolean`
  `updateVariableRefKind(Expression expr, int refKind)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Analysis

    public Analysis()

- ## Method Details

  - ### isCompileTimeConstant

    public static boolean isCompileTimeConstant(Expression expr)
    Determines if `expr` is a compile-time constant (composed of just constructors and literals).

  - ### updateVariableRefKind

    public static boolean updateVariableRefKind(Expression expr, int refKind)

  - ### isTrivialExpression

    public static boolean isTrivialExpression(@Nonnull Expression expr)

  - ### isSameExpressionTree

    public static boolean isSameExpressionTree(Expression left, Expression right)
    Returns true if both expression trees are the same. Used by the optimizer to look for self-assignment or self-comparison; won't necessarily catch complex cases. Rejects expressions that may cause side effects.

  - ### hasSideEffects

    public static boolean hasSideEffects(Expression expr)
    Determines if `expr` has any side effects. (Is the expression state-altering or pure?)