Skip to content

Extract pass documentation across all public headers in xls_pass. - #5539

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1028473094
Draft

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_1028473094

Conversation

@copybara-service

Copy link
Copy Markdown

Extract pass documentation across all public headers in xls_pass.

When a pass library exposes multiple public headers with a helper header listed before the primary pass header, xls_pass registration and xls_generate_documentation previously inspected only direct_public_headers[0]. That produced empty or helper comments and linked to the wrong header for xls_pass targets, silently omitted cc_library passes whose implementation file registered a non-first header, and crashed at analysis time if a pass target had no public headers. Separately, an uncommented OptimizationPass subclass in a header recorded an empty fallback match that shadowed later documented base classes and suppressed missing-comment warnings.

Record all candidate public header paths in PassRegistry::RegistrationInfo and pass both execroot file paths and repository-relative paths for every public header into GenerateDocumentationProto. Parse each candidate header once with Clang and resolve exact class_name matches across all candidate headers before falling back to non-empty OptimizationPass base-class comments, recording the matched header's repository-relative path in the generated documentation entry.

When a pass library exposes multiple public headers with a helper header listed before the primary pass header, `xls_pass` registration and `xls_generate_documentation` previously inspected only `direct_public_headers[0]`. That produced empty or helper comments and linked to the wrong header for `xls_pass` targets, silently omitted `cc_library` passes whose implementation file registered a non-first header, and crashed at analysis time if a pass target had no public headers. Separately, an uncommented `OptimizationPass` subclass in a header recorded an empty fallback match that shadowed later documented base classes and suppressed missing-comment warnings.

Record all candidate public header paths in `PassRegistry::RegistrationInfo` and pass both execroot file paths and repository-relative paths for every public header into `GenerateDocumentationProto`. Parse each candidate header once with Clang and resolve exact `class_name` matches across all candidate headers before falling back to non-empty `OptimizationPass` base-class comments, recording the matched header's repository-relative path in the generated documentation entry.

PiperOrigin-RevId: 1028473094

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant