Class: Kumi::Core::Analyzer::Passes::IRDependencyPass

Inherits:
PassBase
  • Object
show all
Defined in:
lib/kumi/core/analyzer/passes/ir_dependency_pass.rb

Overview

RESPONSIBILITY: Extract IR-level dependencies for VM execution optimization DEPENDENCIES: :ir_module from LowerToIRPass PRODUCES: :ir_dependencies - Hash mapping declaration names to referenced bindings

:ir_name_index - Hash mapping stored binding names to producing declarations

INTERFACE: new(schema, state).run(errors)

NOTE: This pass extracts actual IR-level dependencies by analyzing :ref operations in the generated IR, providing the dependency information needed for optimized VM scheduling.

Instance Method Summary collapse

Methods inherited from PassBase

#debug, #debug_enabled?, #initialize

Methods included from ErrorReporting

#inferred_location, #raise_localized_error, #raise_syntax_error, #raise_type_error, #report_enhanced_error, #report_error, #report_semantic_error, #report_syntax_error, #report_type_error

Constructor Details

This class inherits a constructor from Kumi::Core::Analyzer::Passes::PassBase

Instance Method Details

#run(_errors) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/kumi/core/analyzer/passes/ir_dependency_pass.rb', line 16

def run(_errors)
  ir_module = get_state(:ir_module, required: true)

  ir_dependencies = build_ir_dependency_map(ir_module)
  ir_name_index = build_ir_name_index(ir_module)

  state.with(:ir_dependencies, ir_dependencies).with(:ir_name_index, ir_name_index)
end