irx.builder.runtime.registry

irx.builder.runtime.registry

Source: packages/irx/src/irx/builder/runtime/registry.py

title: Runtime feature registry and per-module activation state.

Functions

get_default_runtime_feature_registry() -> RuntimeFeatureRegistry

title: Build the default runtime feature registry.
returns:
  type: RuntimeFeatureRegistry

Classes

RuntimeFeatureRegistry

title: Registry of named runtime features.
attributes:
  _features:
    type: dict[str, RuntimeFeature]

Methods

register(self, feature: RuntimeFeature) -> None
title: Register a runtime feature by name.
parameters:
  feature:
    type: RuntimeFeature
get(self, name: str) -> RuntimeFeature
title: Return a runtime feature by name.
parameters:
  name:
    type: str
returns:
  type: RuntimeFeature
names(self) -> tuple[str, ...]
title: Return the registered runtime feature names.
returns:
  type: tuple[str, Ellipsis]

RuntimeFeatureState

title: Track feature activation and symbol declarations for one module.
attributes:
  _owner:
    type: VisitorProtocol
  _registry:
    type: RuntimeFeatureRegistry
  _active_features:
    type: set[str]
  _declared_symbols:
    type: dict[tuple[str, str], ir.Function]

Methods

activate(self, feature_name: str) -> None
title: Activate a runtime feature for the current module.
parameters:
  feature_name:
    type: str
is_active(self, feature_name: str) -> bool
title: Return whether a feature is active for the current module.
parameters:
  feature_name:
    type: str
returns:
  type: bool
active_feature_names(self) -> tuple[str, ...]
title: Return the active feature names.
returns:
  type: tuple[str, Ellipsis]
feature(self, feature_name: str) -> RuntimeFeature
title: Return a registered feature by name.
parameters:
  feature_name:
    type: str
returns:
  type: RuntimeFeature
feature_declares_symbol(self, feature_name: str, symbol_name: str) -> bool
title: Return whether one feature declares one symbol.
parameters:
  feature_name:
    type: str
  symbol_name:
    type: str
returns:
  type: bool
require_symbol(self, feature_name: str, symbol_name: str) -> ir.Function
title: Activate a feature and declare one of its external symbols.
parameters:
  feature_name:
    type: str
  symbol_name:
    type: str
returns:
  type: ir.Function
native_artifacts(self) -> tuple[NativeArtifact, ...]
title: Return the native artifacts required by active features.
returns:
  type: tuple[NativeArtifact, Ellipsis]
linker_flags(self) -> tuple[str, ...]
title: Return the linker flags required by active features.
returns:
  type: tuple[str, Ellipsis]