This removes alot of unnecessary padding, trimming the size of the struct from 728->608 on 64 bit platforms.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Good catch, I'll update the script to optionally take an underlying type argument. Should that be part of this change, or a parent?
- Update dump_format_style script
Only tweaked regex to support enum <name> : <words> ... {
Decided there wasn't much to gain from supporting nested types etc
I don't have any major issues with this other than it makes Format.h a bit more ugly. (there are more ugly and harder to understand pieces of code than this change!)
We'll only normally really have 1 of these in play at any one time, but it is passed around quite a bit on the stack, should we care about the extra space it's taking? (I'm ok if the answer is "yes we should")
We only keep one instance on the stack in clang-format. But in tools that embed clang format we may keep more than 1 around. In clangd we are hoping to cache format styles for each file(well directory). As these cached items will live on the heap, saving about 16% from the size is worth it.