[PATCH] D38598: [llvm-objdump] Add RAII for xar apis

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 11:18:18 PDT 2017


dblaikie added inline comments.


================
Comment at: llvm/trunk/tools/llvm-objdump/MachODump.cpp:206
+namespace {
+struct ScopedXarFile {
+  xar_t xar;
----------------
I'd consider dropping the "Scoped" suffix & just having XarFile and XarIterator - but up to you.


================
Comment at: llvm/trunk/tools/llvm-objdump/MachODump.cpp:222
+  xar_iter_t iter;
+  ScopedXarIter() { iter = xar_iter_new(); }
+  ~ScopedXarIter() {
----------------
Consider using the init list:

  ScopedXarIter() : iter(xar_iter_new()) {}

(or I guess maybe even a NSDMI:

  xar_iter_t iter = xar_iter_new();

)


Repository:
  rL LLVM

https://reviews.llvm.org/D38598





More information about the llvm-commits mailing list