generate IR partly

This commit is contained in:
2025-10-25 04:40:58 +05:30
parent c6b5ecb47e
commit 028d9c2c08
3 changed files with 46 additions and 4 deletions

View File

@ -245,13 +245,17 @@ def _allocate_for_attribute(builder, var_name, rval, local_sym_tab, structs_sym_
# loaded_value = builder.load(field_ir, align=8)
# #TODO: fatal flaw that this always assumes first argument of function to be the context of what this gets.
# base_ptr = builder.function.args[0]
base_ptr = builder.function.args[0]
local_sym_tab[
struct_var
].var = base_ptr # This is repurposing of var to store the pointer of the base type
local_sym_tab[struct_var].ir_type = field_ir
# gep_result = builder.gep(
# base_ptr,
# [loaded_value],
# inbounds=False, # Not using inbounds GEP
# )
# print("DEBB", loaded_value, base_ptr, gep_result)
# print("DEBUG", loaded_value, base_ptr, gep_result)
# Use i64 for allocation since that's what the global variable contains
actual_ir_type = ir.IntType(64)