Repository navigation
Extract pass documentation across all public headers in xls_pass. - #5539
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_passregistration andxls_generate_documentationpreviously inspected onlydirect_public_headers[0]. That produced empty or helper comments and linked to the wrong header forxls_passtargets, silently omittedcc_librarypasses whose implementation file registered a non-first header, and crashed at analysis time if a pass target had no public headers. Separately, an uncommentedOptimizationPasssubclass 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::RegistrationInfoand pass both execroot file paths and repository-relative paths for every public header intoGenerateDocumentationProto. Parse each candidate header once with Clang and resolve exactclass_namematches across all candidate headers before falling back to non-emptyOptimizationPassbase-class comments, recording the matched header's repository-relative path in the generated documentation entry.