[PATCH] D81063: [DWARFYAML][debug_aranges] Replace InitialLength by Format and Length.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 02:43:09 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/include/llvm/ObjectYAML/DWARFYAML.h:68
+  llvm::dwarf::DwarfFormat Format;
+  uint32_t LengthPrefix;
+  uint64_t Length;
----------------
I wouldn't bother with a length prefix. I'm not sure it's important for testing, because either the parser will read the DWARF64 marker (i.e. 0xffffffff) and treat the next 8 bytes as the rest of the length, or it won't in which case, it will treat those 4 bytes as the actual length, regardless of their value (with possible exceptions for the rest of the reserved range, but those values can be entered as the length in the YAML document anyway).


================
Comment at: llvm/lib/ObjectYAML/DWARFYAML.cpp:78
                                                DWARFYAML::ARange &ARange) {
+  IO.mapRequired("Format", ARange.Format);
+  if (ARange.Format == dwarf::DWARF64)
----------------
I'd make this optional, with DWARF32 as the default. That's going to be the common case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81063/new/

https://reviews.llvm.org/D81063





More information about the llvm-commits mailing list