From cd5694ecea2da1990365f46f9737be1b29d94f0c Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 22 Jan 2025 23:19:47 -0800 Subject: [StrTable] Switch the option parser to `llvm::StringTable` (#123308) Now that we have a dedicated abstraction for string tables, switch the option parser library's string table over to it rather than using a raw `const char*`. Also try to use the `StringTable::Offset` type rather than a raw `unsigned` where we can to avoid accidental increments or other issues. This is based on review feedback for the initial switch of options to a string table. Happy to tweak or adjust if desired here. --- llvm/tools/llvm-objdump/llvm-objdump.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp') diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 93fed8e..99e0440 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -94,7 +94,8 @@ namespace { class CommonOptTable : public opt::GenericOptTable { public: - CommonOptTable(const char *StrTable, ArrayRef PrefixesTable, + CommonOptTable(const StringTable &StrTable, + ArrayRef PrefixesTable, ArrayRef OptionInfos, const char *Usage, const char *Description) : opt::GenericOptTable(StrTable, PrefixesTable, OptionInfos), -- cgit v1.1