Replace usage of get_key_ptr with get_or_create_ptr_from_arg

This commit is contained in:
Pragyansh Chaturvedi
2025-10-01 18:25:22 +05:30
parent 8dd2746411
commit ffcd2de44d
2 changed files with 7 additions and 24 deletions

View File

@ -38,7 +38,7 @@ def create_int_constant_ptr(value, builder, int_width=64):
def get_or_create_ptr_from_arg(arg, builder, local_sym_tab):
"""Extract key pointer from the call arguments."""
"""Extract or create pointer from the call arguments."""
if isinstance(arg, ast.Name):
ptr = get_var_ptr_from_name(arg.id, local_sym_tab)
@ -46,5 +46,5 @@ def get_or_create_ptr_from_arg(arg, builder, local_sym_tab):
ptr = create_int_constant_ptr(arg.value, builder)
else:
raise NotImplementedError(
"Only simple variable names are supported as keys in map lookup.")
"Only simple variable names are supported as args in map helpers.")
return ptr