aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp')
-rw-r--r--llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
index 1cea9e29faa4..06f0a25c0dff 100644
--- a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
+++ b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
@@ -32,11 +32,14 @@ enum ID {
#undef OPTION
};
-#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
+#define PREFIX(NAME, VALUE) \
+ static constexpr llvm::StringLiteral NAME##_init[] = VALUE; \
+ static constexpr llvm::ArrayRef<llvm::StringLiteral> NAME( \
+ NAME##_init, std::size(NAME##_init) - 1);
#include "Opts.inc"
#undef PREFIX
-const opt::OptTable::Info InfoTable[] = {
+static constexpr opt::OptTable::Info InfoTable[] = {
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
HELPTEXT, METAVAR, VALUES) \
{ \
@@ -48,9 +51,11 @@ const opt::OptTable::Info InfoTable[] = {
#undef OPTION
};
-class CxxfiltOptTable : public opt::OptTable {
+class CxxfiltOptTable : public opt::GenericOptTable {
public:
- CxxfiltOptTable() : OptTable(InfoTable) { setGroupedShortOptions(true); }
+ CxxfiltOptTable() : opt::GenericOptTable(InfoTable) {
+ setGroupedShortOptions(true);
+ }
};
} // namespace