diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2025-01-22 23:19:47 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-22 23:19:47 -0800 |
commit | cd5694ecea2da1990365f46f9737be1b29d94f0c (patch) | |
tree | fcd33bdddc82ec7dfd9b06b657dac86ac0267c6b /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 8eb99bbe6e8878bfd73fb301899ced6bb5dfff38 (diff) | |
download | llvm-cd5694ecea2da1990365f46f9737be1b29d94f0c.zip llvm-cd5694ecea2da1990365f46f9737be1b29d94f0c.tar.gz llvm-cd5694ecea2da1990365f46f9737be1b29d94f0c.tar.bz2 |
[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.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 58658de..3bf124e 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -282,7 +282,7 @@ using ArgumentConsumer = CompilerInvocation::ArgumentConsumer; #undef OPTTABLE_STR_TABLE_CODE static llvm::StringRef lookupStrInTable(unsigned Offset) { - return &OptionStrTable[Offset]; + return OptionStrTable[Offset]; } #define SIMPLE_ENUM_VALUE_TABLE |