mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Revert "float vmlinux_assignments_symtab"
This reverts commit ce7b170fea.
This commit is contained in:
@ -45,14 +45,14 @@ def processor(source_code, filename, module):
|
|||||||
for func_node in bpf_chunks:
|
for func_node in bpf_chunks:
|
||||||
logger.info(f"Found BPF function/struct: {func_node.name}")
|
logger.info(f"Found BPF function/struct: {func_node.name}")
|
||||||
|
|
||||||
vmlinux_assignments_symtab = vmlinux_proc(tree, module)
|
vmlinux_proc(tree, module)
|
||||||
populate_global_symbol_table(tree, module)
|
populate_global_symbol_table(tree, module)
|
||||||
license_processing(tree, module)
|
license_processing(tree, module)
|
||||||
globals_processing(tree, module)
|
globals_processing(tree, module)
|
||||||
|
|
||||||
structs_sym_tab = structs_proc(tree, module, bpf_chunks)
|
structs_sym_tab = structs_proc(tree, module, bpf_chunks)
|
||||||
map_sym_tab = maps_proc(tree, module, bpf_chunks)
|
map_sym_tab = maps_proc(tree, module, bpf_chunks)
|
||||||
func_proc(tree, module, bpf_chunks, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab)
|
func_proc(tree, module, bpf_chunks, map_sym_tab, structs_sym_tab)
|
||||||
|
|
||||||
globals_list_creation(tree, module)
|
globals_list_creation(tree, module)
|
||||||
|
|
||||||
|
|||||||
@ -311,7 +311,7 @@ def process_stmt(
|
|||||||
|
|
||||||
|
|
||||||
def process_func_body(
|
def process_func_body(
|
||||||
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab
|
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab
|
||||||
):
|
):
|
||||||
"""Process the body of a bpf function"""
|
"""Process the body of a bpf function"""
|
||||||
# TODO: A lot. We just have print -> bpf_trace_printk for now
|
# TODO: A lot. We just have print -> bpf_trace_printk for now
|
||||||
@ -350,7 +350,7 @@ def process_func_body(
|
|||||||
builder.ret(ir.Constant(ir.IntType(64), 0))
|
builder.ret(ir.Constant(ir.IntType(64), 0))
|
||||||
|
|
||||||
|
|
||||||
def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab):
|
def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_tab):
|
||||||
"""Process a single BPF chunk (function) and emit corresponding LLVM IR."""
|
"""Process a single BPF chunk (function) and emit corresponding LLVM IR."""
|
||||||
|
|
||||||
func_name = func_node.name
|
func_name = func_node.name
|
||||||
@ -384,7 +384,7 @@ def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_t
|
|||||||
builder = ir.IRBuilder(block)
|
builder = ir.IRBuilder(block)
|
||||||
|
|
||||||
process_func_body(
|
process_func_body(
|
||||||
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab
|
module, builder, func_node, func, ret_type, map_sym_tab, structs_sym_tab
|
||||||
)
|
)
|
||||||
return func
|
return func
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ def process_bpf_chunk(func_node, module, return_type, map_sym_tab, structs_sym_t
|
|||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|
||||||
|
|
||||||
def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab, vmlinux_assignments_symtab):
|
def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab):
|
||||||
for func_node in chunks:
|
for func_node in chunks:
|
||||||
if is_global_function(func_node):
|
if is_global_function(func_node):
|
||||||
continue
|
continue
|
||||||
@ -407,7 +407,6 @@ def func_proc(tree, module, chunks, map_sym_tab, structs_sym_tab, vmlinux_assign
|
|||||||
ctypes_to_ir(infer_return_type(func_node)),
|
ctypes_to_ir(infer_return_type(func_node)),
|
||||||
map_sym_tab,
|
map_sym_tab,
|
||||||
structs_sym_tab,
|
structs_sym_tab,
|
||||||
vmlinux_assignments_symtab
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user