Prefer and and or for boolean operators

This commit is contained in:
Sam Mohr 2025-01-17 16:11:20 -08:00
parent d9d3fc74fc
commit a292e070d4
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
35 changed files with 189 additions and 282 deletions

View file

@ -1284,30 +1284,6 @@ pub(crate) fn run_low_level<'a, 'ctx>(
rhs_layout,
)
}
And => {
// The (&&) operator
arguments!(lhs_arg, rhs_arg);
let bool_val = env.builder.new_build_and(
lhs_arg.into_int_value(),
rhs_arg.into_int_value(),
"bool_and",
);
BasicValueEnum::IntValue(bool_val)
}
Or => {
// The (||) operator
arguments!(lhs_arg, rhs_arg);
let bool_val = env.builder.new_build_or(
lhs_arg.into_int_value(),
rhs_arg.into_int_value(),
"bool_or",
);
BasicValueEnum::IntValue(bool_val)
}
Not => {
// The (!) operator
arguments!(arg);