Produces an inlined version of call
via its inlined
method.
- Value Params
- call
the original call to an inlineable method
- rhsToInline
the body of the inlineable method that replaces the call.
- Companion
- object
Type members
Classlikes
A typer for inlined bodies. Beyond standard typing, an inline typer performs the following functions:
A typer for inlined bodies. Beyond standard typing, an inline typer performs the following functions:
- Implement constant folding over inlined code
- Selectively expand ifs with constant conditions
- Inline arguments that are by-name closures
- Make sure inlined code is type-correct.
- Make sure that the tree's typing is idempotent (so that future -Ycheck passes succeed)
Very similar to TreeInfo.isPureExpr, but with the following inliner-only exceptions:
Very similar to TreeInfo.isPureExpr, but with the following inliner-only exceptions:
- synthetic case class apply methods, when the case class constructor is empty, are elideable but not pure. Elsewhere, accessing the apply method might cause the initialization of a containing object so they are merely idempotent.
A utility object offering methods for rewriting inlined code
A utility object offering methods for rewriting inlined code
Value members
Concrete methods
Drop any side-effect-free bindings that are unused in expansion or other reachable bindings. Inline def bindings that are used only once.
Drop any side-effect-free bindings that are unused in expansion or other reachable bindings. Inline def bindings that are used only once.
Make tree
part of inlined expansion. This means its owner has to be changed
from its originalOwner
, and, if it comes from outside the inlined method
itself, it has to be marked as an inlined argument.
Make tree
part of inlined expansion. This means its owner has to be changed
from its originalOwner
, and, if it comes from outside the inlined method
itself, it has to be marked as an inlined argument.