Add remaining docstrings to complete documentation coverage

Co-authored-by: varun-r-mallya <100590632+varun-r-mallya@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-08 17:25:29 +00:00
parent cdf4f3e885
commit d9dfb61000
10 changed files with 70 additions and 0 deletions

View File

@ -1,3 +1,5 @@
"""Registry for statement handler functions."""
from typing import Dict
@ -11,6 +13,7 @@ class StatementHandlerRegistry:
"""Register a handler for a specific statement type."""
def decorator(handler):
"""Decorator that registers the handler."""
cls._handlers[stmt_type] = handler
return handler

View File

@ -25,11 +25,20 @@ logger = logging.getLogger(__name__)
@dataclass
class LocalSymbol:
"""
Represents a local variable in a BPF function.
Attributes:
var: LLVM IR alloca instruction for the variable
ir_type: LLVM IR type of the variable
metadata: Optional metadata (e.g., struct type name)
"""
var: ir.AllocaInstr
ir_type: ir.Type
metadata: Any = None
def __iter__(self):
"""Support tuple unpacking of LocalSymbol."""
yield self.var
yield self.ir_type
yield self.metadata
@ -692,6 +701,7 @@ def infer_return_type(func_node: ast.FunctionDef):
found_type = None
def _expr_type(e):
"""Helper function to extract type from an expression."""
if e is None:
return "None"
if isinstance(e, ast.Constant):