Rename some indices

This commit is contained in:
Chad Stearns 2020-08-10 00:53:50 -04:00
parent e65c0cafbb
commit 331695b85c

View file

@ -379,10 +379,10 @@ pub fn list_join<'a, 'ctx, 'env>(
builder.build_store(dest_elem_ptr_alloca, final_list_ptr); builder.build_store(dest_elem_ptr_alloca, final_list_ptr);
// Inner List Loop // Inner List Loop
let inner_list_loop = |curr_index| { let inner_list_loop = |index| {
let inner_list_wrapper = { let inner_list_wrapper = {
let wrapper_ptr = unsafe { let wrapper_ptr = unsafe {
builder.build_in_bounds_gep(outer_list_ptr, &[curr_index], "load_index") builder.build_in_bounds_gep(outer_list_ptr, &[index], "load_index")
}; };
builder builder
@ -990,14 +990,14 @@ pub fn list_concat<'a, 'ctx, 'env>(
.unwrap(); .unwrap();
// FIRST LOOP // FIRST LOOP
let first_loop = |curr_first_loop_index| { let first_loop = |first_index| {
let first_list_ptr = load_list_ptr(builder, first_list_wrapper, ptr_type); let first_list_ptr = load_list_ptr(builder, first_list_wrapper, ptr_type);
// The pointer to the element in the first list // The pointer to the element in the first list
let first_list_elem_ptr = unsafe { let first_list_elem_ptr = unsafe {
builder.build_in_bounds_gep( builder.build_in_bounds_gep(
first_list_ptr, first_list_ptr,
&[curr_first_loop_index], &[first_index],
"load_index", "load_index",
) )
}; };
@ -1006,7 +1006,7 @@ pub fn list_concat<'a, 'ctx, 'env>(
let combined_list_elem_ptr = unsafe { let combined_list_elem_ptr = unsafe {
builder.build_in_bounds_gep( builder.build_in_bounds_gep(
combined_list_ptr, combined_list_ptr,
&[curr_first_loop_index], &[first_index],
"load_index_combined_list", "load_index_combined_list",
) )
}; };
@ -1033,14 +1033,14 @@ pub fn list_concat<'a, 'ctx, 'env>(
builder.build_store(index_alloca, ctx.i64_type().const_int(0, false)); builder.build_store(index_alloca, ctx.i64_type().const_int(0, false));
// SECOND LOOP // SECOND LOOP
let second_loop = |curr_second_index| { let second_loop = |second_index| {
let second_list_ptr = load_list_ptr(builder, second_list_wrapper, ptr_type); let second_list_ptr = load_list_ptr(builder, second_list_wrapper, ptr_type);
// The pointer to the element in the second list // The pointer to the element in the second list
let second_list_elem_ptr = unsafe { let second_list_elem_ptr = unsafe {
builder.build_in_bounds_gep( builder.build_in_bounds_gep(
second_list_ptr, second_list_ptr,
&[curr_second_index], &[second_index],
"load_index", "load_index",
) )
}; };
@ -1062,7 +1062,7 @@ pub fn list_concat<'a, 'ctx, 'env>(
let combined_list_elem_ptr = unsafe { let combined_list_elem_ptr = unsafe {
builder.build_in_bounds_gep( builder.build_in_bounds_gep(
offset_combined_list_elem_ptr, offset_combined_list_elem_ptr,
&[curr_second_index], &[second_index],
"load_index_combined_list", "load_index_combined_list",
) )
}; };