compiler/stage2_l0/src/sem_context.l0

Module sem_context

Overview Symbols grouped by source file: compiler/stage2_l0/src/sem_context.l0

Module: sem_context

Source: compiler/stage2_l0/src/sem_context.l0 Language: Dea/L0

Imports / Includes

  • signatures
  • types
  • locals
  • ast
  • util.diag
  • driver
  • std.vector
  • std.text
  • name_resolver
  • std.hashmap

Symbols

Enum VarRefResolution

VarRefResolution

Defines the VarRefResolution enumeration.

Variants:

  • VAR_RES_LOCAL
  • VAR_RES_MODULE

Function analysis_owned_type_map_put

func analysis_owned_type_map_put(map: StringPtrMap*, key: string, ty: Type*)

Replace one owned type-map entry with a clone of ty .

Analysis type maps own their values. Centralizing replacement here keeps insert and overwrite paths symmetric: an existing value is freed exactly once, while the caller retains ownership of ty .

Parameters:

  • map: Owned Type* value map.
  • key: Entry key.
  • ty: Borrowed type to clone into the map.

Function analysis_result_free

func analysis_result_free(self: AnalysisResult*)

Free an analysis result and all owned semantic tables.

Parameters:

  • self: Analysis result to free.

Function analysis_has_errors

func analysis_has_errors(self: AnalysisResult*) -> bool

Report whether analysis produced any errors.

Parameters:

  • self: Analysis result to inspect.

Returns: true if the diagnostic collector contains an error.

Function analysis_diag_count

func analysis_diag_count(self: AnalysisResult*) -> int

Return the number of diagnostics produced by analysis.

Parameters:

  • self: Analysis result to inspect.

Returns: Total diagnostic count.

Function analysis_diag_get

func analysis_diag_get(self: AnalysisResult*, index: int) -> Diagnostic*

Return a diagnostic from the analysis result.

Parameters:

  • self: Analysis result to inspect.
  • index: Zero-based diagnostic index.

Returns: Diagnostic at index.

Function analysis_source_names

func analysis_source_names(self: AnalysisResult*) -> StringVector*

Return source filenames captured during driver analysis.

Parameters:

  • self: Analysis result to inspect.

Returns: Vector of source filenames.

Function analysis_source_texts

func analysis_source_texts(self: AnalysisResult*) -> StringVector*

Return source texts captured during driver analysis.

Parameters:

  • self: Analysis result to inspect.

Returns: Vector of source texts aligned with analysis_source_names.

Function analysis_name_resolution

func analysis_name_resolution(self: AnalysisResult*) -> NameResolution*?

Return the name-resolution tables, if available.

Parameters:

  • self: Analysis result to inspect.

Returns: Name-resolution result, or null if analysis stopped earlier.

Function analysis_signature_tables

func analysis_signature_tables(self: AnalysisResult*) -> SignatureTables*?

Return the signature tables, if available.

Parameters:

  • self: Analysis result to inspect.

Returns: Signature tables, or null if analysis stopped earlier.

Function analysis_locals

func analysis_locals(self: AnalysisResult*) -> LocalsResult*?

Return locals-resolution results, if available.

Parameters:

  • self: Analysis result to inspect.

Returns: Locals result, or null if analysis stopped earlier.

Function analysis_expr_key

func analysis_expr_key(module_name: string, expr_id: ExprId) -> string

Build the storage key used for per-expression analysis tables.

Parameters:

  • module_name: Owning module name.
  • expr_id: Expression id.

Returns: Key in module::id form.

Function analysis_get_expr_type

func analysis_get_expr_type(self: AnalysisResult*, module_name: string, expr_id: ExprId) -> Type*?

Return a cloned resolved expression type when present.

Parameters:

  • self: Analysis result to inspect.
  • module_name: Owning module name.
  • expr_id: Expression id.

Returns: Cloned expression type, or null when absent.

Function analysis_get_intrinsic_target

func analysis_get_intrinsic_target(self: AnalysisResult*, module_name: string, expr_id: ExprId) -> Type*?

Return a cloned intrinsic target type when present.

Parameters:

  • self: Analysis result to inspect.
  • module_name: Owning module name.
  • expr_id: Expression id.

Returns: Cloned target type, or null when absent.

Function analysis_get_var_ref_resolution

func analysis_get_var_ref_resolution(self: AnalysisResult*, module_name: string, expr_id: ExprId) -> int?

Return the stored variable-resolution kind when present.

Parameters:

  • self: Analysis result to inspect.
  • module_name: Owning module name.
  • expr_id: Expression id.

Returns: Stored resolution kind as an int, or null when absent.

Function analysis_is_arc_type

func analysis_is_arc_type(ty: Type*) -> bool

Report whether a type is directly ARC-managed.

Parameters:

  • ty: Type to inspect.

Returns: true when ty is a string.

Function analysis_has_arc_data

func analysis_has_arc_data(self: AnalysisResult*, ty: Type*) -> bool

Report whether a type transitively contains ARC-managed data.

Parameters:

  • self: Analysis result providing resolved struct/enum metadata.
  • ty: Type to inspect.

Returns: true when values of ty need ARC cleanup.

Struct AnalysisResult

Represents the AnalysisResult structure.

AnalysisResult Field driver_state

driver_state: DriverState*

AnalysisResult Field diags

diags: DiagCollector*

AnalysisResult Field names

names: NameResolution*?

AnalysisResult Field signatures

signatures: SignatureTables*?

AnalysisResult Field locals_result

locals_result: LocalsResult*?

AnalysisResult Field expr_types

expr_types: StringPtrMap*

AnalysisResult Field var_ref_resolution

var_ref_resolution: StringIntMap*

AnalysisResult Field intrinsic_targets

intrinsic_targets: StringPtrMap*