[PATCH] D104271: llvm-dwarfdump: Print warnings on invalid DWARF
Jan Kratochvil via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 23 05:22:29 PDT 2021
jankratochvil marked 2 inline comments as done.
jankratochvil added inline comments.
================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:372-375
+ static const char *getSupportedAddressSizes() { return "2, 4, 8"; }
static bool isAddressSizeSupported(unsigned AddressSize) {
return AddressSize == 2 || AddressSize == 4 || AddressSize == 8;
}
----------------
jhenderson wrote:
> This is probably absolutely fine, but I was thinking about it and wondering whether it would make some sense to factor out the commonality into some sort of container, that the string function can iterate over to generate a string, and the bool function can just compare values against. What do you think?
I did not want to code it that myself first as it looked overengineered to me and it still looks so. But why not if there is an agreement upon it. I agree there is no information duplication then.
================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp:75
+ for (const auto &Decl : Decls)
+ Codes.push_back(Decl.getCode());
+
----------------
I have put there a simple iterator instead of `llvm::transform` as it is really shorter and easier to read.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104271/new/
https://reviews.llvm.org/D104271
More information about the llvm-commits
mailing list