--- /dev/null
+//===--- Compilation.h - Compilation Task Data Structure --------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_DRIVER_COMPILATION_H_
+#define CLANG_DRIVER_COMPILATION_H_
+
+namespace clang {
+
+/// Compilation - A set of tasks to perform for a single driver
+/// invocation.
+class Compilation {
+public:
+ Compilation();
+ ~Compilation();
+
+ /// Execute - Execute the compilation jobs and return an
+ /// appropriate exit code.
+ int Execute() const;
+};
+
+} // end namespace clang
+
+#endif
--- /dev/null
+//===--- Driver.h - Clang GCC Compatible Driver -----------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_DRIVER_DRIVER_H_
+#define CLANG_DRIVER_DRIVER_H_
+
+namespace clang {
+ class Compilation;
+
+/// Driver - Encapsulate logic for constructing compilation processes
+/// from a set of gcc-driver-like command line arguments.
+class Driver {
+public:
+ Driver();
+ ~Driver();
+
+ /// BuildCompilation - Construct a compilation object for a command
+ /// line argument vector.
+ Compilation *BuildCompilation(int argc, const char **argv);
+};
+
+} // end namespace clang
+
+#endif
--- /dev/null
+//===--- Compilation.cpp - Compilation Task Implementation --------------*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Driver/Compilation.h"
+using namespace clang;
+
+Compilation::Compilation() {
+}
+
+Compilation::~Compilation() {
+}
+
+int Compilation::Execute() const {
+ return 0;
+}
--- /dev/null
+//===--- Driver.cpp - Clang GCC Compatible Driver -----------------------*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Driver/Compilation.h"
+#include "clang/Driver/Driver.h"
+using namespace clang;
+
+Driver::Driver() {
+}
+
+Driver::~Driver() {
+}
+
+Compilation *Driver::BuildCompilation(int argc, const char **argv) {
+ return new Compilation();
+}
+
+
--- /dev/null
+##===- clang/lib/Driver/Makefile ---------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../../..
+LIBRARYNAME := clangDriver
+BUILD_ARCHIVE = 1
+CXXFLAGS = -fno-rtti
+
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+
+include $(LEVEL)/Makefile.common
+
##===----------------------------------------------------------------------===##
LEVEL = ../../..
-PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis Rewrite Frontend
+PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis Rewrite \
+ Frontend Driver
include $(LEVEL)/Makefile.common
##===----------------------------------------------------------------------===##
LEVEL := ../../..
-DIRS := ccc
+DIRS := ccc driver
include $(LEVEL)/Makefile.common
--- /dev/null
+##===- tools/driver/Makefile -------------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+LEVEL = ../../../..
+
+TOOLNAME = clang-driver
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
+CXXFLAGS = -fno-rtti
+
+LINK_COMPONENTS := system
+USEDLIBS = clangDriver.a
+
+# This tool has no plugins, optimize startup time.
+TOOL_NO_EXPORTS = 1
+
+include $(LEVEL)/Makefile.common
--- /dev/null
+//===-- driver.cpp - Clang GCC-Compatible Driver --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the entry point to the clang driver; it is a thin
+// wrapper for functionality in the Driver clang library.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Driver/Compilation.h"
+#include "clang/Driver/Driver.h"
+#include "llvm/ADT/OwningPtr.h"
+#include "llvm/System/Signals.h"
+using namespace clang;
+
+int main(int argc, const char **argv) {
+ llvm::sys::PrintStackTraceOnErrorSignal();
+
+ llvm::OwningPtr<Driver> TheDriver(new Driver());
+
+ llvm::OwningPtr<Compilation> C(TheDriver->BuildCompilation(argc, argv));
+
+ return C->Execute();
+}