Repository navigation
Mark benchmark.h's public includes as IWYU exports - #2351
Merged
Merged
Conversation
6daf2df split benchmark.h into component headers for 1.10.0, moving benchmark::State to state.h and BENCHMARK to registration.h. The README's Basic usage example still uses both through benchmark.h. When gVisor upgraded from 1.9.5 to 1.10.0 [1], clang-tidy reported missing includes for both names in code that already used the umbrella header [2]. Mark the component includes as exports so Include Cleaner accepts the documented umbrella header as well as the individual headers. [1]: google/gvisor@bd4908a [2]: https://buildkite.com/gvisor/pipeline/builds/52067#01a16b6d-c5cf-43ac-8ca0-ac6a50aed28e
tamird
added a commit
to tamird/gvisor
that referenced
this pull request
Oct 25, 2026
Benchmark 1.10.0 split benchmark.h into component headers without marking them as exports [1]. When gVisor upgraded in bd4908a, Include Cleaner reported missing includes for State, BENCHMARK and DoNotOptimize in code that already included benchmark.h [2]. Backport the export annotations proposed upstream [3] and remove the Benchmark exemption from IgnoreHeaders. Clients can include benchmark.h or a component header directly; clients that include neither should get a missing-include diagnostic. [1]: google/benchmark@6daf2df [2]: https://buildkite.com/gvisor/pipeline/builds/52067#01a16b6d-c5cf-43ac-8ca0-ac6a50aed28e [3]: google/benchmark#2351
LebedevRI
approved these changes
Oct 25, 2026
Collaborator
|
@tamird thank you. |
Contributor
Author
|
Thanks for the speedy review! |
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.
6daf2df split benchmark.h into component headers for 1.10.0,
moving benchmark::State to state.h and BENCHMARK to registration.h.
The README's Basic usage example still uses both through benchmark.h.
When gVisor upgraded from 1.9.5 to 1.10.0 1, clang-tidy reported
missing includes for both names in code that already used the umbrella
header 2.
Mark the component includes as exports so Include Cleaner accepts the
documented umbrella header as well as the individual headers.