1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[llvm-objdump] Use initializer list for scoped xar api constructors

llvm-svn: 315243
This commit is contained in:
Francis Ricci 2017-10-09 20:27:14 +00:00
parent a8d5bff9e7
commit a55e7b5513

View 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);