[PATCH] D70111: [DWARF5]Addition of alignment field in the typedef for dwarf5
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 19 11:47:46 PST 2019
dblaikie added a comment.
I have some vague recollection that the DWARF C bindings didn't have stability guarantees? Does that sound familiar to anyone? What sort of changes have been made to them in the past?
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:804-810
+ // attribute in DW_TAG_typedef DIE.
+ if (Tag == dwarf::DW_TAG_typedef && DD->getDwarfVersion() >= 5) {
+ uint32_t AlignInBytes = DTy->getAlignInBytes();
+ if (AlignInBytes > 0)
+ addUInt(Buffer, dwarf::DW_AT_alignment, dwarf::DW_FORM_udata,
+ AlignInBytes);
+ }
----------------
Should there be some general utility/appropriate point to add alignment to any type? (generalized over the other places we're already adding alignment on types (such as in DwarfUnit::constructTypeDIE(DIE &Buffer, const DICompositeType *CTy), maybe other places) - probably doesn't generalize over all places that add DW_AT_alignment, like global/static variables, etc, which is fine)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70111/new/
https://reviews.llvm.org/D70111
More information about the llvm-commits
mailing list