[PATCH] D86192: [obj2yaml] Refactor the .debug_pub* sections dumper.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 00:58:34 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/tools/obj2yaml/dwarf2yaml.cpp:10-19
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h"
+#include "llvm/DebugInfo/DWARF/DWARFDebugPubTable.h"
 #include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
 #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
----------------
LLVM coding guidelines says not to include includes that aren't necessary (because they are transitively included, I believe). I suspect you don't need to add `ArrayRef.h` or `Error.h`, for example. You might need to change your IDE settings.


================
Comment at: llvm/tools/obj2yaml/dwarf2yaml.cpp:132
+  Table.extract(PubSectionData, IsGNUStyle,
+                [](Error Err) { consumeError(std::move(Err)); });
+  ArrayRef<DWARFDebugPubTable::Set> Sets = Table.getData();
----------------
Please add a comment here explaining why it's okay to `consumeError` and continue.


================
Comment at: llvm/tools/obj2yaml/dwarf2yaml.cpp:137
+
+  // FIXME: Currently, obj2yaml only supports dumping the first pub-table.
+  Y.Format = Sets[0].Format;
----------------
Not sure a hyphen there is appropriate.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86192



More information about the llvm-commits mailing list