11import ast
2- import ctypes
32import logging
43
54from llvmlite import ir
@@ -246,12 +245,16 @@ def _allocate_for_attribute(builder, var_name, rval, local_sym_tab, structs_sym_
246245 # Handle vmlinux struct field access
247246 vmlinux_struct_name = struct_type .__name__
248247 if not VmlinuxHandlerRegistry .has_field (vmlinux_struct_name , field_name ):
249- logger .error (f"Field '{ field_name } ' not found in vmlinux struct '{ vmlinux_struct_name } '" )
248+ logger .error (
249+ f"Field '{ field_name } ' not found in vmlinux struct '{ vmlinux_struct_name } '"
250+ )
250251 return
251252
252- field_type : tuple [ir .GlobalVariable , Field ] = VmlinuxHandlerRegistry .get_field_type (vmlinux_struct_name , field_name )
253+ field_type : tuple [ir .GlobalVariable , Field ] = (
254+ VmlinuxHandlerRegistry .get_field_type (vmlinux_struct_name , field_name )
255+ )
253256 field_ir , field = field_type
254- #TODO: For now, we only support integer type allocations.
257+ # TODO: For now, we only support integer type allocations.
255258
256259 # loaded_value = builder.load(field_ir, align=8)
257260 # #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_
270273 var = _allocate_with_type (builder , var_name , actual_ir_type )
271274 local_sym_tab [var_name ] = LocalSymbol (var , actual_ir_type , field )
272275
273- logger .info (f"Pre-allocated { var_name } from vmlinux struct { vmlinux_struct_name } .{ field_name } " )
276+ logger .info (
277+ f"Pre-allocated { var_name } from vmlinux struct { vmlinux_struct_name } .{ field_name } "
278+ )
274279 return
275280 else :
276281 logger .error (f"Struct type '{ struct_type } ' not found" )
0 commit comments