final object ConstFold

Constructors

Members

[+] def apply ( tree: Tree ) ( implicit ctx: Context ) : Tree

If tree is a constant operation, replace with result.

If tree is a constant operation, replace with result.

[+] def apply ( tree: Tree , pt: Type ) ( implicit ctx: Context ) : Tree

If tree is a constant value that can be converted to type pt, perform the conversion.

If tree is a constant value that can be converted to type pt, perform the conversion.

[+] private def finish ( tree: Tree ) ( compX: => Constant ) ( implicit ctx: Context ) : Tree
[+] private def foldBinop ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldBooleanOp ( op: Name , x: Constant , y: Constant ) : Constant

These are local helpers to keep foldBinop from overly taxing the optimizer.

These are local helpers to keep foldBinop from overly taxing the optimizer.

[+] private def foldDoubleOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldFloatOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldLongOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldSubrangeOp ( op: Name , x: Constant , y: Constant ) : Constant
[+] private def foldUnop ( op: Name , x: Constant ) : Constant