[llvm-reaodbj] Simplify code. No functional change (intended).

llvm-svn: 246676
This commit is contained in:
Davide Italiano 2015-09-02 16:53:25 +00:00
parent 77c8b7ffd3
commit 37ff06aedf
1 changed files with 8 additions and 24 deletions

View File

@ -7118,36 +7118,20 @@ static void PrintSegmentCommand(uint32_t cmd, uint32_t cmdsize,
MachO::VM_PROT_EXECUTE)) != 0) MachO::VM_PROT_EXECUTE)) != 0)
outs() << " maxprot ?" << format("0x%08" PRIx32, maxprot) << "\n"; outs() << " maxprot ?" << format("0x%08" PRIx32, maxprot) << "\n";
else { else {
if (maxprot & MachO::VM_PROT_READ) outs() << " maxprot ";
outs() << " maxprot r"; outs() << ((maxprot & MachO::VM_PROT_READ) ? "r" : "-");
else outs() << ((maxprot & MachO::VM_PROT_WRITE) ? "w" : "-");
outs() << " maxprot -"; outs() << ((maxprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n");
if (maxprot & MachO::VM_PROT_WRITE)
outs() << "w";
else
outs() << "-";
if (maxprot & MachO::VM_PROT_EXECUTE)
outs() << "x\n";
else
outs() << "-\n";
} }
if ((initprot & if ((initprot &
~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE |
MachO::VM_PROT_EXECUTE)) != 0) MachO::VM_PROT_EXECUTE)) != 0)
outs() << " initprot ?" << format("0x%08" PRIx32, initprot) << "\n"; outs() << " initprot ?" << format("0x%08" PRIx32, initprot) << "\n";
else { else {
if (initprot & MachO::VM_PROT_READ) outs() << " initprot ";
outs() << " initprot r"; outs() << ((initprot & MachO::VM_PROT_READ) ? "r" : "-");
else outs() << ((initprot & MachO::VM_PROT_WRITE) ? "w" : "-");
outs() << " initprot -"; outs() << ((initprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n");
if (initprot & MachO::VM_PROT_WRITE)
outs() << "w";
else
outs() << "-";
if (initprot & MachO::VM_PROT_EXECUTE)
outs() << "x\n";
else
outs() << "-\n";
} }
} else { } else {
outs() << " maxprot " << format("0x%08" PRIx32, maxprot) << "\n"; outs() << " maxprot " << format("0x%08" PRIx32, maxprot) << "\n";