1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use bytecode::{
function_target::FunctionTarget,
function_target_pipeline::{FunctionTargetsHolder, FunctionVariant, VerificationFlavor},
};
use move_model::model::FunctionEnv;
pub fn choose_variant<'env>(
holder: &'env FunctionTargetsHolder,
func_env: &'env FunctionEnv<'env>,
) -> FunctionTarget<'env> {
let mut target_variant = None;
for (variant, target) in holder.get_targets(func_env) {
match variant {
FunctionVariant::Baseline => {
if target_variant.is_none() {
target_variant = Some(target);
}
}
FunctionVariant::Verification(VerificationFlavor::Regular) => {
target_variant = Some(target);
}
_ => (),
}
}
target_variant.unwrap()
}