blob: 25982a696c20a044de22ade5dc2b4f7e8250ee02 [file] [log] [blame]
* Performs inlining, which is an optimization pass enabled with the `-inline` flag.
* The AST is traversed, and every function call is considered for inlining using `inlinecost.d`.
* The function call is then inlined if this cost is below a threshold.
* Copyright: Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved
* Authors: $(LINK2, Walter Bright)
* License: $(LINK2, Boost License 1.0)
* Source: $(LINK2, _inline.d)
* Documentation:
* Coverage:
module dmd.inline;
import dmd.dscope;
import dmd.expression;
* Perform the "inline copying" of a default argument for a function parameter.
* Todo:
* The hack for bugzilla 4820 case is still questionable. Perhaps would have to
* handle a delegate expression with 'null' context properly in front-end.
public Expression inlineCopy(Expression e, Scope* sc)
return e.copy();