diff options
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index ec9295d6fb..d64eab5999 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -323,6 +323,13 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) { if (Args->hasArg(options::OPT_nostdlib)) UseStdLib = false; + // Honor --working-directory. Eventually we want to handle this completely + // 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)); + } + Host = GetHostInfo(DefaultHostTriple.c_str()); // Perform the default argument translations. |