Skip to content

Improve indirection alias resolution and call collection reuse#6

Merged
pixge merged 1 commit intocodex/modify-scaffolding-and-implement-loggingfrom
codex/introduce-intermediate-data-structure-for-caching
Jan 11, 2026
Merged

Improve indirection alias resolution and call collection reuse#6
pixge merged 1 commit intocodex/modify-scaffolding-and-implement-loggingfrom
codex/introduce-intermediate-data-structure-for-caching

Conversation

@pixge
Copy link
Owner

@pixge pixge commented Jan 11, 2026

Motivation

  • Avoid repeated AST call collection and repeated alias chain resolution during indirection analysis to improve performance and testability.
  • Separate pure logic for alias resolution and call collection to make behavior easier to unit-test.
  • Ensure alias chains and class-method call resolution are handled consistently across call graph construction and per-unit analysis.

Description

  • Add pure helpers resolve_alias, collect_calls, and collect_calls_by_unit and use them to build a call_map for reuse across analysis steps.
  • Introduce an alias_cache to memoize alias resolution and update _collect_call_graph to accept call_map and alias_cache for cached lookups.
  • Reuse the call_map when computing resolved calls per unit to avoid repeated CallCollector invocations.
  • Expand tests in tests/test_analyzers.py to cover alias chains and class methods and adapt existing tests to the new helpers.

Testing

  • Ran python -m pytest tests/test_analyzers.py to validate the analyzer helpers and behavior.
  • The test run completed successfully with all tests passing (5 passed).

Codex Task

@pixge pixge merged commit ccf4bc6 into codex/modify-scaffolding-and-implement-logging Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant