[llvm-readobj] Shrink code a little bit. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano 2015-09-07 20:47:03 +00:00
parent c9e28b8434
commit 2206b4bc38

View File

@ -1399,42 +1399,15 @@ static void printArchiveChild(Archive::Child &C, bool verbose,
// FIXME: this first dash, "-", is for (Mode & S_IFMT) == S_IFREG.
// But there is nothing in sys::fs::perms for S_IFMT or S_IFREG.
outs() << "-";
if (Mode & sys::fs::owner_read)
outs() << "r";
else
outs() << "-";
if (Mode & sys::fs::owner_write)
outs() << "w";
else
outs() << "-";
if (Mode & sys::fs::owner_exe)
outs() << "x";
else
outs() << "-";
if (Mode & sys::fs::group_read)
outs() << "r";
else
outs() << "-";
if (Mode & sys::fs::group_write)
outs() << "w";
else
outs() << "-";
if (Mode & sys::fs::group_exe)
outs() << "x";
else
outs() << "-";
if (Mode & sys::fs::others_read)
outs() << "r";
else
outs() << "-";
if (Mode & sys::fs::others_write)
outs() << "w";
else
outs() << "-";
if (Mode & sys::fs::others_exe)
outs() << "x";
else
outs() << "-";
outs() << ((Mode & sys::fs::owner_read) ? "r" : "-");
outs() << ((Mode & sys::fs::owner_write) ? "w" : "-");
outs() << ((Mode & sys::fs::owner_exe) ? "x" : "-");
outs() << ((Mode & sys::fs::group_read) ? "r" : "-");
outs() << ((Mode & sys::fs::group_write) ? "w" : "-");
outs() << ((Mode & sys::fs::group_exe) ? "x" : "-");
outs() << ((Mode & sys::fs::others_read) ? "r" : "-");
outs() << ((Mode & sys::fs::others_write) ? "w" : "-");
outs() << ((Mode & sys::fs::others_exe) ? "x" : "-");
} else {
outs() << format("0%o ", Mode);
}