Skip to content

Commit 204339a

Browse files
committed
[llvm-objdump] Simplify PrintHelpMessage() logic
llvm-svn: 358418
1 parent 523758e commit 204339a

File tree

2 files changed

+10
-29
lines changed

2 files changed

+10
-29
lines changed

llvm/test/tools/llvm-objdump/X86/macho-private-header.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: llvm-objdump -private-header %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
1+
// RUN: llvm-objdump -macho -private-header %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
22

33
CHECK: Mach header
44
CHECK: magic cputype cpusubtype caps filetype ncmds sizeofcmds flags

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,34 +2021,15 @@ int main(int argc, char **argv) {
20212021
if (DisassembleAll || PrintSource || PrintLines)
20222022
Disassemble = true;
20232023

2024-
if (!Disassemble
2025-
&& !Relocations
2026-
&& !DynamicRelocations
2027-
&& !SectionHeaders
2028-
&& !SectionContents
2029-
&& !SymbolTable
2030-
&& !UnwindInfo
2031-
&& !PrivateHeaders
2032-
&& !FileHeaders
2033-
&& !FirstPrivateHeader
2034-
&& !ExportsTrie
2035-
&& !Rebase
2036-
&& !Bind
2037-
&& !LazyBind
2038-
&& !WeakBind
2039-
&& !RawClangAST
2040-
&& !(UniversalHeaders && MachOOpt)
2041-
&& !ArchiveHeaders
2042-
&& !(IndirectSymbols && MachOOpt)
2043-
&& !(DataInCode && MachOOpt)
2044-
&& !(LinkOptHints && MachOOpt)
2045-
&& !(InfoPlist && MachOOpt)
2046-
&& !(DylibsUsed && MachOOpt)
2047-
&& !(DylibId && MachOOpt)
2048-
&& !(ObjcMetaData && MachOOpt)
2049-
&& !(!FilterSections.empty() && MachOOpt)
2050-
&& !FaultMapSection
2051-
&& DwarfDumpType == DIDT_Null) {
2024+
if (!ArchiveHeaders && !Disassemble && DwarfDumpType == DIDT_Null &&
2025+
!DynamicRelocations && !FileHeaders && !PrivateHeaders && !RawClangAST &&
2026+
!Relocations && !SectionHeaders && !SectionContents && !SymbolTable &&
2027+
!UnwindInfo && !FaultMapSection &&
2028+
!(MachOOpt &&
2029+
(Bind || DataInCode || DylibId || DylibsUsed || ExportsTrie ||
2030+
FirstPrivateHeader || IndirectSymbols || InfoPlist || LazyBind ||
2031+
LinkOptHints || Rebase || ObjcMetaData || UniversalHeaders ||
2032+
WeakBind || !FilterSections.empty()))) {
20522033
cl::PrintHelpMessage();
20532034
return 2;
20542035
}

0 commit comments

Comments
 (0)