diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 17:35:31 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 17:35:31 +0000 |
| commit | 60cf3f82fd0c1358a2f58699480ebbcbd89f7e11 (patch) | |
| tree | 9f4a29a05503bc85b8d69ee169af8f95b6983bc0 /lldb/source/Host | |
| parent | b47475c058b1da5b8ff8aba4e1fd9bb9a9871882 (diff) | |
| download | bcm5719-llvm-60cf3f82fd0c1358a2f58699480ebbcbd89f7e11.tar.gz bcm5719-llvm-60cf3f82fd0c1358a2f58699480ebbcbd89f7e11.zip | |
[FileSystem] Fix Exists call sites
There were some calls left to Exists() on non-darwin platforms (Windows,
Linux and FreeBSD) that weren't yet updated to use the FileSystem.
llvm-svn: 345857
Diffstat (limited to 'lldb/source/Host')
| -rw-r--r-- | lldb/source/Host/android/HostInfoAndroid.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Host/linux/HostInfoLinux.cpp | 5 | ||||
| -rw-r--r-- | lldb/source/Host/windows/Host.cpp | 3 |
3 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Host/android/HostInfoAndroid.cpp b/lldb/source/Host/android/HostInfoAndroid.cpp index a9603328321..fb23878a1dd 100644 --- a/lldb/source/Host/android/HostInfoAndroid.cpp +++ b/lldb/source/Host/android/HostInfoAndroid.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "lldb/Host/android/HostInfoAndroid.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Host/linux/HostInfoLinux.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -68,7 +69,7 @@ FileSpec HostInfoAndroid::ResolveLibraryPath(const std::string &module_path, FileSpec file_candidate(path.str().c_str(), true); file_candidate.AppendPathComponent(module_path.c_str()); - if (file_candidate.Exists()) + if (FileSystem::Instance().Exists(file_candidate)) return file_candidate; } @@ -83,8 +84,8 @@ bool HostInfoAndroid::ComputeTempFileBaseDirectory(FileSpec &file_spec) { // algorithm will deduce /tmp, which is plain wrong. In that case we have an // invalid directory, we substitute the path with /data/local/tmp, which is // correct at least in some cases (i.e., when running as shell user). - if (!success || !file_spec.Exists()) + if (!success || !FileSystem::Instance().Exists(file_spec)) file_spec = FileSpec("/data/local/tmp", false); - return file_spec.Exists(); + return FileSystem::Instance().Exists(file_spec); } diff --git a/lldb/source/Host/linux/HostInfoLinux.cpp b/lldb/source/Host/linux/HostInfoLinux.cpp index 1d95010e2f7..12885756e2b 100644 --- a/lldb/source/Host/linux/HostInfoLinux.cpp +++ b/lldb/source/Host/linux/HostInfoLinux.cpp @@ -7,8 +7,9 @@ // //===----------------------------------------------------------------------===// -#include "lldb/Host/Config.h" #include "lldb/Host/linux/HostInfoLinux.h" +#include "lldb/Host/Config.h" +#include "lldb/Host/FileSystem.h" #include "lldb/Utility/Log.h" #include "llvm/Support/Threading.h" @@ -179,7 +180,7 @@ FileSpec HostInfoLinux::GetProgramFileSpec() { bool HostInfoLinux::ComputeSupportExeDirectory(FileSpec &file_spec) { if (HostInfoPosix::ComputeSupportExeDirectory(file_spec) && - file_spec.IsAbsolute() && file_spec.Exists()) + file_spec.IsAbsolute() && FileSystem::Instance().Exists(file_spec)) return true; file_spec.GetDirectory() = GetProgramFileSpec().GetDirectory(); return !file_spec.GetDirectory().IsEmpty(); diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp index cc6c454d36b..452502d3372 100644 --- a/lldb/source/Host/windows/Host.cpp +++ b/lldb/source/Host/windows/Host.cpp @@ -15,6 +15,7 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/Process.h" @@ -189,7 +190,7 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) { return error; } expand_tool_spec.AppendPathComponent("lldb-argdumper.exe"); - if (!expand_tool_spec.Exists()) { + if (!FileSystem::Instance().Exists(expand_tool_spec)) { error.SetErrorString("could not find the lldb-argdumper tool"); return error; } |

