Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/declextract: rework consts handling #5682

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

dvyukov
Copy link
Collaborator

@dvyukov dvyukov commented Jan 17, 2025

  • pkg/declextract: move const handling logic from the clang tool
  • pkg/declextract: remove unused includes and defines

Export raw info about consts from the clang tool, and let the Go part handle it.
The less logic is in the clang tool, the better. Also this will allow to remove
unused includes when we know which consts we ended up using.
The more includes we include, the higher the chances we include something
that's broken.
This is nice on its own, but this will also help to prevent
lots of problems when we export more info from the clang tool in future.
The clang tool does not know what will end up in the final descriptions,
so it exports info about all consts that it encounters.
As the result we pull in lots of includes/defines, and lots of kernel
includes/defines are broken or create problems.
So the fewer we have, the better.
@dvyukov dvyukov changed the title dvyukov declextract consts pkg/declextract: rework consts handling Jan 17, 2025
@dvyukov dvyukov requested a review from a-nogikh January 17, 2025 10:23
@dvyukov dvyukov enabled auto-merge January 17, 2025 11:55
@dvyukov dvyukov added this pull request to the merge queue Jan 17, 2025
Merged via the queue into google:master with commit f2cb035 Jan 17, 2025
17 checks passed
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