[driver] Use the llvm equivalent of getcwd().  Hopefully, this makes the Windows
bots recover.
rdar://12237559

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180652 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index dec2ba5..321894a 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -7,7 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include <sys/param.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include "Tools.h"
@@ -1793,8 +1792,8 @@
     return;
   }
   // Fall back to using getcwd.
-  char cwd[MAXPATHLEN];
-  if (pwd && ::getcwd(cwd, MAXPATHLEN)) {
+  const char *cwd = llvm::sys::Path::GetCurrentDirectory().c_str();
+  if (pwd && cwd) {
     CmdArgs.push_back("-fdebug-compilation-dir");
     CmdArgs.push_back(Args.MakeArgString(cwd));
   }