Skip to content

Commit 60df7bc

Browse files
authored
[OpenCL-clang] Port options after dd647e3e608 (#559)
1 parent 53d58dd commit 60df7bc

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

options.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ enum COMPILE_OPT_ID {
4343
#undef PREFIX
4444
};
4545

46+
#define OPTTABLE_STR_TABLE_CODE
47+
#include "opencl_clang_options.inc"
48+
#undef OPTTABLE_STR_TABLE_CODE
49+
50+
#define OPTTABLE_PREFIXES_TABLE_CODE
51+
#include "opencl_clang_options.inc"
52+
#undef OPTTABLE_PREFIXES_TABLE_CODE
53+
4654
typedef std::list<std::string> ArgsVector;
4755

4856
//
@@ -99,7 +107,7 @@ class OpenCLArgList : public llvm::opt::ArgList {
99107
class OpenCLOptTable : public llvm::opt::GenericOptTable {
100108
public:
101109
OpenCLOptTable(llvm::ArrayRef<Info> pOptionInfos)
102-
: llvm::opt::GenericOptTable(pOptionInfos) {}
110+
: llvm::opt::GenericOptTable(OptionStrTable, OptionPrefixesTable, pOptionInfos) {}
103111

104112
OpenCLArgList *ParseArgs(const char *szOptions, unsigned &missingArgIndex,
105113
unsigned &missingArgCount) const;

options_compile.cpp

-11
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ Copyright (c) Intel Corporation (2009-2017).
3131
#include <map>
3232
#include <sstream>
3333

34-
#define PREFIX(NAME, VALUE) \
35-
static constexpr llvm::StringLiteral NAME##_init[] = VALUE; \
36-
static constexpr llvm::ArrayRef<llvm::StringLiteral> NAME( \
37-
NAME##_init, std::size(NAME##_init) - 1);
38-
#define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, \
39-
VISIBILITY, PARAM, HELPTEXT, HELPTEXTSFORVARIANTS, METAVAR, \
40-
VALUES)
41-
#include "opencl_clang_options.inc"
42-
#undef OPTION
43-
#undef PREFIX
44-
4534
using namespace llvm::opt;
4635

4736
extern llvm::ManagedStatic<llvm::sys::SmartMutex<true>> compileMutex;

0 commit comments

Comments
 (0)