From 37ff06aedfffd3a847d56a3eea11e6af4b849683 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Wed, 2 Sep 2015 16:53:25 +0000 Subject: [PATCH] [llvm-reaodbj] Simplify code. No functional change (intended). llvm-svn: 246676 --- llvm/tools/llvm-objdump/MachODump.cpp | 32 +++++++-------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index a5820b6d3cd1..6b3d579cc9f8 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -7118,36 +7118,20 @@ static void PrintSegmentCommand(uint32_t cmd, uint32_t cmdsize, MachO::VM_PROT_EXECUTE)) != 0) outs() << " maxprot ?" << format("0x%08" PRIx32, maxprot) << "\n"; else { - if (maxprot & MachO::VM_PROT_READ) - outs() << " maxprot r"; - else - outs() << " maxprot -"; - if (maxprot & MachO::VM_PROT_WRITE) - outs() << "w"; - else - outs() << "-"; - if (maxprot & MachO::VM_PROT_EXECUTE) - outs() << "x\n"; - else - outs() << "-\n"; + outs() << " maxprot "; + outs() << ((maxprot & MachO::VM_PROT_READ) ? "r" : "-"); + outs() << ((maxprot & MachO::VM_PROT_WRITE) ? "w" : "-"); + outs() << ((maxprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); } if ((initprot & ~(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | MachO::VM_PROT_EXECUTE)) != 0) outs() << " initprot ?" << format("0x%08" PRIx32, initprot) << "\n"; else { - if (initprot & MachO::VM_PROT_READ) - outs() << " initprot r"; - else - outs() << " initprot -"; - if (initprot & MachO::VM_PROT_WRITE) - outs() << "w"; - else - outs() << "-"; - if (initprot & MachO::VM_PROT_EXECUTE) - outs() << "x\n"; - else - outs() << "-\n"; + outs() << " initprot "; + outs() << ((initprot & MachO::VM_PROT_READ) ? "r" : "-"); + outs() << ((initprot & MachO::VM_PROT_WRITE) ? "w" : "-"); + outs() << ((initprot & MachO::VM_PROT_EXECUTE) ? "x\n" : "-\n"); } } else { outs() << " maxprot " << format("0x%08" PRIx32, maxprot) << "\n";