mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
rename a function
This commit is contained in:
parent
972c5d78d3
commit
4426f5793b
1 changed files with 6 additions and 6 deletions
|
@ -1458,7 +1458,7 @@ fn build_wrapped_tag<'a, 'ctx, 'env>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tag_alloca<'a, 'ctx, 'env>(
|
pub fn entry_block_alloca_zerofill<'a, 'ctx, 'env>(
|
||||||
env: &Env<'a, 'ctx, 'env>,
|
env: &Env<'a, 'ctx, 'env>,
|
||||||
basic_type: BasicTypeEnum<'ctx>,
|
basic_type: BasicTypeEnum<'ctx>,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
@ -1572,7 +1572,7 @@ fn build_tag<'a, 'ctx, 'env>(
|
||||||
let wrapper_type = env
|
let wrapper_type = env
|
||||||
.context
|
.context
|
||||||
.struct_type(&[internal_type, tag_id_type.into()], false);
|
.struct_type(&[internal_type, tag_id_type.into()], false);
|
||||||
let result_alloca = tag_alloca(env, wrapper_type.into(), "opaque_tag");
|
let result_alloca = entry_block_alloca_zerofill(env, wrapper_type.into(), "opaque_tag");
|
||||||
|
|
||||||
// Determine types
|
// Determine types
|
||||||
let num_fields = arguments.len() + 1;
|
let num_fields = arguments.len() + 1;
|
||||||
|
@ -2037,7 +2037,7 @@ fn lookup_at_index_ptr2<'a, 'ctx, 'env>(
|
||||||
let field_type = basic_type_from_layout(env, &field_layout);
|
let field_type = basic_type_from_layout(env, &field_layout);
|
||||||
|
|
||||||
let align_bytes = field_layout.alignment_bytes(env.target_info);
|
let align_bytes = field_layout.alignment_bytes(env.target_info);
|
||||||
let alloca = tag_alloca(env, field_type, "copied_tag");
|
let alloca = entry_block_alloca_zerofill(env, field_type, "copied_tag");
|
||||||
if align_bytes > 0 {
|
if align_bytes > 0 {
|
||||||
let size = env
|
let size = env
|
||||||
.ptr_int()
|
.ptr_int()
|
||||||
|
@ -2404,7 +2404,7 @@ pub fn load_roc_value<'a, 'ctx, 'env>(
|
||||||
name: &str,
|
name: &str,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
if layout.is_passed_by_reference() {
|
if layout.is_passed_by_reference() {
|
||||||
let alloca = tag_alloca(env, basic_type_from_layout(env, &layout), name);
|
let alloca = entry_block_alloca_zerofill(env, basic_type_from_layout(env, &layout), name);
|
||||||
|
|
||||||
store_roc_value(env, layout, alloca, source.into());
|
store_roc_value(env, layout, alloca, source.into());
|
||||||
|
|
||||||
|
@ -2421,7 +2421,7 @@ pub fn use_roc_value<'a, 'ctx, 'env>(
|
||||||
name: &str,
|
name: &str,
|
||||||
) -> BasicValueEnum<'ctx> {
|
) -> BasicValueEnum<'ctx> {
|
||||||
if layout.is_passed_by_reference() {
|
if layout.is_passed_by_reference() {
|
||||||
let alloca = tag_alloca(env, basic_type_from_layout(env, &layout), name);
|
let alloca = entry_block_alloca_zerofill(env, basic_type_from_layout(env, &layout), name);
|
||||||
|
|
||||||
env.builder.build_store(alloca, source);
|
env.builder.build_store(alloca, source);
|
||||||
|
|
||||||
|
@ -4642,7 +4642,7 @@ pub fn call_roc_function<'a, 'ctx, 'env>(
|
||||||
let mut arguments = Vec::from_iter_in(it, env.arena);
|
let mut arguments = Vec::from_iter_in(it, env.arena);
|
||||||
|
|
||||||
let result_type = basic_type_from_layout(env, result_layout);
|
let result_type = basic_type_from_layout(env, result_layout);
|
||||||
let result_alloca = tag_alloca(env, result_type, "result_value");
|
let result_alloca = entry_block_alloca_zerofill(env, result_type, "result_value");
|
||||||
|
|
||||||
arguments.push(result_alloca.into());
|
arguments.push(result_alloca.into());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue