Skip to content

Resolve computed #include directives via SimplePreprocessor#9

Merged
DrGeoff merged 1 commit intomasterfrom
drgeoffathome/computed-include-support
Feb 18, 2026
Merged

Resolve computed #include directives via SimplePreprocessor#9
DrGeoff merged 1 commit intomasterfrom
drgeoffathome/computed-include-support

Conversation

@DrGeoff
Copy link
Owner

@DrGeoff DrGeoff commented Feb 18, 2026

Summary

Fixes #8. Adds support for computed #include directives (e.g. #include XSTR(COMPILETIME_INCLUDE_FILE)) in direct headerdeps mode.

  • Store include argument in PreprocessorDirective during parse_directive_struct() and add include to _extract_conditional_macros() for cache correctness
  • Add resolve_computed_include() to SimplePreprocessor that strips function-like macro wrappers and expands macros
  • Resolve computed includes when building active_includes in preprocessing_cache.py
  • Simplify _create_include_list() in headerdeps.py to use result.active_includes (net code reduction)

Test plan

  • 3 new computed include tests pass (test_computed_include_no_macro, test_computed_include_with_commandline_macro, test_computed_include_with_commandline_macro_cpp)
  • All 20 headerdeps tests pass
  • Full test suite passes (423 passed, 2 skipped)
  • Performance profiling vs v7.0.2 shows no regression (25.6% faster overall in direct mode)

@DrGeoff DrGeoff merged commit 9f6c42e into master Feb 18, 2026
5 checks passed
@DrGeoff DrGeoff deleted the drgeoffathome/computed-include-support branch February 18, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileAnalyzer does not resolve computed #include directives

1 participant