Skip to content

Mark benchmark.h's public includes as IWYU exports - #2351

Merged
LebedevRI merged 1 commit into
google:mainfrom
tamird:review/benchmark-umbrella-iwyu
Oct 25, 2026
Merged

LebedevRI merged 1 commit into
google:mainfrom
tamird:review/benchmark-umbrella-iwyu

Conversation

@tamird

@tamird tamird commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

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.

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
LebedevRI merged commit 0a78b5d into google:main Oct 25, 2026
104 checks passed
@LebedevRI

Copy link
Copy Markdown
Collaborator

@tamird thank you.

@tamird

tamird commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the speedy review!

@tamird
tamird deleted the review/benchmark-umbrella-iwyu branch October 25, 2026 17:16
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.

2 participants