clang API Documentation
00001 //===--- DriverOptions.cpp - Driver Options Table -------------------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #include "clang/Driver/Options.h" 00011 #include "llvm/ADT/STLExtras.h" 00012 #include "llvm/Option/OptTable.h" 00013 #include "llvm/Option/Option.h" 00014 00015 using namespace clang::driver; 00016 using namespace clang::driver::options; 00017 using namespace llvm::opt; 00018 00019 #define PREFIX(NAME, VALUE) static const char *const NAME[] = VALUE; 00020 #include "clang/Driver/Options.inc" 00021 #undef PREFIX 00022 00023 static const OptTable::Info InfoTable[] = { 00024 #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \ 00025 HELPTEXT, METAVAR) \ 00026 { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \ 00027 FLAGS, OPT_##GROUP, OPT_##ALIAS, ALIASARGS }, 00028 #include "clang/Driver/Options.inc" 00029 #undef OPTION 00030 }; 00031 00032 namespace { 00033 00034 class DriverOptTable : public OptTable { 00035 public: 00036 DriverOptTable() 00037 : OptTable(InfoTable, llvm::array_lengthof(InfoTable)) {} 00038 }; 00039 00040 } 00041 00042 OptTable *clang::driver::createDriverOptTable() { 00043 return new DriverOptTable(); 00044 }