diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-04 20:49:20 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-04 20:49:20 +0000 |
commit | 1b3bb6efc59a21f794b534078f9ae7e95393f510 (patch) | |
tree | 904900d539850787563d22bbdc44f52e2c50e248 | |
parent | 3a084b6093d67a00fa4bb0ab6a988f0e5a6770b0 (diff) |
Driver: Sink Driver/Compilation into clang::driver namespace.
- Add OptTable instance to Driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66063 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Driver/Compilation.h | 2 | ||||
-rw-r--r-- | include/clang/Driver/Driver.h | 7 | ||||
-rw-r--r-- | lib/Driver/Compilation.cpp | 2 | ||||
-rw-r--r-- | lib/Driver/Driver.cpp | 12 | ||||
-rw-r--r-- | tools/driver/driver.cpp | 2 |
5 files changed, 20 insertions, 5 deletions
diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h index d4792e898a..22012a6a6c 100644 --- a/include/clang/Driver/Compilation.h +++ b/include/clang/Driver/Compilation.h @@ -11,6 +11,7 @@ #define CLANG_DRIVER_COMPILATION_H_ namespace clang { +namespace driver { /// Compilation - A set of tasks to perform for a single driver /// invocation. @@ -24,6 +25,7 @@ public: int Execute() const; }; +} // end namespace driver } // end namespace clang #endif diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index 62bcd43294..dc8c6c3d5d 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -11,20 +11,27 @@ #define CLANG_DRIVER_DRIVER_H_ namespace clang { +namespace driver { class Compilation; + class OptTable; /// Driver - Encapsulate logic for constructing compilation processes /// from a set of gcc-driver-like command line arguments. class Driver { + OptTable *Opts; + public: Driver(); ~Driver(); + const OptTable &getOpts() const { return *Opts; } + /// BuildCompilation - Construct a compilation object for a command /// line argument vector. Compilation *BuildCompilation(int argc, const char **argv); }; +} // end namespace driver } // end namespace clang #endif diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index 7f3454bcd8..a636e2dbac 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "clang/Driver/Compilation.h" -using namespace clang; +using namespace clang::driver; Compilation::Compilation() { } diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index f464acf8eb..d3c959499a 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -7,14 +7,20 @@ // //===----------------------------------------------------------------------===// -#include "clang/Driver/Compilation.h" #include "clang/Driver/Driver.h" -using namespace clang; -Driver::Driver() { +#include "clang/Driver/Arg.h" +#include "clang/Driver/ArgList.h" +#include "clang/Driver/Compilation.h" +#include "clang/Driver/Options.h" +using namespace clang::driver; + +Driver::Driver() : Opts(new OptTable()) { + } Driver::~Driver() { + delete Opts; } Compilation *Driver::BuildCompilation(int argc, const char **argv) { diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index ac739bf492..31990a8f2a 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -19,7 +19,7 @@ #include "llvm/ADT/OwningPtr.h" #include "llvm/System/Signals.h" -using namespace clang; +using namespace clang::driver; int main(int argc, const char **argv) { llvm::sys::PrintStackTraceOnErrorSignal(); |