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

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 13:30:00 PDT 2017


fjricci added inline comments.


================
Comment at: llvm/trunk/tools/llvm-objdump/MachODump.cpp:222
+  xar_iter_t iter;
+  ScopedXarIter() { iter = xar_iter_new(); }
+  ~ScopedXarIter() {
----------------
dblaikie wrote:
> Consider using the init list:
> 
>   ScopedXarIter() : iter(xar_iter_new()) {}
> 
> (or I guess maybe even a NSDMI:
> 
>   xar_iter_t iter = xar_iter_new();
> 
> )
Used initializer list in rL315243. (Not a big fan of the NSDMI because we need to define a destructor anyway)


Repository:
  rL LLVM

https://reviews.llvm.org/D38598





More information about the llvm-commits mailing list