Merge branch 'list-unsafe-append' into can-builtins-cleanup

This commit is contained in:
Folkert 2022-07-08 15:38:02 +02:00
commit 0f86886ab7
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
24 changed files with 249 additions and 470 deletions

View file

@ -39,7 +39,7 @@ use inkwell::types::{
};
use inkwell::values::BasicValueEnum::{self, *};
use inkwell::values::{
BasicMetadataValueEnum, BasicValue, CallSiteValue, CallableValue, FloatValue, FunctionValue,
BasicMetadataValueEnum, BasicValue, CallSiteValue, FloatValue, FunctionValue,
InstructionOpcode, InstructionValue, IntValue, PhiValue, PointerValue, StructValue,
};
use inkwell::OptimizationLevel;
@ -65,7 +65,7 @@ use roc_mono::layout::{
};
use roc_std::RocDec;
use roc_target::{PtrWidth, TargetInfo};
use std::convert::{TryFrom, TryInto};
use std::convert::TryInto;
use std::path::Path;
use target_lexicon::{Architecture, OperatingSystem, Triple};
@ -2779,30 +2779,8 @@ pub fn build_exp_stmt<'a, 'ctx, 'env>(
match env.target_info.ptr_width() {
roc_target::PtrWidth::Bytes8 => {
let func = env
.module
.get_function(bitcode::UTILS_EXPECT_FAILED)
.unwrap();
// TODO get the actual line info instead of
// hardcoding as zero!
let callable = CallableValue::try_from(func).unwrap();
let start_line = context.i32_type().const_int(0, false);
let end_line = context.i32_type().const_int(0, false);
let start_col = context.i16_type().const_int(0, false);
let end_col = context.i16_type().const_int(0, false);
bd.build_call(
callable,
&[
start_line.into(),
end_line.into(),
start_col.into(),
end_col.into(),
],
"call_expect_failed",
);
bd.build_unconditional_branch(then_block);
// temporary native implementation
throw_exception(env, "An expectation failed!");
}
roc_target::PtrWidth::Bytes4 => {
// temporary WASM implementation