This commit is contained in:
Folkert 2022-07-24 13:07:16 +02:00
parent 61b4ab72df
commit 0ab1a735ec
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 4 additions and 41 deletions

View file

@ -64,42 +64,6 @@ pub fn call_list_bitcode_fn<'a, 'ctx, 'env>(
env.builder.build_load(result, "load_list")
}
pub(crate) fn call_str_bitcode_fn_old<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
args: &[BasicValueEnum<'ctx>],
fn_name: &str,
) -> BasicValueEnum<'ctx> {
use bumpalo::collections::Vec;
let parent = env
.builder
.get_insert_block()
.and_then(|b| b.get_parent())
.unwrap();
let str_type = super::convert::zig_str_type(env);
match env.target_info.ptr_width() {
roc_target::PtrWidth::Bytes4 => {
// 3 machine words actually fit into 2 registers
call_bitcode_fn(env, args, fn_name)
}
roc_target::PtrWidth::Bytes8 => {
let result =
create_entry_block_alloca(env, parent, str_type.into(), "return_str_alloca");
let mut arguments: Vec<BasicValueEnum> =
Vec::with_capacity_in(args.len() + 1, env.arena);
arguments.push(result.into());
arguments.extend(args);
call_void_bitcode_fn(env, &arguments, fn_name);
result.into()
}
}
}
pub fn call_void_bitcode_fn<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
args: &[BasicValueEnum<'ctx>],

View file

@ -1,7 +1,6 @@
use crate::llvm::bitcode::{
call_bitcode_fn, call_bitcode_fn_fixing_for_convention, call_list_bitcode_fn,
call_list_bitcode_fn_new, call_str_bitcode_fn, call_str_bitcode_fn_old, call_void_bitcode_fn,
pass_list_or_string_to_zig_32bit, BitcodeReturns,
call_bitcode_fn, call_bitcode_fn_fixing_for_convention, call_list_bitcode_fn_new,
call_str_bitcode_fn, call_void_bitcode_fn, pass_list_or_string_to_zig_32bit, BitcodeReturns,
};
use crate::llvm::build_list::{
self, allocate_list, empty_polymorphic_list, list_append_unsafe, list_capacity, list_concat,
@ -9,7 +8,7 @@ use crate::llvm::build_list::{
list_prepend, list_replace_unsafe, list_reserve, list_sort_with, list_sublist, list_swap,
list_symbol_to_c_abi, list_to_c_abi, list_with_capacity, pass_update_mode,
};
use crate::llvm::build_str::{dec_to_str, str_from_float, str_from_int};
use crate::llvm::build_str::dec_to_str;
use crate::llvm::compare::{generic_eq, generic_neq};
use crate::llvm::convert::{
self, argument_type_from_layout, basic_type_from_builtin, basic_type_from_layout, zig_str_type,

View file

@ -7,7 +7,7 @@ use roc_module::symbol::Symbol;
use roc_mono::layout::{Builtin, Layout};
use roc_target::PtrWidth;
use super::bitcode::{call_bitcode_fn, call_str_bitcode_fn, BitcodeReturns};
use super::bitcode::{call_str_bitcode_fn, BitcodeReturns};
use super::build::{create_entry_block_alloca, load_symbol};
pub static CHAR_LAYOUT: Layout = Layout::u8();