Nick Lewycky | 3fdcc6f | 2010-12-31 17:31:54 +0000 | [diff] [blame] | 1 | //===--- DriverOptions.cpp - Driver Options Table -------------------------===// |
Daniel Dunbar | 27e738d | 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" |
| 11 | #include "clang/Driver/OptTable.h" |
| 12 | #include "clang/Driver/Option.h" |
| 13 | |
| 14 | using namespace clang::driver; |
| 15 | using namespace clang::driver::options; |
| 16 | |
Michael J. Spencer | c635710 | 2012-10-22 22:13:48 +0000 | [diff] [blame] | 17 | #define PREFIX(NAME, VALUE) const char *const NAME[] = VALUE; |
| 18 | #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ |
| 19 | HELPTEXT, METAVAR) |
| 20 | #include "clang/Driver/Options.inc" |
| 21 | #undef OPTION |
| 22 | #undef PREFIX |
| 23 | |
Nuno Lopes | 68f7a24 | 2009-12-10 00:07:02 +0000 | [diff] [blame] | 24 | static const OptTable::Info InfoTable[] = { |
Michael J. Spencer | c635710 | 2012-10-22 22:13:48 +0000 | [diff] [blame] | 25 | #define PREFIX(NAME, VALUE) |
| 26 | #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ |
Daniel Dunbar | 27e738d | 2009-11-19 00:15:11 +0000 | [diff] [blame] | 27 | HELPTEXT, METAVAR) \ |
Michael J. Spencer | c635710 | 2012-10-22 22:13:48 +0000 | [diff] [blame] | 28 | { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \ |
| 29 | FLAGS, OPT_##GROUP, OPT_##ALIAS }, |
Daniel Dunbar | 64bdce3 | 2009-11-19 01:03:50 +0000 | [diff] [blame] | 30 | #include "clang/Driver/Options.inc" |
Daniel Dunbar | 27e738d | 2009-11-19 00:15:11 +0000 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | namespace { |
| 34 | |
| 35 | class DriverOptTable : public OptTable { |
| 36 | public: |
| 37 | DriverOptTable() |
| 38 | : OptTable(InfoTable, sizeof(InfoTable) / sizeof(InfoTable[0])) {} |
| 39 | }; |
| 40 | |
| 41 | } |
| 42 | |
| 43 | OptTable *clang::driver::createDriverOptTable() { |
| 44 | return new DriverOptTable(); |
| 45 | } |