xref: /minix3/external/bsd/llvm/dist/clang/lib/Driver/DriverOptions.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc //===--- DriverOptions.cpp - Driver Options Table -------------------------===//
2*f4a2713aSLionel Sambuc //
3*f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4*f4a2713aSLionel Sambuc //
5*f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6*f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7*f4a2713aSLionel Sambuc //
8*f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc #include "clang/Driver/Options.h"
11*f4a2713aSLionel Sambuc #include "llvm/ADT/STLExtras.h"
12*f4a2713aSLionel Sambuc #include "llvm/Option/OptTable.h"
13*f4a2713aSLionel Sambuc #include "llvm/Option/Option.h"
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc using namespace clang::driver;
16*f4a2713aSLionel Sambuc using namespace clang::driver::options;
17*f4a2713aSLionel Sambuc using namespace llvm::opt;
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc #define PREFIX(NAME, VALUE) static const char *const NAME[] = VALUE;
20*f4a2713aSLionel Sambuc #include "clang/Driver/Options.inc"
21*f4a2713aSLionel Sambuc #undef PREFIX
22*f4a2713aSLionel Sambuc 
23*f4a2713aSLionel Sambuc static const OptTable::Info InfoTable[] = {
24*f4a2713aSLionel Sambuc #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
25*f4a2713aSLionel Sambuc                HELPTEXT, METAVAR)   \
26*f4a2713aSLionel Sambuc   { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \
27*f4a2713aSLionel Sambuc     FLAGS, OPT_##GROUP, OPT_##ALIAS, ALIASARGS },
28*f4a2713aSLionel Sambuc #include "clang/Driver/Options.inc"
29*f4a2713aSLionel Sambuc #undef OPTION
30*f4a2713aSLionel Sambuc };
31*f4a2713aSLionel Sambuc 
32*f4a2713aSLionel Sambuc namespace {
33*f4a2713aSLionel Sambuc 
34*f4a2713aSLionel Sambuc class DriverOptTable : public OptTable {
35*f4a2713aSLionel Sambuc public:
DriverOptTable()36*f4a2713aSLionel Sambuc   DriverOptTable()
37*f4a2713aSLionel Sambuc     : OptTable(InfoTable, llvm::array_lengthof(InfoTable)) {}
38*f4a2713aSLionel Sambuc };
39*f4a2713aSLionel Sambuc 
40*f4a2713aSLionel Sambuc }
41*f4a2713aSLionel Sambuc 
createDriverOptTable()42*f4a2713aSLionel Sambuc OptTable *clang::driver::createDriverOptTable() {
43*f4a2713aSLionel Sambuc   return new DriverOptTable();
44*f4a2713aSLionel Sambuc }
45