A few minor path fixes for Windows.

When launching argdumper, there are a few problems with the
current logic.  First, on Windows, the file is called
argdumper.exe, not argdumper.  Second, Windows paths have
backslashes in them, and JSON treats <backslash><char> as an
escape sequence.  To fix the second problem, on Windows we
convert backslashes to forward slashes, since backslash isn't
a valid filename character anyway this shouldn't be a problem.

llvm-svn: 229784
This commit is contained in:
Zachary Turner
2015-02-18 23:59:11 +00:00
parent fc27511223
commit ee69a4bcd0

View File

@@ -1122,7 +1122,11 @@ Platform::LaunchProcess (ProcessLaunchInfo &launch_info)
error.SetErrorString("could not find argdumper tool");
return error;
}
#if defined(_WIN32)
glob_tool_spec.AppendPathComponent("argdumper.exe");
#else
glob_tool_spec.AppendPathComponent("argdumper");
#endif
if (!glob_tool_spec.Exists())
{
error.SetErrorString("could not find argdumper tool");
@@ -1131,7 +1135,9 @@ Platform::LaunchProcess (ProcessLaunchInfo &launch_info)
std::string quoted_cmd_string;
launch_info.GetArguments().GetQuotedCommandString(quoted_cmd_string);
#if defined(_WIN32)
std::replace(quoted_cmd_string.begin(), quoted_cmd_string.end(), '\\', '/');
#endif
StreamString glob_command;
glob_command.Printf("%s %s",