mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
move from i32 to i64
This commit is contained in:
parent
16dd9bd8d6
commit
af34f248ea
1 changed files with 5 additions and 5 deletions
|
@ -398,7 +398,7 @@ pub fn build_expr<'a, 'ctx, 'env>(
|
||||||
|
|
||||||
let byte_type = ctx.i8_type();
|
let byte_type = ctx.i8_type();
|
||||||
let nul_terminator = byte_type.const_zero();
|
let nul_terminator = byte_type.const_zero();
|
||||||
let len_val = ctx.i32_type().const_int(str_len as u64, false);
|
let len_val = ctx.i64_type().const_int(str_len as u64, false);
|
||||||
let ptr = env
|
let ptr = env
|
||||||
.builder
|
.builder
|
||||||
.build_array_malloc(ctx.i8_type(), len_val, "str_ptr")
|
.build_array_malloc(ctx.i8_type(), len_val, "str_ptr")
|
||||||
|
@ -408,7 +408,7 @@ pub fn build_expr<'a, 'ctx, 'env>(
|
||||||
|
|
||||||
// Copy the bytes from the string literal into the array
|
// Copy the bytes from the string literal into the array
|
||||||
for (index, byte) in str_literal.bytes().enumerate() {
|
for (index, byte) in str_literal.bytes().enumerate() {
|
||||||
let index_val = ctx.i32_type().const_int(index as u64, false);
|
let index_val = ctx.i64_type().const_int(index as u64, false);
|
||||||
let elem_ptr =
|
let elem_ptr =
|
||||||
unsafe { builder.build_in_bounds_gep(ptr, &[index_val], "byte") };
|
unsafe { builder.build_in_bounds_gep(ptr, &[index_val], "byte") };
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ pub fn build_expr<'a, 'ctx, 'env>(
|
||||||
// Add a NUL terminator at the end.
|
// Add a NUL terminator at the end.
|
||||||
// TODO: Instead of NUL-terminating, return a struct
|
// TODO: Instead of NUL-terminating, return a struct
|
||||||
// with the pointer and also the length and capacity.
|
// with the pointer and also the length and capacity.
|
||||||
let index_val = ctx.i32_type().const_int(str_len as u64 - 1, false);
|
let index_val = ctx.i64_type().const_int(str_len as u64 - 1, false);
|
||||||
let elem_ptr =
|
let elem_ptr =
|
||||||
unsafe { builder.build_in_bounds_gep(ptr, &[index_val], "nul_terminator") };
|
unsafe { builder.build_in_bounds_gep(ptr, &[index_val], "nul_terminator") };
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ pub fn build_expr<'a, 'ctx, 'env>(
|
||||||
|
|
||||||
// Copy the elements from the list literal into the array
|
// Copy the elements from the list literal into the array
|
||||||
for (index, elem) in elems.iter().enumerate() {
|
for (index, elem) in elems.iter().enumerate() {
|
||||||
let index_val = ctx.i32_type().const_int(index as u64, false);
|
let index_val = ctx.i64_type().const_int(index as u64, false);
|
||||||
let elem_ptr =
|
let elem_ptr =
|
||||||
unsafe { builder.build_in_bounds_gep(ptr, &[index_val], "index") };
|
unsafe { builder.build_in_bounds_gep(ptr, &[index_val], "index") };
|
||||||
let val = build_expr(env, layout_ids, &scope, parent, &elem);
|
let val = build_expr(env, layout_ids, &scope, parent, &elem);
|
||||||
|
@ -1431,7 +1431,7 @@ fn call_with_args<'a, 'ctx, 'env>(
|
||||||
let elem_ptr = unsafe {
|
let elem_ptr = unsafe {
|
||||||
builder.build_in_bounds_gep(
|
builder.build_in_bounds_gep(
|
||||||
ptr,
|
ptr,
|
||||||
&[ctx.i32_type().const_int(
|
&[ctx.i64_type().const_int(
|
||||||
// 0 as in 0 index of our new list
|
// 0 as in 0 index of our new list
|
||||||
0 as u64, false,
|
0 as u64, false,
|
||||||
)],
|
)],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue