[cfe-commits] r140434 - /cfe/trunk/lib/Driver/Driver.cpp

Daniel Dunbar daniel at zuster.org
Fri Sep 23 16:32:02 PDT 2011


Author: ddunbar
Date: Fri Sep 23 18:32:02 2011
New Revision: 140434

URL: http://llvm.org/viewvc/llvm-project?rev=140434&view=rev
Log:
Driver: Use sys::Process::SetWorkingDirectory, for consistency.

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=140434&r1=140433&r2=140434&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Sep 23 18:32:02 2011
@@ -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 @@
   // 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());





More information about the cfe-commits mailing list