[PATCH] D95518: [Debug-Info][XCOFF] support dwarf for XCOFF in assembly path
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 20:49:35 PST 2021
ikudrin added inline comments.
================
Comment at: llvm/lib/MC/MCDwarf.cpp:492
+ if (!(!MCOS->getContext().getAsmInfo()->requiredDwarfSectionSize() &&
+ isa<MCAsmStreamer>(MCOS))) {
+ if (context.getDwarfFormat() == dwarf::DWARF64)
----------------
The code breaks the abstraction of `MCAsmStream` and calculates `PreHeaderLengthBytes` differently depending on the concrete implementation of the base class. Yes, that is much simpler to write, but much harder to understand, because the semantic of `PreHeaderLengthBytes` becomes vague, resulting in weird and misleading code. I believe that should be avoided at all costs.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95518/new/
https://reviews.llvm.org/D95518
More information about the llvm-commits
mailing list