Skip to content

Commit e218e48

Browse files
committed
Pass map_sym_tab to functions pass
1 parent a5a6711 commit e218e48

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

pythonbpf/codegen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def processor(source_code, filename, module):
2727
for func_node in bpf_chunks:
2828
print(f"Found BPF function: {func_node.name}")
2929

30-
maps_proc(tree, module, bpf_chunks)
31-
func_proc(tree, module, bpf_chunks)
30+
map_sym_tab = maps_proc(tree, module, bpf_chunks)
31+
func_proc(tree, module, bpf_chunks, map_sym_tab)
3232
# For now, we will parse the BPF specific parts of AST
3333

3434
# constants_processing(tree, module)

pythonbpf/functions_pass.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def process_bpf_chunk(func_node, module, return_type):
8686

8787
return func
8888

89-
def func_proc(tree, module, chunks):
89+
90+
def func_proc(tree, module, chunks, map_sym_tab):
9091
for func_node in chunks:
9192
is_global = False
9293
for decorator in func_node.decorator_list:

pythonbpf/maps_pass.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def maps_proc(tree, module, chunks):
1717
print(f"Found BPF map: {func_node.name}")
1818
process_bpf_map(func_node, module)
1919
continue
20+
return map_sym_tab
2021

2122

2223
def create_bpf_map(module, map_name, map_params):

0 commit comments

Comments
 (0)