diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-19 00:15:11 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-19 00:15:11 +0000 |
commit | aa767378ac312040b68f5ac6646b62ec79a2b8b3 (patch) | |
tree | 33effc430f0d63607fa6ad5c4b3612741aa0db18 /clang/lib | |
parent | 0dd2b817c2f32073259f1743136faf19f2ce7469 (diff) | |
download | bcm5719-llvm-aa767378ac312040b68f5ac6646b62ec79a2b8b3.tar.gz bcm5719-llvm-aa767378ac312040b68f5ac6646b62ec79a2b8b3.zip |
Driver: Split OptTable out into OptTable.{h,cpp}
llvm-svn: 89283
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/CMakeLists.txt | 1 | ||||
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 1 | ||||
-rw-r--r-- | clang/lib/Driver/DriverOptions.cpp | 42 | ||||
-rw-r--r-- | clang/lib/Driver/OptTable.cpp | 34 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 1 |
5 files changed, 47 insertions, 32 deletions
diff --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt index b6998abe477..c4430a694b4 100644 --- a/clang/lib/Driver/CMakeLists.txt +++ b/clang/lib/Driver/CMakeLists.txt @@ -6,6 +6,7 @@ add_clang_library(clangDriver ArgList.cpp Compilation.cpp Driver.cpp + DriverOptions.cpp HostInfo.cpp Job.cpp OptTable.cpp diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index a93812632c3..a696f33d0a8 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -16,6 +16,7 @@ #include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/HostInfo.h" #include "clang/Driver/Job.h" +#include "clang/Driver/OptTable.h" #include "clang/Driver/Option.h" #include "clang/Driver/Options.h" #include "clang/Driver/Tool.h" diff --git a/clang/lib/Driver/DriverOptions.cpp b/clang/lib/Driver/DriverOptions.cpp new file mode 100644 index 00000000000..ac6ca5c376f --- /dev/null +++ b/clang/lib/Driver/DriverOptions.cpp @@ -0,0 +1,42 @@ +//===--- DriverOptions.cpp - Driver Options Table -----------------------*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang/Driver/Options.h" +#include "clang/Driver/OptTable.h" +#include "clang/Driver/Option.h" + +using namespace clang::driver; +using namespace clang::driver::options; + +static OptTable::Info InfoTable[] = { + // The InputOption info + { "<input>", 0, 0, Option::InputClass, DriverOption, 0, OPT_INVALID, OPT_INVALID }, + // The UnknownOption info + { "<unknown>", 0, 0, Option::UnknownClass, 0, 0, OPT_INVALID, OPT_INVALID }, + +#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ + HELPTEXT, METAVAR) \ + { NAME, HELPTEXT, METAVAR, Option::KIND##Class, FLAGS, PARAM, \ + OPT_##GROUP, OPT_##ALIAS }, +#include "clang/Driver/Options.def" +}; + +namespace { + +class DriverOptTable : public OptTable { +public: + DriverOptTable() + : OptTable(InfoTable, sizeof(InfoTable) / sizeof(InfoTable[0])) {} +}; + +} + +OptTable *clang::driver::createDriverOptTable() { + return new DriverOptTable(); +} diff --git a/clang/lib/Driver/OptTable.cpp b/clang/lib/Driver/OptTable.cpp index 6065b2df228..74937a7188c 100644 --- a/clang/lib/Driver/OptTable.cpp +++ b/clang/lib/Driver/OptTable.cpp @@ -1,4 +1,4 @@ -//===--- Options.cpp - Option info table --------------------------------*-===// +//===--- OptTable.cpp - Option Table Implementation ---------------------*-===// // // The LLVM Compiler Infrastructure // @@ -7,8 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "clang/Driver/Options.h" - +#include "clang/Driver/OptTable.h" #include "clang/Driver/Arg.h" #include "clang/Driver/ArgList.h" #include "clang/Driver/Option.h" @@ -218,32 +217,3 @@ Arg *OptTable::ParseOneArg(const InputArgList &Args, unsigned &Index) const { return new PositionalArg(TheUnknownOption, Index++); } - -// - -static OptTable::Info InfoTable[] = { - // The InputOption info - { "<input>", 0, 0, Option::InputClass, DriverOption, 0, OPT_INVALID, OPT_INVALID }, - // The UnknownOption info - { "<unknown>", 0, 0, Option::UnknownClass, 0, 0, OPT_INVALID, OPT_INVALID }, - -#define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \ - HELPTEXT, METAVAR) \ - { NAME, HELPTEXT, METAVAR, Option::KIND##Class, FLAGS, PARAM, \ - OPT_##GROUP, OPT_##ALIAS }, -#include "clang/Driver/Options.def" -}; - -namespace { - -class DriverOptTable : public OptTable { -public: - DriverOptTable() - : OptTable(InfoTable, sizeof(InfoTable) / sizeof(InfoTable[0])) {} -}; - -} - -OptTable *clang::driver::createDriverOptTable() { - return new DriverOptTable(); -} diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index b83e399411b..296e399a258 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -14,6 +14,7 @@ #include "clang/Driver/Driver.h" #include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/HostInfo.h" +#include "clang/Driver/OptTable.h" #include "clang/Driver/Option.h" #include "llvm/ADT/StringExtras.h" |