/// Generate function stub depending on entry point type. This forwards to the
/// inlined function definition.
Generate function stub depending on entry point type. This forwards to the
inlined function definition.
Generate function stub depending on entry point type . This forwards to the inlined function definition .
fn generate_function_stub(
        &self,
        func_target: &FunctionTarget<'_>,
        entry_point: FunctionEntryPoint,
        def_entry_point: FunctionEntryPoint,
    ) {
        // Set the location to internal so it won't be counted for execution traces
        self.writer
            .set_location(&self.module_env.env.internal_loc());
        emitln!(self.writer, "{");
        self.writer.indent();
        // Translate argument type requirements.
        self.generate_function_args_well_formed(func_target);
        // Translate assumptions specific to this entry point.
        let spec_translator =
            SpecTranslator::new(self.writer, func_target.clone(), self.options, false);
        spec_translator.translate_entry_point_assumptions(entry_point);
        // Generate call to inlined function.
        let args = func_target
            .get_type_parameters()
            .iter()
            .map(|TypeParameter(s, _)| format!("{}", s.display(func_target.symbol_pool())))
            .chain((0..func_target.get_parameter_count()).map(|i| {
                format!(
                    "{}",
                    func_target
                        .get_local_name(i)
                        .display(func_target.symbol_pool())
                )
            }))
            .join(", ");
        let rets = (0..func_target.get_return_count())
            .map(|i| format!("$ret{}", i))
            .join(", ");
        if rets.is_empty() {
            emitln!(
                self.writer,
                "call {}{}({});",
                boogie_function_name(func_target.func_env),
                def_entry_point.suffix(),
                args
            )
        } else {
            emitln!(
                self.writer,
                "call {} := {}{}({});",
                rets,
                boogie_function_name(func_target.func_env),
                def_entry_point.suffix(),
                args
            )
        }
        self.writer.unindent();
        emitln!(self.writer, "}");
        emitln!(self.writer);
    }
fn generate_function_stub ( & self , func_target : & FunctionTarget < ' _ > , entry_point : FunctionEntryPoint , def_entry_point : FunctionEntryPoint , ) { // Set the location to internal so it won't be counted for execution traces self . writer . set_location ( & self . module_env . env . internal_loc ( ) ) ; emitln ! ( self writer " " ) ; self . writer . indent ( ) ; // Translate argument type requirements. self . generate_function_args_well_formed ( func_target ) ; // Translate assumptions specific to this entry point. let spec_translator = SpecTranslator :: new ( self . writer , func_target . clone ( ) , self . options , false ) ; spec_translator . translate_entry_point_assumptions ( entry_point ) ; // Generate call to inlined function. let args = func_target . get_type_parameters ( ) . iter ( ) . map ( | TypeParameter ( s , _ ) | format ! ( " " s display ( func_target symbol_pool ( ) ) ) ) . chain ( ( 0 .. func_target . get_parameter_count ( ) ) . map ( | i | { format ! ( " " func_target get_local_name ( i ) display ( func_target symbol_pool ( ) ) ) } ) ) . join ( " " ) ; let rets = ( 0 .. func_target . get_return_count ( ) ) . map ( | i | format ! ( " " i ) ) . join ( " " ) ; if rets . is_empty ( ) { emitln ! ( self writer " " boogie_function_name ( func_target func_env ) def_entry_point suffix ( ) args ) } else { emitln ! ( self writer " " rets boogie_function_name ( func_target func_env ) def_entry_point suffix ( ) args ) } self . writer . unindent ( ) ; emitln ! ( self writer " " ) ; emitln ! ( self writer ) ; }
Generate function stub depending on entry point type.
Generate function stub depending on entry point type .
&self
func_target
&FunctionTarget<'_>
entry_point
FunctionEntryPoint
def_entry_point
FunctionEntryPoint