pub fn create_and_process_bytecode(options: &Options, env: &GlobalEnv) -> FunctionTargetsHolder {
    let mut targets = FunctionTargetsHolder::default();
    let output_dir = Path::new(&options.output_path)
        .parent()
        .expect("expect the parent directory of the output path to exist");
    let output_prefix = options.move_sources.get(0).map_or("bytecode", |s| {
        Path::new(s).file_name().unwrap().to_str().unwrap()
    });

    // Add function targets for all functions in the environment.
    for module_env in env.get_modules() {
        if options.prover.dump_bytecode {
            let dump_file = output_dir.join(format!("{}.mv.disas", output_prefix));
            fs::write(&dump_file, &module_env.disassemble()).expect("dumping disassembled module");
        }
        for func_env in module_env.get_functions() {
            targets.add_target(&func_env)
        }
    }

    // Create processing pipeline and run it.
    let pipeline = if options.experimental_pipeline {
        pipeline_factory::experimental_pipeline()
    } else {
        pipeline_factory::default_pipeline_with_options(&options.prover)
    };

    if options.prover.dump_bytecode {
        let dump_file_base = output_dir
            .join(output_prefix)
            .into_os_string()
            .into_string()
            .unwrap();
        pipeline.run_with_dump(env, &mut targets, &dump_file_base, options.prover.dump_cfg)
    } else {
        pipeline.run(env, &mut targets);
    }

    targets
}
/// Create bytecode and process it.
Create bytecode and process it.
Create bytecode and process it .
pub fn create_and_process_bytecode(options: &Options, env: &GlobalEnv) -> FunctionTargetsHolder {
    let mut targets = FunctionTargetsHolder::default();
    let output_dir = Path::new(&options.output_path)
        .parent()
        .expect("expect the parent directory of the output path to exist");
    let output_prefix = options.move_sources.get(0).map_or("bytecode", |s| {
        Path::new(s).file_name().unwrap().to_str().unwrap()
    });
    // Add function targets for all functions in the environment.
    for module_env in env.get_modules() {
        if options.prover.dump_bytecode {
            let dump_file = output_dir.join(format!("{}.mv.disas", output_prefix));
            fs::write(&dump_file, &module_env.disassemble()).expect("dumping disassembled module");
        }
        for func_env in module_env.get_functions() {
            targets.add_target(&func_env)
        }
    }
    // Create processing pipeline and run it.
    let pipeline = if options.experimental_pipeline {
        pipeline_factory::experimental_pipeline()
    } else {
        pipeline_factory::default_pipeline_with_options(&options.prover)
    };
    if options.prover.dump_bytecode {
        let dump_file_base = output_dir
            .join(output_prefix)
            .into_os_string()
            .into_string()
            .unwrap();
        pipeline.run_with_dump(env, &mut targets, &dump_file_base, options.prover.dump_cfg)
    } else {
        pipeline.run(env, &mut targets);
    }
    targets
}
pub fn create_and_process_bytecode ( options : & Options , env : & GlobalEnv ) -> FunctionTargetsHolder { let mut targets = FunctionTargetsHolder :: default ( ) ; let output_dir = Path :: new ( & options . output_path ) . parent ( ) . expect ( " " ) ; let output_prefix = options . move_sources . get ( 0 ) . map_or ( " " , | s | { Path :: new ( s ) . file_name ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) } ) ; // Add function targets for all functions in the environment. for module_env in env . get_modules ( ) { if options . prover . dump_bytecode { let dump_file = output_dir . join ( format ! ( " " output_prefix ) ) ; fs :: write ( & dump_file , & module_env . disassemble ( ) ) . expect ( " " ) ; } for func_env in module_env . get_functions ( ) { targets . add_target ( & func_env ) } } // Create processing pipeline and run it. let pipeline = if options . experimental_pipeline { pipeline_factory :: experimental_pipeline ( ) } else { pipeline_factory :: default_pipeline_with_options ( & options . prover ) } ; if options . prover . dump_bytecode { let dump_file_base = output_dir . join ( output_prefix ) . into_os_string ( ) . into_string ( ) . unwrap ( ) ; pipeline . run_with_dump ( env , & mut targets , & dump_file_base , options . prover . dump_cfg ) } else { pipeline . run ( env , & mut targets ) ; } targets }
Create bytecode and process it.
Create bytecode and process it .
options
&Options
env
&GlobalEnv