summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-12-10 18:17:39 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-12-10 18:17:39 +0000
commit046c390356492eb63988a90c787215a7324f774b (patch)
tree1ff3b2354d8e68c10950970dac6b3e19a4c2cc6c /lldb/source/Host/macosx
parent5f503b47cb32c14fa4007b68d43b83245fa926d5 (diff)
downloadbcm5719-llvm-046c390356492eb63988a90c787215a7324f774b.tar.gz
bcm5719-llvm-046c390356492eb63988a90c787215a7324f774b.zip
[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
Diffstat (limited to 'lldb/source/Host/macosx')
-rw-r--r--lldb/source/Host/macosx/objcxx/Host.mm18
1 files changed, 8 insertions, 10 deletions
diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm
index 297a052ac8e..ec876837d59 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -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;
}
OpenPOWER on IntegriCloud