sway_ir::optimize::dce

Function fn_dce

Source
pub fn fn_dce(
    context: &mut Context<'_>,
    _: &AnalysisResults,
    module: Module,
) -> Result<bool, IrError>
Expand description

Remove entire functions from a module based on whether they are called or not, using a list of root ‘entry’ functions to perform a search.

Functions which are pub will not be removed and only functions within the passed Module are considered for removal.