[llvm-objdump] Simplify PrintHelpMessage() logic

This relands rL358418. It missed one test that should also use -macho
Note, all the other -private-header -exports-trie tests are used
together with -macho.

llvm-svn: 358472
This commit is contained in:
Fangrui Song 2019-04-16 02:37:29 +00:00
parent 474a9679bd
commit 051a699ed6
3 changed files with 13 additions and 31 deletions

View File

@ -1,4 +1,5 @@
RUN: llvm-objdump -exports-trie %p/Inputs/macho-no-exports.dylib | FileCheck %s
RUN: llvm-objdump -macho -exports-trie %p/Inputs/macho-no-exports.dylib | FileCheck %s
; Test that we don't crash with an empty export list.
CHECK: macho-no-exports.dylib: file format Mach-O 64-bit x86-64
CHECK: macho-no-exports.dylib
CHECK: Exports trie:

View File

@ -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

View File

@ -2008,34 +2008,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 || ObjcMetaData || Rebase || UniversalHeaders ||
WeakBind || !FilterSections.empty()))) {
cl::PrintHelpMessage();
return 2;
}