pub fn format_reaching_def_annotation(
    target: &FunctionTarget<'_>,
    code_offset: CodeOffset,
) -> Option<String> {
    if let Some(ReachingDefAnnotation(map)) =
        target.get_annotations().get::<ReachingDefAnnotation>()
    {
        if let Some(map_at) = map.get(&code_offset) {
            let mut res = map_at
                .iter()
                .map(|(idx, defs)| {
                    let name = target.get_local_name(*idx);
                    format!(
                        "{} -> {{{}}}",
                        name.display(target.symbol_pool()),
                        defs.iter()
                            .map(|def| {
                                match def {
                                    Def::Alias(a) => format!(
                                        "{}",
                                        target.get_local_name(*a).display(target.symbol_pool())
                                    ),
                                }
                            })
                            .join(", ")
                    )
                })
                .join(", ");
            res.insert_str(0, "reach: ");
            return Some(res);
        }
    }
    None
}
/// Format a reaching definition annotation.
Format a reaching definition annotation.
Format a reaching definition annotation .
pub fn format_reaching_def_annotation(
    target: &FunctionTarget<'_>,
    code_offset: CodeOffset,
) -> Option<String> {
    if let Some(ReachingDefAnnotation(map)) =
        target.get_annotations().get::<ReachingDefAnnotation>()
    {
        if let Some(map_at) = map.get(&code_offset) {
            let mut res = map_at
                .iter()
                .map(|(idx, defs)| {
                    let name = target.get_local_name(*idx);
                    format!(
                        "{} -> {{{}}}",
                        name.display(target.symbol_pool()),
                        defs.iter()
                            .map(|def| {
                                match def {
                                    Def::Alias(a) => format!(
                                        "{}",
                                        target.get_local_name(*a).display(target.symbol_pool())
                                    ),
                                }
                            })
                            .join(", ")
                    )
                })
                .join(", ");
            res.insert_str(0, "reach: ");
            return Some(res);
        }
    }
    None
}
pub fn format_reaching_def_annotation ( target : & FunctionTarget < ' _ > , code_offset : CodeOffset , ) -> Option < String > { if let Some ( ReachingDefAnnotation ( map ) ) = target . get_annotations ( ) . get :: < ReachingDefAnnotation > ( ) { if let Some ( map_at ) = map . get ( & code_offset ) { let mut res = map_at . iter ( ) . map ( | ( idx , defs ) | { let name = target . get_local_name ( * idx ) ; format ! ( " " name display ( target symbol_pool ( ) ) defs iter ( ) map ( def { match def { Def Alias ( a ) format ( " " target get_local_name ( a ) display ( target symbol_pool ( ) ) ) } } ) join ( " " ) ) } ) . join ( " " ) ; res . insert_str ( 0 , " " ) ; return Some ( res ) ; } } None }
Format a reaching definition annotation.
Format a reaching definition annotation .
target
&FunctionTarget<'_>
code_offset
CodeOffset