[PlatformDarwin] Simplify logic and use FileSystem
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 4 Dec 2018 02:23:16 +0000 (02:23 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 4 Dec 2018 02:23:16 +0000 (02:23 +0000)
Simplify code path by using the FileSystem.

llvm-svn: 348232

lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

index c9359df..30b035d 100644 (file)
@@ -190,25 +190,12 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources(
 Status PlatformDarwin::ResolveSymbolFile(Target &target,
                                          const ModuleSpec &sym_spec,
                                          FileSpec &sym_file) {
-  Status error;
   sym_file = sym_spec.GetSymbolFileSpec();
-
-  llvm::sys::fs::file_status st;
-  if (status(sym_file.GetPath(), st, false)) {
-    error.SetErrorString("Could not stat file!");
-    return error;
-  }
-
-  if (exists(st)) {
-    if (is_directory(st)) {
-      sym_file = Symbols::FindSymbolFileInBundle(
-          sym_file, sym_spec.GetUUIDPtr(), sym_spec.GetArchitecturePtr());
-    }
-  } else {
-    if (sym_spec.GetUUID().IsValid()) {
-    }
+  if (FileSystem::Instance().IsDirectory(sym_file)) {
+    sym_file = Symbols::FindSymbolFileInBundle(sym_file, sym_spec.GetUUIDPtr(),
+                                               sym_spec.GetArchitecturePtr());
   }
-  return error;
+  return {};
 }
 
 static lldb_private::Status