dmd.optimize
Perform constant folding.
License
Source: optimize.d
Documentation: https://dlang.org/phobos/dmd_optimize.html
-
Declaration
Expression
expandVar
(intresult
, VarDeclarationv
);If variable has a const initializer, return that initializer.
Return Value
initializer if there is one,
null
if not, ErrorExp if error -
Declaration
Expression
Expression_optimize
(Expressione
, intresult
, boolkeepLvalue
);Constant fold an Expression.
Parameters
Expression
e
expression to const fold; this may get modified in-place
int
result
WANTvalue, WANTexpand, or both
bool
keepLvalue
is an lvalue, and keep it as an lvalue since it is an argument to ae
ref
orout
parameter, or the operand of&
operatorReturn Value
Constant folded version of
e