@@ -337,13 +337,6 @@ def _allocate_for_attribute(builder, var_name, rval, local_sym_tab, structs_sym_
337337 VmlinuxHandlerRegistry .get_field_type (vmlinux_struct_name , field_name )
338338 )
339339 field_ir , field = field_type
340- # TODO: For now, we only support integer type allocations.
341- # This always assumes first argument of function to be the context struct
342- # base_ptr = builder.function.args[0]
343- # local_sym_tab[
344- # struct_var
345- # ].var = base_ptr # This is repurposing of var to store the pointer of the base type
346- # local_sym_tab[struct_var].ir_type = field_ir
347340
348341 # Determine the actual IR type based on the field's type
349342 actual_ir_type = None
@@ -398,12 +391,12 @@ def _allocate_for_attribute(builder, var_name, rval, local_sym_tab, structs_sym_
398391 )
399392 actual_ir_type = ir .IntType (64 )
400393
401- # Allocate with the actual IR type, not the GlobalVariable
394+ # Allocate with the actual IR type
402395 var = _allocate_with_type (builder , var_name , actual_ir_type )
403- local_sym_tab [var_name ] = LocalSymbol (var , actual_ir_type , field )
396+ local_sym_tab [var_name ] = LocalSymbol (var , actual_ir_type , field ) # <-- Store Field metadata
404397
405398 logger .info (
406- f"Pre-allocated { var_name } from vmlinux struct { vmlinux_struct_name } .{ field_name } "
399+ f"Pre-allocated { var_name } as { actual_ir_type } from vmlinux struct { vmlinux_struct_name } .{ field_name } "
407400 )
408401 return
409402 else :
0 commit comments