mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Cast to expect_failed in LLVM, not zig
This commit is contained in:
parent
4e57b1edf2
commit
b3e6a248cf
1 changed files with 13 additions and 8 deletions
|
@ -1,3 +1,4 @@
|
|||
use std::convert::TryFrom;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::llvm::bitcode::{call_bitcode_fn, call_void_bitcode_fn};
|
||||
|
@ -5181,14 +5182,18 @@ fn run_low_level<'a, 'ctx, 'env>(
|
|||
|
||||
bd.position_at_end(throw_block);
|
||||
|
||||
call_void_bitcode_fn(
|
||||
env,
|
||||
&[env
|
||||
.ptr_int()
|
||||
.const_int(expect_failed as *const () as u64, false)
|
||||
.into()],
|
||||
bitcode::EXPECT_FAILED,
|
||||
);
|
||||
let fn_ptr_type = context
|
||||
.void_type()
|
||||
.fn_type(&[], false)
|
||||
.ptr_type(AddressSpace::Generic);
|
||||
let fn_addr = env
|
||||
.ptr_int()
|
||||
.const_int(expect_failed as *const () as u64, false);
|
||||
let func: PointerValue<'ctx> =
|
||||
bd.build_int_to_ptr(fn_addr, fn_ptr_type, "cast_expect_failed_addr_to_ptr");
|
||||
let callable = CallableValue::try_from(func).unwrap();
|
||||
|
||||
bd.build_call(callable, &[], "call_expect_failed");
|
||||
|
||||
bd.build_unconditional_branch(then_block);
|
||||
bd.position_at_end(then_block);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue