From 204339a2348d179206fc41c9fa3b6f827281fba5 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 15 Apr 2019 15:52:32 +0000 Subject: [PATCH] [llvm-objdump] Simplify PrintHelpMessage() logic llvm-svn: 358418 --- .../X86/macho-private-header.test | 2 +- llvm/tools/llvm-objdump/llvm-objdump.cpp | 37 +++++-------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/llvm/test/tools/llvm-objdump/X86/macho-private-header.test b/llvm/test/tools/llvm-objdump/X86/macho-private-header.test index d90072542a2e..b904bbcf5ec0 100644 --- a/llvm/test/tools/llvm-objdump/X86/macho-private-header.test +++ b/llvm/test/tools/llvm-objdump/X86/macho-private-header.test @@ -1,4 +1,4 @@ -// RUN: llvm-objdump -private-header %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s +// RUN: llvm-objdump -macho -private-header %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s CHECK: Mach header CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index afd137f68457..47a23471f6ba 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -2021,34 +2021,15 @@ int main(int argc, char **argv) { if (DisassembleAll || PrintSource || PrintLines) Disassemble = true; - if (!Disassemble - && !Relocations - && !DynamicRelocations - && !SectionHeaders - && !SectionContents - && !SymbolTable - && !UnwindInfo - && !PrivateHeaders - && !FileHeaders - && !FirstPrivateHeader - && !ExportsTrie - && !Rebase - && !Bind - && !LazyBind - && !WeakBind - && !RawClangAST - && !(UniversalHeaders && MachOOpt) - && !ArchiveHeaders - && !(IndirectSymbols && MachOOpt) - && !(DataInCode && MachOOpt) - && !(LinkOptHints && MachOOpt) - && !(InfoPlist && MachOOpt) - && !(DylibsUsed && MachOOpt) - && !(DylibId && MachOOpt) - && !(ObjcMetaData && MachOOpt) - && !(!FilterSections.empty() && MachOOpt) - && !FaultMapSection - && DwarfDumpType == DIDT_Null) { + if (!ArchiveHeaders && !Disassemble && DwarfDumpType == DIDT_Null && + !DynamicRelocations && !FileHeaders && !PrivateHeaders && !RawClangAST && + !Relocations && !SectionHeaders && !SectionContents && !SymbolTable && + !UnwindInfo && !FaultMapSection && + !(MachOOpt && + (Bind || DataInCode || DylibId || DylibsUsed || ExportsTrie || + FirstPrivateHeader || IndirectSymbols || InfoPlist || LazyBind || + LinkOptHints || Rebase || ObjcMetaData || UniversalHeaders || + WeakBind || !FilterSections.empty()))) { cl::PrintHelpMessage(); return 2; }