[llvm] r315243 - [llvm-objdump] Use initializer list for scoped xar api constructors
Francis Ricci via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 9 13:27:14 PDT 2017
Author: fjricci
Date: Mon Oct 9 13:27:14 2017
New Revision: 315243
URL: http://llvm.org/viewvc/llvm-project?rev=315243&view=rev
Log:
[llvm-objdump] Use initializer list for scoped xar api constructors
Modified:
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=315243&r1=315242&r2=315243&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Mon Oct 9 13:27:14 2017
@@ -206,9 +206,8 @@ typedef DiceTable::iterator dice_table_i
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);
More information about the llvm-commits
mailing list