support vmlinux enum in map arguments

This commit is contained in:
2025-10-21 04:50:34 +05:30
parent 190baf2674
commit 1a0e21eaa8
4 changed files with 35 additions and 6 deletions

View File

@ -54,6 +54,14 @@ class VmlinuxHandler:
return ir.Constant(ir.IntType(64), value), ir.IntType(64)
return None
def get_vmlinux_enum_value(self, name):
"""Handle vmlinux enum constants by returning LLVM IR constants"""
if self.is_vmlinux_enum(name):
value = self.vmlinux_symtab[name]["value"]
logger.info(f"The value of vmlinux enum {name} = {value}")
return value
return None
def handle_vmlinux_struct(self, struct_name, module, builder):
"""Handle vmlinux struct initializations"""
if self.is_vmlinux_struct(struct_name):