[PATCH] D85506: [macho2yaml] Refactor the DWARF section dumpers.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 01:30:16 PDT 2020


grimar added inline comments.


================
Comment at: llvm/tools/obj2yaml/macho2yaml.cpp:29
+      const llvm::object::MachOObjectFile::LoadCommandInfo &LoadCmd,
+      std::unique_ptr<MachOYAML::Object> &Y);
 
----------------
Probably, `std::unique_ptr<MachOYAML::Object> &Y` -> `const MachOYAML::Object &Y`
would express the intention better (doesn't seem you need the ability to really access/change the `std::unique_ptr<...>` holder of `Y`).


================
Comment at: llvm/tools/obj2yaml/macho2yaml.cpp:154
+  else if (SecName == "__debug_str")
+    Err = dumpDebugStrings(DCtx, DWARF);
+
----------------
Why not just something like the following?
```
  if (SecName == "__debug_abbrev")
    return dumpDebugAbbrev(DCtx, DWARF);
  if (SecName == "__debug_aranges")
    return dumpDebugARanges(DCtx, DWARF);
```




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85506



More information about the llvm-commits mailing list