aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-rc
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@mozilla.com>2022-12-23 11:36:56 +0100
committerserge-sans-paille <sguelton@mozilla.com>2022-12-23 11:36:56 +0100
commitb7065a31b5e7e0bbdae1cbb6cd06fcfe05b7758f (patch)
tree9059fcc00424d7b8bbdf317a777620d0fee08e8c /llvm/tools/llvm-rc
parent719d98dfa841c522d8d452f0685e503538415a53 (diff)
downloadllvm-b7065a31b5e7e0bbdae1cbb6cd06fcfe05b7758f.zip
llvm-b7065a31b5e7e0bbdae1cbb6cd06fcfe05b7758f.tar.gz
llvm-b7065a31b5e7e0bbdae1cbb6cd06fcfe05b7758f.tar.bz2
Revert "[clang] Use a StringRef instead of a raw char pointer to store builtin and call information"
Failing builds: https://lab.llvm.org/buildbot#builders/9/builds/19030 This is GCC specific and has been reported upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108158 This reverts commit 719d98dfa841c522d8d452f0685e503538415a53.
Diffstat (limited to 'llvm/tools/llvm-rc')
-rw-r--r--llvm/tools/llvm-rc/llvm-rc.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp
index ff21213..00fb9c1 100644
--- a/llvm/tools/llvm-rc/llvm-rc.cpp
+++ b/llvm/tools/llvm-rc/llvm-rc.cpp
@@ -55,13 +55,11 @@ enum ID {
#undef OPTION
};
-namespace rc_opt {
-#define PREFIX(NAME, VALUE) \
- static constexpr std::initializer_list<StringLiteral> NAME = VALUE;
+#define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE;
#include "Opts.inc"
#undef PREFIX
-static constexpr std::initializer_list<opt::OptTable::Info> InfoTable = {
+static constexpr opt::OptTable::Info InfoTable[] = {
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
HELPTEXT, METAVAR, VALUES) \
{ \
@@ -72,11 +70,10 @@ static constexpr std::initializer_list<opt::OptTable::Info> InfoTable = {
#include "Opts.inc"
#undef OPTION
};
-} // namespace rc_opt
class RcOptTable : public opt::OptTable {
public:
- RcOptTable() : OptTable(rc_opt::InfoTable, /* IgnoreCase = */ true) {}
+ RcOptTable() : OptTable(InfoTable, /* IgnoreCase = */ true) {}
};
enum Windres_ID {
@@ -88,28 +85,25 @@ enum Windres_ID {
#undef OPTION
};
-namespace windres_opt {
-#define PREFIX(NAME, VALUE) \
- static constexpr std::initializer_list<StringLiteral> NAME = VALUE;
+#define PREFIX(NAME, VALUE) const char *const WINDRES_##NAME[] = VALUE;
#include "WindresOpts.inc"
#undef PREFIX
-static constexpr std::initializer_list<opt::OptTable::Info> InfoTable = {
+static constexpr opt::OptTable::Info WindresInfoTable[] = {
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
HELPTEXT, METAVAR, VALUES) \
- {PREFIX, NAME, HELPTEXT, \
- METAVAR, WINDRES_##ID, opt::Option::KIND##Class, \
- PARAM, FLAGS, WINDRES_##GROUP, \
- WINDRES_##ALIAS, ALIASARGS, VALUES},
+ { \
+ WINDRES_##PREFIX, NAME, HELPTEXT, \
+ METAVAR, WINDRES_##ID, opt::Option::KIND##Class, \
+ PARAM, FLAGS, WINDRES_##GROUP, \
+ WINDRES_##ALIAS, ALIASARGS, VALUES},
#include "WindresOpts.inc"
#undef OPTION
};
-} // namespace windres_opt
class WindresOptTable : public opt::OptTable {
public:
- WindresOptTable()
- : OptTable(windres_opt::InfoTable, /* IgnoreCase = */ false) {}
+ WindresOptTable() : OptTable(WindresInfoTable, /* IgnoreCase = */ false) {}
};
static ExitOnError ExitOnErr;