Merge remote-tracking branch 'remote/main' into upgrade-llvm-zig

This commit is contained in:
Luke Boswell 2024-11-29 08:58:47 +11:00
commit 2feb5d3c2e
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
426 changed files with 8889 additions and 4190 deletions

View file

@ -3561,74 +3561,6 @@ pub(crate) fn build_exp_stmt<'a, 'ctx>(
)
}
ExpectFx {
condition: cond_symbol,
region,
lookups,
variables,
remainder,
} => {
let bd = env.builder;
let context = env.context;
let (cond, _cond_layout) = scope.load_symbol_and_layout(cond_symbol);
let condition = bd.new_build_int_compare(
IntPredicate::EQ,
cond.into_int_value(),
context.bool_type().const_int(1, false),
"is_true",
);
let then_block = context.append_basic_block(parent, "then_block");
let throw_block = context.append_basic_block(parent, "throw_block");
bd.new_build_conditional_branch(condition, then_block, throw_block);
if env.mode.runs_expects() {
bd.position_at_end(throw_block);
match env.target.ptr_width() {
roc_target::PtrWidth::Bytes8 => {
let shared_memory = SharedMemoryPointer::get(env);
clone_to_shared_memory(
env,
layout_interner,
scope,
layout_ids,
&shared_memory,
*cond_symbol,
*region,
lookups,
variables,
);
bd.new_build_unconditional_branch(then_block);
}
roc_target::PtrWidth::Bytes4 => {
// temporary WASM implementation
throw_internal_exception(env, "An expectation failed!");
}
}
} else {
bd.position_at_end(throw_block);
bd.new_build_unconditional_branch(then_block);
}
bd.position_at_end(then_block);
build_exp_stmt(
env,
layout_interner,
layout_ids,
func_spec_solutions,
scope,
parent,
remainder,
)
}
Crash(sym, tag) => {
throw_exception(env, scope, sym, *tag);

View file

@ -461,8 +461,8 @@ pub(crate) fn run_low_level<'a, 'ctx>(
bitcode::STR_REPEAT,
)
}
StrSplit => {
// Str.split : Str, Str -> List Str
StrSplitOn => {
// Str.splitOn : Str, Str -> List Str
arguments!(string, delimiter);
call_str_bitcode_fn(
@ -470,7 +470,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
&[string, delimiter],
&[],
BitcodeReturns::List,
bitcode::STR_SPLIT,
bitcode::STR_SPLIT_ON,
)
}
StrIsEmpty => {
@ -2205,6 +2205,7 @@ fn build_dec_unary_op<'a, 'ctx>(
match op {
NumAbs => dec_unary_op(env, bitcode::DEC_ABS, arg),
NumNeg => dec_unary_op(env, bitcode::DEC_NEGATE, arg),
NumAcos => dec_unary_op(env, bitcode::DEC_ACOS, arg),
NumAsin => dec_unary_op(env, bitcode::DEC_ASIN, arg),
NumAtan => dec_unary_op(env, bitcode::DEC_ATAN, arg),