Skip to content

Commit ce7b170

Browse files
float vmlinux_assignments_symtab
1 parent c499fe7 commit ce7b170

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pythonbpf/codegen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ def processor(source_code, filename, module):
4545
for func_node in bpf_chunks:
4646
logger.info(f"Found BPF function/struct: {func_node.name}")
4747

48-
vmlinux_proc(tree, module)
48+
vmlinux_assignments_symtab = vmlinux_proc(tree, module)
4949
populate_global_symbol_table(tree, module)
5050
license_processing(tree, module)
5151
globals_processing(tree, module)
5252

5353
structs_sym_tab = structs_proc(tree, module, bpf_chunks)
5454
map_sym_tab = maps_proc(tree, module, bpf_chunks)
55-
func_proc(tree, module, bpf_chunks, map_sym_tab, structs_sym_tab)
55+
func_proc(tree, module, bpf_chunks, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab)
5656

5757
globals_list_creation(tree, module)
5858

pythonbpf/functions/functions_pass.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def process_stmt(
311311

312312

313313
def process_func_body(
314-
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab
314+
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab
315315
):
316316
"""Process the body of a bpf function"""
317317
# TODO: A lot. We just have print -> bpf_trace_printk for now
@@ -350,7 +350,7 @@ def process_func_body(
350350
builder.ret(ir.Constant(ir.IntType(64), 0))
351351

352352

353-
def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_tab):
353+
def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab):
354354
"""Process a single BPF chunk (function) and emit corresponding LLVM IR."""
355355

356356
func_name = func_node.name
@@ -384,7 +384,7 @@ def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_t
384384
builder = ir.IRBuilder(block)
385385

386386
process_func_body(
387-
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab
387+
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab
388388
)
389389
return func
390390

@@ -394,7 +394,7 @@ def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_t
394394
# ============================================================================
395395

396396

397-
def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab):
397+
def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab):
398398
for func_node in chunks:
399399
if is_global_function(func_node):
400400
continue
@@ -407,6 +407,7 @@ def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab):
407407
ctypes_to_ir(infer_return_type(func_node)),
408408
map_sym_tab,
409409
structs_sym_tab,
410+
vmlinux_assignments_symtab
410411
)
411412

412413

0 commit comments

Comments
 (0)