[cfe-commits] r66063 - in /cfe/trunk: include/clang/Driver/Compilation.h include/clang/Driver/Driver.h lib/Driver/Compilation.cpp lib/Driver/Driver.cpp tools/driver/driver.cpp

Daniel Dunbar daniel at zuster.org
Wed Mar 4 12:49:20 PST 2009


Author: ddunbar
Date: Wed Mar  4 14:49:20 2009
New Revision: 66063

URL: http://llvm.org/viewvc/llvm-project?rev=66063&view=rev
Log:
Driver: Sink Driver/Compilation into clang::driver namespace.
 - Add OptTable instance to Driver.

Modified:
    cfe/trunk/include/clang/Driver/Compilation.h
    cfe/trunk/include/clang/Driver/Driver.h
    cfe/trunk/lib/Driver/Compilation.cpp
    cfe/trunk/lib/Driver/Driver.cpp
    cfe/trunk/tools/driver/driver.cpp

Modified: cfe/trunk/include/clang/Driver/Compilation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Compilation.h?rev=66063&r1=66062&r2=66063&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Compilation.h (original)
+++ cfe/trunk/include/clang/Driver/Compilation.h Wed Mar  4 14:49:20 2009
@@ -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 @@
   int Execute() const;
 };
 
+} // end namespace driver
 } // end namespace clang
 
 #endif

Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=66063&r1=66062&r2=66063&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Wed Mar  4 14:49:20 2009
@@ -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

Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=66063&r1=66062&r2=66063&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Wed Mar  4 14:49:20 2009
@@ -8,7 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/Driver/Compilation.h"
-using namespace clang;
+using namespace clang::driver;
 
 Compilation::Compilation() {
 }

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=66063&r1=66062&r2=66063&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Mar  4 14:49:20 2009
@@ -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) {

Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=66063&r1=66062&r2=66063&view=diff

==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Wed Mar  4 14:49:20 2009
@@ -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();





More information about the cfe-commits mailing list