OSDN Git Service

[llvm-objdump] Use initializer list for scoped xar api constructors
authorFrancis Ricci <francisjricci@gmail.com>
Mon, 9 Oct 2017 20:27:14 +0000 (20:27 +0000)
committerFrancis Ricci <francisjricci@gmail.com>
Mon, 9 Oct 2017 20:27:14 +0000 (20:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315243 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objdump/MachODump.cpp

index 91ec7fe..a8aeb14 100644 (file)
@@ -206,9 +206,8 @@ typedef DiceTable::iterator dice_table_iterator;
 namespace {
 struct ScopedXarFile {
   xar_t xar;
-  ScopedXarFile(const char *filename, int32_t flags) {
-    xar = xar_open(filename, flags);
-  }
+  ScopedXarFile(const char *filename, int32_t flags)
+      : xar(xar_open(filename, flags)) {}
   ~ScopedXarFile() {
     if (xar)
       xar_close(xar);
@@ -220,7 +219,7 @@ struct ScopedXarFile {
 
 struct ScopedXarIter {
   xar_iter_t iter;
-  ScopedXarIter() { iter = xar_iter_new(); }
+  ScopedXarIter() : iter(xar_iter_new()) {}
   ~ScopedXarIter() {
     if (iter)
       xar_iter_free(iter);