This commit is contained in:
Folkert 2022-07-24 12:54:31 +02:00
parent df865222bf
commit 2a91c39ac6
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 15 additions and 15 deletions

View file

@ -64,7 +64,7 @@ pub fn call_list_bitcode_fn<'a, 'ctx, 'env>(
env.builder.build_load(result, "load_list")
}
pub fn call_str_bitcode_fn<'a, 'ctx, 'env>(
pub(crate) fn call_str_bitcode_fn_old<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
args: &[BasicValueEnum<'ctx>],
fn_name: &str,

View file

@ -1,7 +1,7 @@
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_new, call_void_bitcode_fn,
BitcodeReturns,
call_list_bitcode_fn_new, call_str_bitcode_fn_new, call_str_bitcode_fn_old,
call_void_bitcode_fn, BitcodeReturns,
};
use crate::llvm::build_list::{
self, allocate_list, empty_polymorphic_list, list_append_unsafe, list_capacity, list_concat,
@ -5389,7 +5389,7 @@ fn run_low_level<'a, 'ctx, 'env>(
let string1 = load_symbol(scope, &args[0]);
let string2 = load_symbol(scope, &args[1]);
call_str_bitcode_fn(env, &[string1, string2], bitcode::STR_CONCAT)
call_str_bitcode_fn_old(env, &[string1, string2], bitcode::STR_CONCAT)
}
StrJoinWith => {
// Str.joinWith : List Str, Str -> Str
@ -5398,7 +5398,7 @@ fn run_low_level<'a, 'ctx, 'env>(
let list = list_symbol_to_c_abi(env, scope, args[0]);
let string = load_symbol(scope, &args[1]);
call_str_bitcode_fn(env, &[list.into(), string], bitcode::STR_JOIN_WITH)
call_str_bitcode_fn_old(env, &[list.into(), string], bitcode::STR_JOIN_WITH)
}
StrToScalars => {
// Str.toScalars : Str -> List U32
@ -5532,7 +5532,7 @@ fn run_low_level<'a, 'ctx, 'env>(
let string = load_symbol(scope, &args[0]);
let count = load_symbol(scope, &args[1]);
call_str_bitcode_fn(env, &[string, count], bitcode::STR_REPEAT)
call_str_bitcode_fn_old(env, &[string, count], bitcode::STR_REPEAT)
}
StrSplit => {
// Str.split : Str, Str -> List Str
@ -5601,7 +5601,7 @@ fn run_low_level<'a, 'ctx, 'env>(
let string = load_symbol(scope, &args[0]);
let start = load_symbol(scope, &args[1]);
let length = load_symbol(scope, &args[2]);
call_str_bitcode_fn(env, &[string, start, length], bitcode::STR_SUBSTRING_UNSAFE)
call_str_bitcode_fn_old(env, &[string, start, length], bitcode::STR_SUBSTRING_UNSAFE)
}
StrReserve => {
// Str.reserve : Str, Nat -> Str
@ -5609,7 +5609,7 @@ fn run_low_level<'a, 'ctx, 'env>(
let string = load_symbol(scope, &args[0]);
let capacity = load_symbol(scope, &args[1]);
call_str_bitcode_fn(env, &[string, capacity], bitcode::STR_RESERVE)
call_str_bitcode_fn_old(env, &[string, capacity], bitcode::STR_RESERVE)
}
StrAppendScalar => {
// Str.appendScalar : Str, U32 -> Str
@ -5617,28 +5617,28 @@ fn run_low_level<'a, 'ctx, 'env>(
let string = load_symbol(scope, &args[0]);
let capacity = load_symbol(scope, &args[1]);
call_str_bitcode_fn(env, &[string, capacity], bitcode::STR_APPEND_SCALAR)
call_str_bitcode_fn_old(env, &[string, capacity], bitcode::STR_APPEND_SCALAR)
}
StrTrim => {
// Str.trim : Str -> Str
debug_assert_eq!(args.len(), 1);
let string = load_symbol(scope, &args[0]);
call_str_bitcode_fn(env, &[string], bitcode::STR_TRIM)
call_str_bitcode_fn_old(env, &[string], bitcode::STR_TRIM)
}
StrTrimLeft => {
// Str.trim : Str -> Str
debug_assert_eq!(args.len(), 1);
let string = load_symbol(scope, &args[0]);
call_str_bitcode_fn(env, &[string], bitcode::STR_TRIM_LEFT)
call_str_bitcode_fn_old(env, &[string], bitcode::STR_TRIM_LEFT)
}
StrTrimRight => {
// Str.trim : Str -> Str
debug_assert_eq!(args.len(), 1);
let string = load_symbol(scope, &args[0]);
call_str_bitcode_fn(env, &[string], bitcode::STR_TRIM_RIGHT)
call_str_bitcode_fn_old(env, &[string], bitcode::STR_TRIM_RIGHT)
}
ListLen => {
// List.len : List * -> Nat

View file

@ -1,4 +1,4 @@
use crate::llvm::bitcode::call_str_bitcode_fn;
use crate::llvm::bitcode::call_str_bitcode_fn_old;
use crate::llvm::build::{Env, Scope};
use inkwell::builder::Builder;
use inkwell::values::{BasicValueEnum, IntValue, PointerValue, StructValue};
@ -65,7 +65,7 @@ pub fn str_from_int<'a, 'ctx, 'env>(
value: IntValue<'ctx>,
int_width: IntWidth,
) -> BasicValueEnum<'ctx> {
call_str_bitcode_fn(env, &[value.into()], &bitcode::STR_FROM_INT[int_width])
call_str_bitcode_fn_old(env, &[value.into()], &bitcode::STR_FROM_INT[int_width])
}
pub fn decode_from_utf8_result<'a, 'ctx, 'env>(
@ -110,7 +110,7 @@ pub fn str_from_float<'a, 'ctx, 'env>(
float: BasicValueEnum<'ctx>,
float_width: FloatWidth,
) -> BasicValueEnum<'ctx> {
call_str_bitcode_fn(env, &[float], &bitcode::STR_FROM_FLOAT[float_width])
call_str_bitcode_fn_old(env, &[float], &bitcode::STR_FROM_FLOAT[float_width])
}
/// Dec.toStr : Dec -> Str