dmd.optimize
Perform constant folding.
License
Source: optimize.d
Documentation: https://dlang.org/phobos/dmd_optimize.html
-
Declaration
ExpressionexpandVar(intresult, VarDeclarationv);If variable has a const initializer, return that initializer.
Return Value
initializer if there is one,
nullif not, ErrorExp if error -
Declaration
ExpressionExpression_optimize(Expressione, intresult, boolkeepLvalue);Constant fold an Expression.
Parameters
Expressioneexpression to const fold; this may get modified in-place
intresultWANTvalue, WANTexpand, or both
boolkeepLvalueis an lvalue, and keep it as an lvalue since it is an argument to aereforoutparameter, or the operand of&operatorReturn Value
Constant folded version of
e