mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-01 02:42:17 +00:00
prepare for llvm 15
This commit is contained in:
parent
ee87eafdca
commit
0072192897
13 changed files with 123 additions and 139 deletions
|
@ -11,8 +11,8 @@ use crate::llvm::refcounting::{
|
|||
use inkwell::attributes::{Attribute, AttributeLoc};
|
||||
use inkwell::types::{BasicType, BasicTypeEnum, StructType};
|
||||
use inkwell::values::{
|
||||
BasicValue, BasicValueEnum, CallSiteValue, FunctionValue, InstructionValue, IntValue,
|
||||
PointerValue, StructValue,
|
||||
BasicValueEnum, CallSiteValue, FunctionValue, InstructionValue, IntValue, PointerValue,
|
||||
StructValue,
|
||||
};
|
||||
use inkwell::AddressSpace;
|
||||
use roc_error_macros::internal_error;
|
||||
|
@ -206,7 +206,7 @@ fn build_transform_caller_help<'a, 'ctx, 'env>(
|
|||
let block = env.builder.get_insert_block().expect("to be in a function");
|
||||
let di_location = env.builder.get_current_debug_location().unwrap();
|
||||
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::Generic);
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::default());
|
||||
|
||||
let function_value = crate::llvm::refcounting::build_header_help(
|
||||
env,
|
||||
|
@ -244,7 +244,7 @@ fn build_transform_caller_help<'a, 'ctx, 'env>(
|
|||
|
||||
for (argument_ptr, layout) in arguments.iter().zip(argument_layouts) {
|
||||
let basic_type =
|
||||
basic_type_from_layout(env, layout_interner, *layout).ptr_type(AddressSpace::Generic);
|
||||
basic_type_from_layout(env, layout_interner, *layout).ptr_type(AddressSpace::default());
|
||||
|
||||
let cast_ptr = env.builder.build_pointer_cast(
|
||||
argument_ptr.into_pointer_value(),
|
||||
|
@ -274,7 +274,7 @@ fn build_transform_caller_help<'a, 'ctx, 'env>(
|
|||
}
|
||||
(true, layout) => {
|
||||
let closure_type = basic_type_from_layout(env, layout_interner, layout)
|
||||
.ptr_type(AddressSpace::Generic);
|
||||
.ptr_type(AddressSpace::default());
|
||||
|
||||
let closure_cast =
|
||||
env.builder
|
||||
|
@ -310,8 +310,7 @@ fn build_transform_caller_help<'a, 'ctx, 'env>(
|
|||
env.builder.build_return(None);
|
||||
|
||||
env.builder.position_at_end(block);
|
||||
env.builder
|
||||
.set_current_debug_location(env.context, di_location);
|
||||
env.builder.set_current_debug_location(di_location);
|
||||
|
||||
function_value
|
||||
}
|
||||
|
@ -375,7 +374,7 @@ fn build_rc_wrapper<'a, 'ctx, 'env>(
|
|||
let function_value = match env.module.get_function(fn_name.as_str()) {
|
||||
Some(function_value) => function_value,
|
||||
None => {
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::Generic);
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::default());
|
||||
|
||||
let function_value = match rc_operation {
|
||||
Mode::Inc | Mode::Dec => crate::llvm::refcounting::build_header_help(
|
||||
|
@ -411,7 +410,7 @@ fn build_rc_wrapper<'a, 'ctx, 'env>(
|
|||
generic_value_ptr.set_name(Symbol::ARG_1.as_str(&env.interns));
|
||||
|
||||
let value_type = basic_type_from_layout(env, layout_interner, layout);
|
||||
let value_ptr_type = value_type.ptr_type(AddressSpace::Generic);
|
||||
let value_ptr_type = value_type.ptr_type(AddressSpace::default());
|
||||
let value_ptr =
|
||||
env.builder
|
||||
.build_pointer_cast(generic_value_ptr, value_ptr_type, "load_opaque");
|
||||
|
@ -449,8 +448,7 @@ fn build_rc_wrapper<'a, 'ctx, 'env>(
|
|||
};
|
||||
|
||||
env.builder.position_at_end(block);
|
||||
env.builder
|
||||
.set_current_debug_location(env.context, di_location);
|
||||
env.builder.set_current_debug_location(di_location);
|
||||
|
||||
function_value
|
||||
}
|
||||
|
@ -472,7 +470,7 @@ pub fn build_eq_wrapper<'a, 'ctx, 'env>(
|
|||
let function_value = match env.module.get_function(fn_name.as_str()) {
|
||||
Some(function_value) => function_value,
|
||||
None => {
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::Generic);
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::default());
|
||||
|
||||
let function_value = crate::llvm::refcounting::build_header_help(
|
||||
env,
|
||||
|
@ -502,7 +500,7 @@ pub fn build_eq_wrapper<'a, 'ctx, 'env>(
|
|||
value_ptr2.set_name(Symbol::ARG_2.as_str(&env.interns));
|
||||
|
||||
let value_type = basic_type_from_layout(env, layout_interner, layout)
|
||||
.ptr_type(AddressSpace::Generic);
|
||||
.ptr_type(AddressSpace::default());
|
||||
|
||||
let value_cast1 = env
|
||||
.builder
|
||||
|
@ -533,8 +531,7 @@ pub fn build_eq_wrapper<'a, 'ctx, 'env>(
|
|||
};
|
||||
|
||||
env.builder.position_at_end(block);
|
||||
env.builder
|
||||
.set_current_debug_location(env.context, di_location);
|
||||
env.builder.set_current_debug_location(di_location);
|
||||
|
||||
function_value
|
||||
}
|
||||
|
@ -557,7 +554,7 @@ pub fn build_compare_wrapper<'a, 'ctx, 'env>(
|
|||
let function_value = match env.module.get_function(fn_name) {
|
||||
Some(function_value) => function_value,
|
||||
None => {
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::Generic);
|
||||
let arg_type = env.context.i8_type().ptr_type(AddressSpace::default());
|
||||
|
||||
let function_value = crate::llvm::refcounting::build_header_help(
|
||||
env,
|
||||
|
@ -592,7 +589,7 @@ pub fn build_compare_wrapper<'a, 'ctx, 'env>(
|
|||
value_ptr2.set_name(Symbol::ARG_3.as_str(&env.interns));
|
||||
|
||||
let value_type = basic_type_from_layout(env, layout_interner, layout);
|
||||
let value_ptr_type = value_type.ptr_type(AddressSpace::Generic);
|
||||
let value_ptr_type = value_type.ptr_type(AddressSpace::default());
|
||||
|
||||
let value_cast1 =
|
||||
env.builder
|
||||
|
@ -623,7 +620,7 @@ pub fn build_compare_wrapper<'a, 'ctx, 'env>(
|
|||
_ => {
|
||||
let closure_type =
|
||||
basic_type_from_layout(env, layout_interner, closure_data_repr);
|
||||
let closure_ptr_type = closure_type.ptr_type(AddressSpace::Generic);
|
||||
let closure_ptr_type = closure_type.ptr_type(AddressSpace::default());
|
||||
|
||||
let closure_cast = env.builder.build_pointer_cast(
|
||||
closure_ptr,
|
||||
|
@ -659,8 +656,7 @@ pub fn build_compare_wrapper<'a, 'ctx, 'env>(
|
|||
};
|
||||
|
||||
env.builder.position_at_end(block);
|
||||
env.builder
|
||||
.set_current_debug_location(env.context, di_location);
|
||||
env.builder.set_current_debug_location(di_location);
|
||||
|
||||
function_value
|
||||
}
|
||||
|
@ -798,7 +794,7 @@ fn ptr_len_cap<'a, 'ctx, 'env>(
|
|||
|
||||
let ptr = env.builder.build_int_to_ptr(
|
||||
lower_word,
|
||||
env.context.i8_type().ptr_type(AddressSpace::Generic),
|
||||
env.context.i8_type().ptr_type(AddressSpace::default()),
|
||||
"list_ptr",
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue