aboutsummaryrefslogtreecommitdiff
path: root/tools/driver/driver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-10 20:52:46 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-10 20:52:46 +0000
commit365c02f65be026f90e67a8e00e7b827cee60e228 (patch)
tree7fea9cb2a2f8fdfb3fed710ea870c8d36192c7eb /tools/driver/driver.cpp
parentdf667e71b1daadeacb230cf94fc717843f1a138a (diff)
Driver: Handle magic -ccc- options.
- Follows ccc currently, but this functionality should eventually be outside the Driver lib. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/driver.cpp')
-rw-r--r--tools/driver/driver.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index 31990a8f2a..ad6c807327 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -18,13 +18,20 @@
#include "clang/Driver/Options.h"
#include "llvm/ADT/OwningPtr.h"
+#include "llvm/System/Path.h"
#include "llvm/System/Signals.h"
using namespace clang::driver;
int main(int argc, const char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal();
- llvm::OwningPtr<Driver> TheDriver(new Driver());
+ // FIXME: We should use GetMainExecutable here, probably, but we may
+ // want to handle symbolic links slightly differently. The problem
+ // is that the path derived from this will influence search paths.
+ llvm::sys::Path Path(argv[0]);
+
+ llvm::OwningPtr<Driver> TheDriver(new Driver(Path.getBasename().c_str(),
+ Path.getDirname().c_str()));
llvm::OwningPtr<Compilation> C(TheDriver->BuildCompilation(argc, argv));