[PATCH] D81541: [ObjectYAML][DWARF] Implement the .debug_addr section.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 04:20:30 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/lib/ObjectYAML/DWARFEmitter.cpp:73
 
+static void writeInitialLength(const dwarf::DwarfFormat Format,
+                               const uint64_t Length, raw_ostream &OS,
----------------
grimar wrote:
> I'd replace `Format` with `Is64Bit` and put it after `IsLittleEndian`. 
Personally, I prefer explicitly using the `Format` here, if I'm honest. I think it's clearer than a boolean.


================
Comment at: llvm/lib/ObjectYAML/DWARFYAML.cpp:205
+    IO &IO, DWARFYAML::AddrTableEntry &AddrTable) {
+  IO.mapOptional("Format", AddrTable.Format, dwarf::DWARF32);
+  IO.mapOptional("Length", AddrTable.Length);
----------------
grimar wrote:
> Hmmm. I guess `DWARF64` would be more common?
You'd guess wrong :)

DWARF64 generation is only just starting to be supported in MC. DWARF32 is the "standard" format, and being more compact, is used, unless the DWARF section is too big to fit in the 32-bit format. That is very unlikely to ever happen in a current real-world case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81541





More information about the llvm-commits mailing list