forked from OSchip/llvm-project
[Host] Use FileSystem wrapper
Fixes Host.mm to use the FileSystem class instead of making native calls to check if a file exists. llvm-svn: 348779
This commit is contained in:
parent
5f503b47cb
commit
046c390356
|
@ -1273,21 +1273,19 @@ static bool ShouldLaunchUsingXPC(ProcessLaunchInfo &launch_info) {
|
|||
|
||||
Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
|
||||
Status error;
|
||||
|
||||
FileSystem &fs = FileSystem::Instance();
|
||||
FileSpec exe_spec(launch_info.GetExecutableFile());
|
||||
|
||||
llvm::sys::fs::file_status stats;
|
||||
status(exe_spec.GetPath(), stats);
|
||||
if (!exists(stats)) {
|
||||
if (!fs.Exists(exe_spec))
|
||||
FileSystem::Instance().Resolve(exe_spec);
|
||||
status(exe_spec.GetPath(), stats);
|
||||
}
|
||||
if (!exists(stats)) {
|
||||
|
||||
if (!fs.Exists(exe_spec))
|
||||
FileSystem::Instance().ResolveExecutableLocation(exe_spec);
|
||||
status(exe_spec.GetPath(), stats);
|
||||
}
|
||||
if (!exists(stats)) {
|
||||
|
||||
if (!fs.Exists(exe_spec)) {
|
||||
error.SetErrorStringWithFormatv("executable doesn't exist: '{0}'",
|
||||
launch_info.GetExecutableFile());
|
||||
exe_spec);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue