diff options
| author | Chad Rosier <mcrosier@apple.com> | 2013-04-27 01:14:43 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@apple.com> | 2013-04-27 01:14:43 +0000 |
| commit | 1675c0e6e316557c6cf42f937252bbd9a14f516b (patch) | |
| tree | 43c5fe649467f976361b87d184e44b01622bcca1 /clang/lib/Driver/Tools.cpp | |
| parent | 203e12bf9ef6ba54e9628cc8ad6bc6a678b5490d (diff) | |
| download | bcm5719-llvm-1675c0e6e316557c6cf42f937252bbd9a14f516b.tar.gz bcm5719-llvm-1675c0e6e316557c6cf42f937252bbd9a14f516b.zip | |
[driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN to
make the gdb tests and the Windows bots happy.
The Path::GetCurrentDirectory API is not equivalent to ::getcwd(), so
r180652 causes a gdb tests to fail. On the other hand, <sys/param.h>
isn't defined on Windows systems, so that causes Windows builds to fail.
rdar://12237559
llvm-svn: 180661
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 5d152e52325..40aebd4d100 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1775,6 +1775,9 @@ static bool shouldUseLeafFramePointer(const ArgList &Args, return true; } +// FIXME: This is a temporary hack until I can find a fix that works for all +// platforms. +#define MAXPATHLEN 4096 /// If the PWD environment variable is set, add a CC1 option to specify the /// debug compilation directory. static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs) { @@ -1792,8 +1795,8 @@ static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs) { return; } // Fall back to using getcwd. - std::string cwd = llvm::sys::Path::GetCurrentDirectory().str(); - if (pwd && !cwd.empty()) { + char *cwd; + if (pwd && ::getcwd(cwd, MAXPATHLEN)) { CmdArgs.push_back("-fdebug-compilation-dir"); CmdArgs.push_back(Args.MakeArgString(cwd)); } |

