Skip to content

[clang] recognise an ordinary source location without decomposing it - #2345

Open
VladimirMakaev wants to merge 1 commit into
meta:mainfrom
VladimirMakaev:pr/clang-location-1130
Open

VladimirMakaev wants to merge 1 commit into
meta:mainfrom
VladimirMakaev:pr/clang-location-1130

Conversation

@VladimirMakaev

Copy link
Copy Markdown
Contributor

Cache the last examined file's source-location range and final-line offset.
Repeated locations in that file can then avoid an extra SourceManager
decomposition. Keep the existing unterminated-final-line handling and Clang's
fallback for line directives. Extend the CPU-limit fixture to cover an
unterminated final line in the main source as well as an include.

Test plan

73 direct test targets and annotation pass; both 100,000-element exports meet the 60-second CPU limit.
Base/candidate captured ASTs, reports and initializer skips match. Five additional
AST inputs and the skip-bodies guard regression pass. The Linux ARC fixture fails
identically on base and candidate.

Cache the last examined file's source-location range and final-line offset.
Repeated locations in that file can then avoid an extra SourceManager
decomposition. Keep the existing unterminated-final-line handling and Clang's
fallback for line directives. Extend the CPU-limit fixture to cover an
unterminated final line in the main source as well as an include.

## Test plan
73 direct test targets and annotation pass; both 100,000-element exports meet the 60-second CPU limit.
Base/candidate captured ASTs, reports and initializer skips match. Five additional
AST inputs and the skip-bodies guard regression pass. The Linux ARC fixture fails
identically on base and candidate; macOS gate pending.
@meta-cla meta-cla Bot added the CLA Signed label Dec 1, 2026
@dulmarod

dulmarod commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

That looks like a nice perf improvements. Are you able to estimate the perf improvement it provides? It would be interesting to know, no worries if not possible.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants