aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-09-23 23:32:02 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-09-23 23:32:02 +0000
commit51be75eccd920c06fc3033444c9d37e78d3cb4a5 (patch)
tree6337c4660593b7958e57186242cd61a86e910b4b /lib/Driver/Driver.cpp
parentbc2b91a8f682023acb6543257f7c08f68ea964ae (diff)
Driver: Use sys::Process::SetWorkingDirectory, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r--lib/Driver/Driver.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 40e68e4f54..5be7e630b5 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -38,17 +38,12 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
+#include "llvm/Support/Process.h"
#include "InputInfo.h"
#include <map>
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#elif defined(_WIN32)
-#include <direct.h>
-#endif
-
using namespace clang::driver;
using namespace clang;
@@ -333,7 +328,7 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
// internally to support good use as a library, but for now we just change our
// working directory.
if (const Arg *A = Args->getLastArg(options::OPT__working_directory)) {
- ::chdir(A->getValue(*Args));
+ llvm::sys::Process::SetWorkingDirectory(A->getValue(*Args));
}
Host = GetHostInfo(DefaultHostTriple.c_str());