[DWARF][DebugInfo] Fix off-by-one error in size of DW_TAG_base_type types
authorOCHyams <orlando.hyams@sony.com>
Fri, 21 Jan 2022 10:54:53 +0000 (10:54 +0000)
committerOCHyams <orlando.hyams@sony.com>
Fri, 21 Jan 2022 11:37:49 +0000 (11:37 +0000)
commitb6a41fddcfd375ce30487ef87ca2cd65a6be0bcc
treec48a6d34d62dac8ce059068964b04aabb8f627b3
parent597eae998a874a872b67d1a22a04d7c45d2ef94b
[DWARF][DebugInfo] Fix off-by-one error in size of DW_TAG_base_type types

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).

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D117124
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/test/DebugInfo/X86/base-type-size.ll [new file with mode: 0644]