Fix PR53163 by rounding the byte size of DW_TAG_base_type types up. Without
this fix we risk emitting types with a truncated size (including rounding
less-than-byte-sized types' sizes down to zero).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | ||
---|---|---|
1585 | You'd think there would be a convenience macro for this, but I'm not finding one. I do have a memory that someone started making some changes to remove the hard-coded assumption about 8-bit bytes, but it's vague and unless someone else can come up with an example of doing this differently, it's not a blocker. | |
llvm/test/DebugInfo/X86/base-type-size.ll | ||
15 | Needs CHECK-NEXT to ensure the name/encoding/byte_size all belong to the same DIE. |
Thanks for taking a look @probinson.
+ Use CHECK-NEXT directives in test
+ Use divideCeil instead of inline maths
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | ||
---|---|---|
1585 | I had vague memories about hardcoded 8-bit bytes too. Since you mentioned it, I had a look around in DataLayout but I couldn't find anything that would give me the size of a byte and many of the Datalayout methods appear to assume it's 8 bits. In my rummaging around I did find divideCeil at least, which makes this slightly tidier. |
You'd think there would be a convenience macro for this, but I'm not finding one. I do have a memory that someone started making some changes to remove the hard-coded assumption about 8-bit bytes, but it's vague and unless someone else can come up with an example of doing this differently, it's not a blocker.