DriverOptions.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //===--- DriverOptions.cpp - Driver Options Table -------------------------===//
  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. #include "clang/Driver/Options.h"
  10. #include "llvm/ADT/STLExtras.h"
  11. #include "llvm/Option/OptTable.h"
  12. #include "llvm/Option/Option.h"
  13. using namespace clang::driver;
  14. using namespace clang::driver::options;
  15. using namespace llvm::opt;
  16. #define PREFIX(NAME, VALUE) static const char *const NAME[] = VALUE;
  17. #include "clang/Driver/Options.inc"
  18. #undef PREFIX
  19. static const OptTable::Info InfoTable[] = {
  20. #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \
  21. HELPTEXT, METAVAR) \
  22. { PREFIX, NAME, HELPTEXT, METAVAR, OPT_##ID, Option::KIND##Class, PARAM, \
  23. FLAGS, OPT_##GROUP, OPT_##ALIAS, ALIASARGS },
  24. #include "clang/Driver/Options.inc"
  25. #undef OPTION
  26. };
  27. namespace {
  28. class DriverOptTable : public OptTable {
  29. public:
  30. DriverOptTable()
  31. : OptTable(InfoTable, llvm::array_lengthof(InfoTable)) {}
  32. };
  33. }
  34. OptTable *clang::driver::createDriverOptTable() {
  35. return new DriverOptTable();
  36. }