Function sway_core::inline_function_calls
source · pub fn inline_function_calls(
ir: &mut Context,
functions: &[Function],
tree_type: &TreeType
) -> CompileResult<()>
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 protocl 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.