mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
already do some of the llvm struct_gep conversion work
This commit is contained in:
parent
0f46ea83d0
commit
bc9c813fec
4 changed files with 183 additions and 46 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue