already do some of the llvm struct_gep conversion work

This commit is contained in:
Folkert 2022-12-19 19:57:31 +01:00
parent 0f46ea83d0
commit bc9c813fec
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 183 additions and 46 deletions

View file

@ -14,6 +14,7 @@ use roc_mono::ir::LookupType;
use roc_mono::layout::{Builtin, Layout, LayoutIds, UnionLayout};
use roc_region::all::Region;
use super::build::BuilderExt;
use super::build::{
add_func, load_roc_value, load_symbol_and_layout, use_roc_value, FunctionSpec, LlvmBackendMode,
Scope, WhenRecursive,
@ -529,7 +530,12 @@ fn load_tag_data<'a, 'ctx, 'env>(
) -> BasicValueEnum<'ctx> {
let raw_data_ptr = env
.builder
.build_struct_gep(tag_value, RocUnion::TAG_DATA_INDEX, "tag_data")
.new_build_struct_gep(
tag_type.into_struct_type(),
tag_value,
RocUnion::TAG_DATA_INDEX,
"tag_data",
)
.unwrap();
let data_ptr = env.builder.build_pointer_cast(