format chore

This commit is contained in:
2025-10-24 02:40:07 +05:30
parent 4e01df735f
commit f18a4399ea
5 changed files with 29 additions and 22 deletions

View File

@ -1,5 +1,4 @@
import ast
import ctypes
import logging
from llvmlite import ir
@ -246,12 +245,16 @@ def _allocate_for_attribute(builder, var_name, rval, local_sym_tab, structs_sym_
# Handle vmlinux struct field access
vmlinux_struct_name = struct_type.__name__
if not VmlinuxHandlerRegistry.has_field(vmlinux_struct_name, field_name):
logger.error(f"Field '{field_name}' not found in vmlinux struct '{vmlinux_struct_name}'")
logger.error(
f"Field '{field_name}' not found in vmlinux struct '{vmlinux_struct_name}'"
)
return
field_type: tuple[ir.GlobalVariable, Field] = VmlinuxHandlerRegistry.get_field_type(vmlinux_struct_name, field_name)
field_type: tuple[ir.GlobalVariable, Field] = (
VmlinuxHandlerRegistry.get_field_type(vmlinux_struct_name, field_name)
)
field_ir, field = field_type
#TODO: For now, we only support integer type allocations.
# TODO: For now, we only support integer type allocations.
# 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.
@ -270,7 +273,9 @@ def _allocate_for_attribute(builder, var_name, rval, local_sym_tab, structs_sym_
var = _allocate_with_type(builder, var_name, actual_ir_type)
local_sym_tab[var_name] = LocalSymbol(var, actual_ir_type, field)
logger.info(f"Pre-allocated {var_name} from vmlinux struct {vmlinux_struct_name}.{field_name}")
logger.info(
f"Pre-allocated {var_name} from vmlinux struct {vmlinux_struct_name}.{field_name}"
)
return
else:
logger.error(f"Struct type '{struct_type}' not found")