Documentation
irx.analysis.normalization
irx.analysis.normalization
Source: packages/irx/src/irx/analysis/normalization.py
title: Semantic normalization helpers.
summary: >-
Normalize raw AST operator and flag information into the structured semantic
records used by later analysis and codegen.
Functions
numeric_operand_storage(type_: astx.DataType | None) -> astx.DataType | None
title: >-
Resolve the current scalar representation of a numeric union operand.
summary: >-
Numeric union comparisons already use a shared untagged storage type.
Record that type during analysis rather than asking LLVM operand widths
to choose the comparison domain. This does not enable union arithmetic.
parameters:
type_:
type: astx.DataType | None
returns:
type: astx.DataType | None
normalize_flags(node: astx.AST, *, lhs_type: astx.DataType | None=None, rhs_type: astx.DataType | None=None) -> SemanticFlags
title: Normalize semantic flags from the raw AST node.
parameters:
node:
type: astx.AST
lhs_type:
type: astx.DataType | None
rhs_type:
type: astx.DataType | None
returns:
type: SemanticFlags
normalize_operator(op_code: str, *, result_type: astx.DataType | None, lhs_type: astx.DataType | None=None, rhs_type: astx.DataType | None=None, flags: SemanticFlags | None=None, mode: astx.NumericMode=astx.NumericMode.CHECKED) -> ResolvedOperator
title: Create a normalized operator record.
parameters:
op_code:
type: str
result_type:
type: astx.DataType | None
lhs_type:
type: astx.DataType | None
rhs_type:
type: astx.DataType | None
flags:
type: SemanticFlags | None
mode:
type: astx.NumericMode
returns:
type: ResolvedOperator