mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
ptrcast llvm
This commit is contained in:
parent
13fb99b078
commit
31cae64570
1 changed files with 14 additions and 1 deletions
|
@ -1256,7 +1256,20 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
||||||
unreachable!("The {:?} operation is turned into mono Expr", op)
|
unreachable!("The {:?} operation is turned into mono Expr", op)
|
||||||
}
|
}
|
||||||
|
|
||||||
PtrCast | PtrWrite | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
|
PtrCast => {
|
||||||
|
arguments!(data_ptr);
|
||||||
|
|
||||||
|
let target_type =
|
||||||
|
basic_type_from_layout(env, layout_interner, layout).into_pointer_type();
|
||||||
|
|
||||||
|
debug_assert!(data_ptr.is_pointer_value());
|
||||||
|
|
||||||
|
env.builder
|
||||||
|
.build_pointer_cast(data_ptr.into_pointer_value(), target_type, "ptr_cast")
|
||||||
|
.into()
|
||||||
|
}
|
||||||
|
|
||||||
|
PtrWrite | RefCountIncRcPtr | RefCountDecRcPtr | RefCountIncDataPtr
|
||||||
| RefCountDecDataPtr => {
|
| RefCountDecDataPtr => {
|
||||||
unreachable!("Not used in LLVM backend: {:?}", op);
|
unreachable!("Not used in LLVM backend: {:?}", op);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue