diff options
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
| -rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 246d5cfa0581..93fed8ee8e6f 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -27,12 +27,10 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetOperations.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/StringSet.h" #include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/Wasm.h" #include "llvm/DebugInfo/BTF/BTFParser.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" -#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" #include "llvm/DebugInfo/Symbolize/Symbolize.h" #include "llvm/Debuginfod/BuildIDFetcher.h" #include "llvm/Debuginfod/Debuginfod.h" @@ -40,7 +38,6 @@ #include "llvm/Demangle/Demangle.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" -#include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/MC/MCDisassembler/MCRelocationInfo.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstPrinter.h" @@ -50,7 +47,6 @@ #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCTargetOptions.h" #include "llvm/MC/TargetRegistry.h" -#include "llvm/Object/Archive.h" #include "llvm/Object/BuildID.h" #include "llvm/Object/COFF.h" #include "llvm/Object/COFFImportFile.h" @@ -59,7 +55,6 @@ #include "llvm/Object/FaultMapParser.h" #include "llvm/Object/MachO.h" #include "llvm/Object/MachOUniversal.h" -#include "llvm/Object/ObjectFile.h" #include "llvm/Object/OffloadBinary.h" #include "llvm/Object/Wasm.h" #include "llvm/Option/Arg.h" @@ -99,10 +94,11 @@ namespace { class CommonOptTable : public opt::GenericOptTable { public: - CommonOptTable(ArrayRef<Info> OptionInfos, const char *Usage, + CommonOptTable(const char *StrTable, ArrayRef<unsigned> PrefixesTable, + ArrayRef<Info> OptionInfos, const char *Usage, const char *Description) - : opt::GenericOptTable(OptionInfos), Usage(Usage), - Description(Description) { + : opt::GenericOptTable(StrTable, PrefixesTable, OptionInfos), + Usage(Usage), Description(Description) { setGroupedShortOptions(true); } @@ -121,12 +117,13 @@ private: // ObjdumpOptID is in ObjdumpOptID.h namespace objdump_opt { -#define PREFIX(NAME, VALUE) \ - static constexpr StringLiteral NAME##_init[] = VALUE; \ - static constexpr ArrayRef<StringLiteral> NAME(NAME##_init, \ - std::size(NAME##_init) - 1); +#define OPTTABLE_STR_TABLE_CODE #include "ObjdumpOpts.inc" -#undef PREFIX +#undef OPTTABLE_STR_TABLE_CODE + +#define OPTTABLE_PREFIXES_TABLE_CODE +#include "ObjdumpOpts.inc" +#undef OPTTABLE_PREFIXES_TABLE_CODE static constexpr opt::OptTable::Info ObjdumpInfoTable[] = { #define OPTION(...) \ @@ -139,9 +136,10 @@ static constexpr opt::OptTable::Info ObjdumpInfoTable[] = { class ObjdumpOptTable : public CommonOptTable { public: ObjdumpOptTable() - : CommonOptTable(objdump_opt::ObjdumpInfoTable, - " [options] <input object files>", - "llvm object file dumper") {} + : CommonOptTable( + objdump_opt::OptionStrTable, objdump_opt::OptionPrefixesTable, + objdump_opt::ObjdumpInfoTable, " [options] <input object files>", + "llvm object file dumper") {} }; enum OtoolOptID { @@ -152,12 +150,13 @@ enum OtoolOptID { }; namespace otool { -#define PREFIX(NAME, VALUE) \ - static constexpr StringLiteral NAME##_init[] = VALUE; \ - static constexpr ArrayRef<StringLiteral> NAME(NAME##_init, \ - std::size(NAME##_init) - 1); +#define OPTTABLE_STR_TABLE_CODE +#include "OtoolOpts.inc" +#undef OPTTABLE_STR_TABLE_CODE + +#define OPTTABLE_PREFIXES_TABLE_CODE #include "OtoolOpts.inc" -#undef PREFIX +#undef OPTTABLE_PREFIXES_TABLE_CODE static constexpr opt::OptTable::Info OtoolInfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO_WITH_ID_PREFIX(OTOOL_, __VA_ARGS__), @@ -169,7 +168,8 @@ static constexpr opt::OptTable::Info OtoolInfoTable[] = { class OtoolOptTable : public CommonOptTable { public: OtoolOptTable() - : CommonOptTable(otool::OtoolInfoTable, " [option...] [file...]", + : CommonOptTable(otool::OptionStrTable, otool::OptionPrefixesTable, + otool::OtoolInfoTable, " [option...] [file...]", "Mach-O object file displaying tool") {} }; |
