Class IRConstructGenerators
Architecture Evolution: Refactored from instance-based to static factory returning GeneratorSet struct. This eliminates 17 getter methods and reduces constructor parameter counts from 1-9 down to 2 uniform parameters: (IRGenerationContext, GeneratorSet).
Thread Safety: Each construct gets its own GeneratorSet instance via unique IRGenerationContext, ensuring thread isolation during parallel construct generation.
Performance: Reduces object creation from ~75 objects per class (with 5 methods) to ~15 objects total. Expected reduction: 80% fewer objects per construct.
Extension Strategy: Adding new generators: 1. Add field to GeneratorSet 2. Populate in create() method 3. Use via generators.fieldName in dependent code
-
Method Summary
Modifier and TypeMethodDescriptionstatic GeneratorSetcreate(IRGenerationContext stackContext) Creates the complete generator tree for a single construct.
-
Method Details
-
create
Creates the complete generator tree for a single construct.PHASE 3 COMPLETE: GeneratorSet struct pattern eliminates forward method references and resolves circular dependencies naturally. All generators now use uniform 2-parameter constructors: (IRGenerationContext, GeneratorSet).
IR REFACTORING COMPLETE: Added 10 new IR generation helpers (Phase 1-3): - 5 universal helpers (scoped execution, operator invocation, literal loading, boolean extraction) - 3 composite helpers (comparison evaluation, chained comparison, increment) - 1 domain-specific helper (direction check for polymorphic for-range)
- Parameters:
stackContext- The IR generation context for this construct (thread-isolated)- Returns:
- Populated GeneratorSet with 34 fields (15 helpers + 19 generators) ready to use
-