[llvm-commits] [llvm] r140433 - in /llvm/trunk: include/llvm/Support/Process.h lib/Support/Unix/Process.inc lib/Support/Windows/Process.inc

Aaron Ballman aaron at aaronballman.com
Fri Sep 23 16:39:16 PDT 2011


On Fri, Sep 23, 2011 at 6:23 PM, Daniel Dunbar <daniel at zuster.org> wrote:
> ==============================================================================
> --- llvm/trunk/lib/Support/Windows/Process.inc (original)
> +++ llvm/trunk/lib/Support/Windows/Process.inc Fri Sep 23 18:23:36 2011
> @@ -15,6 +15,7 @@
>  #include <psapi.h>
>  #include <malloc.h>
>  #include <io.h>
> +#include <direct.h>
>
>  #ifdef __MINGW32__
>  #if (HAVE_LIBPSAPI != 1)
> @@ -219,4 +220,8 @@
>   return 0;
>  }
>
> +void Process::SetWorkingDirectory(std::string Path) {
> +  ::_chdir(Path.c_str());
> +}
> +
>  }

This has me a bit worried because it isn't Unicode savvy.  You should
be using _wchdir or SetCurrentDirectoryW and passing in a UTF-16
string.

Also, I'm not certain that Process is the best place for it.  Perhaps
this is better put into PathV2, as a complement to current_path?

~Aaron




More information about the llvm-commits mailing list