mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
remove tbaa_gen and make IR generator module
This commit is contained in:
3
pythonbpf/vmlinux_parser/ir_gen/__init__.py
Normal file
3
pythonbpf/vmlinux_parser/ir_gen/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
from .ir_generation import IRGenerator
|
||||
|
||||
__all__ = ["IRGenerator"]
|
||||
17
pythonbpf/vmlinux_parser/ir_gen/ir_generation.py
Normal file
17
pythonbpf/vmlinux_parser/ir_gen/ir_generation.py
Normal file
@ -0,0 +1,17 @@
|
||||
import logging
|
||||
from pythonbpf.vmlinux_parser.dependency_handler import DependencyHandler
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class IRGenerator:
|
||||
def __init__(self, module, handler: DependencyHandler):
|
||||
self.module = module
|
||||
self.handler: DependencyHandler = handler
|
||||
if not handler.is_ready:
|
||||
raise ImportError(
|
||||
"Semantic analysis of vmlinux imports failed. Cannot generate IR"
|
||||
)
|
||||
for struct in handler:
|
||||
print(struct)
|
||||
print()
|
||||
Reference in New Issue
Block a user