[cfe-dev] dump-record-layouts doesn't output field sizes or alignment spaces

Leonardo Santagada via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 8 15:15:13 PST 2021


Hi,

Is there a reason why -fdump-record-layouts doesn't show the size of
each of the members of the records and/or the alignment spaces between
them? For simple examples it is pretty easy to understand what those
are, but for more complex cases and for parsing these results into
other tools it's way more complicated than it needs to be.

Is there a particular reason for not printing it, or maybe the problem
is that I'm using the wrong thing to find out all classes which have
space being used by alignment?

Also the MSVC output in this case is very explicit with the alignment
spaces being inserted between members.

Maybe the tool I should be using for this is pahole[1] ? The only
problem I have with it is that I can only use it on DWARF emitting
platforms (and to my misery I need it on windows).

[1](https://manpages.debian.org/unstable/dwarves/pahole.1.en.html)

-- 

Leonardo Santagada


More information about the cfe-dev mailing list