Function sway_ir::optimize::inline::inline_in_predicate_module
source · pub fn inline_in_predicate_module(
context: &mut Context,
_: &AnalysisResults,
module: Module
) -> Result<bool, IrError>
Expand description
Inline function calls based on two conditions:
- The program we’re compiling is a “predicate”. Predicates cannot jump backwards which means that supporting function calls (i.e. without inlining) is not possible. This is a protocol restriction and not a heuristic.
- If the program is not a “predicate” then, we rely on some heuristic which is described below
in the
inline_heuristc
closure ininline_in_non_predicate_module
.