Nick Lewycky | 6da9077 | 2010-12-31 17:31:54 +0000 | [diff] [blame] | 1 | //===--- DriverOptions.cpp - Driver Options Table -------------------------===// |
Daniel Dunbar | aa76737 | 2009-11-19 00:15:11 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "clang/Driver/Options.h" |
Reid Kleckner | 898229a | 2013-06-14 17:17:23 +0000 | [diff] [blame^] | 11 | #include "llvm/Option/OptTable.h" |
| 12 | #include "llvm/Option/Option.h" |
Daniel Dunbar | aa76737 | 2009-11-19 00:15:11 +0000 | [diff] [blame] | 13 | |
| 14 | using namespace clang::driver; |
| 15 | using namespace clang::driver::options; |
Reid Kleckner | 898229a | 2013-06-14 17:17:23 +0000 | [diff] [blame^] | 16 | using namespace llvm::opt; |
Daniel Dunbar | aa76737 | 2009-11-19 00:15:11 +0000 | [diff] [blame] | 17 | |
Michael J. Spencer | 929fccd | 2012-10-22 22:13:48 +0000 | [diff] [blame] | 18 | #define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; |
| 19 | #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ |
| 20 | HELPTEXT, METAVAR) |
| 21 | #include "clang/Driver/Options.inc" |
| 22 | #undef OPTION |
| 23 | #undef PREFIX |
| 24 | |
Nuno Lopes | 221c1fd | 2009-12-10 00:07:02 +0000 | [diff] [blame] | 25 | static const OptTable::Info InfoTable[] = { |
Michael J. Spencer | 929fccd | 2012-10-22 22:13:48 +0000 | [diff] [blame] | 26 | #define PREFIX(NAME, VALUE) |
| 27 | #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ |
Daniel Dunbar | aa76737 | 2009-11-19 00:15:11 +0000 | [diff] [blame] | 28 | HELPTEXT, METAVAR) \ |
Michael J. Spencer | 929fccd | 2012-10-22 22:13:48 +0000 | [diff] [blame] | 29 | { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \ |
| 30 | FLAGS, OPT_##GROUP, OPT_##ALIAS }, |
Daniel Dunbar | 46fffee | 2009-11-19 01:03:50 +0000 | [diff] [blame] | 31 | #include "clang/Driver/Options.inc" |
Daniel Dunbar | aa76737 | 2009-11-19 00:15:11 +0000 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | namespace { |
| 35 | |
| 36 | class DriverOptTable : public OptTable { |
| 37 | public: |
| 38 | DriverOptTable() |
| 39 | : OptTable(InfoTable, sizeof(InfoTable) / sizeof(InfoTable[0])) {} |
| 40 | }; |
| 41 | |
| 42 | } |
| 43 | |
| 44 | OptTable *clang::driver::createDriverOptTable() { |
| 45 | return new DriverOptTable(); |
| 46 | } |