Skip to content

Commit 436ed25

Browse files
authored
fix ClangOptionsInfoTable PREFIX (#399)
1 parent 4d0836b commit 436ed25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

options_compile.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ Copyright (c) Intel Corporation (2009-2017).
3030
#include <sstream>
3131

3232
#define PREFIX(NAME, VALUE) \
33-
const llvm::ArrayRef<llvm::StringLiteral> NAME = VALUE;
33+
static constexpr llvm::StringLiteral NAME##_init[] = VALUE; \
34+
static constexpr llvm::ArrayRef<llvm::StringLiteral> NAME( \
35+
NAME##_init, std::size(NAME##_init) - 1);
3436
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
3537
HELPTEXT, METAVAR, VALUES)
3638
#include "opencl_clang_options.inc"
@@ -41,7 +43,7 @@ using namespace llvm::opt;
4143

4244
static llvm::ManagedStatic<llvm::sys::SmartMutex<true> > compileOptionsMutex;
4345

44-
static const OptTable::Info ClangOptionsInfoTable[] = {
46+
static constexpr OptTable::Info ClangOptionsInfoTable[] = {
4547
#define PREFIX(NAME, VALUE)
4648
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
4749
HELPTEXT, METAVAR, VALUES) \

0 commit comments

Comments
 (0)