summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-11-01 17:09:25 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-11-01 17:09:25 +0000
commitdbd7fabaa0ae01d3505d52e2be3d794f0dd74a93 (patch)
tree17f0843784cbfba88449a5ea5cca1a9cb35e3998 /lldb/source/Core
parent2c22c800a0d049f6300dbf59b400aa1329c21971 (diff)
downloadbcm5719-llvm-dbd7fabaa0ae01d3505d52e2be3d794f0dd74a93.tar.gz
bcm5719-llvm-dbd7fabaa0ae01d3505d52e2be3d794f0dd74a93.zip
[FileSystem] Remove Exists() from FileSpec
This patch removes the Exists method from FileSpec and updates its uses with calls to the FileSystem. Differential revision: https://reviews.llvm.org/D53845 llvm-svn: 345854
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/Debugger.cpp6
-rw-r--r--lldb/source/Core/DynamicLoader.cpp2
-rw-r--r--lldb/source/Core/Module.cpp5
-rw-r--r--lldb/source/Core/ModuleList.cpp8
-rw-r--r--lldb/source/Core/PluginManager.cpp6
-rw-r--r--lldb/source/Core/SourceManager.cpp4
6 files changed, 19 insertions, 12 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index a0fc729487e..5b88246017a 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -656,7 +656,8 @@ void Debugger::InstanceInitialize() {
const bool find_other = true;
char dir_path[PATH_MAX];
if (FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
- if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
+ if (FileSystem::Instance().Exists(dir_spec) &&
+ dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
find_files, find_other,
LoadPluginCallback, this);
@@ -664,7 +665,8 @@ void Debugger::InstanceInitialize() {
}
if (FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
- if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
+ if (FileSystem::Instance().Exists(dir_spec) &&
+ dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
find_files, find_other,
LoadPluginCallback, this);
diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp
index 576ec1eaedd..f1bc6ddbea4 100644
--- a/lldb/source/Core/DynamicLoader.cpp
+++ b/lldb/source/Core/DynamicLoader.cpp
@@ -81,7 +81,7 @@ ModuleSP DynamicLoader::GetTargetExecutable() {
ModuleSP executable = target.GetExecutableModule();
if (executable) {
- if (executable->GetFileSpec().Exists()) {
+ if (FileSystem::Instance().Exists(executable->GetFileSpec())) {
ModuleSpec module_spec(executable->GetFileSpec(),
executable->GetArchitecture());
auto module_sp = std::make_shared<Module>(module_spec);
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 710b251a7e8..914e34e3612 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1418,7 +1418,7 @@ void Module::PreloadSymbols() {
}
void Module::SetSymbolFileFileSpec(const FileSpec &file) {
- if (!file.Exists())
+ if (!FileSystem::Instance().Exists(file))
return;
if (m_symfile_ap) {
// Remove any sections in the unified section list that come from the
@@ -1537,7 +1537,8 @@ bool Module::LoadScriptingResourceInTarget(Target *target, Status &error,
if (script_interpreter) {
for (uint32_t i = 0; i < num_specs; ++i) {
FileSpec scripting_fspec(file_specs.GetFileSpecAtIndex(i));
- if (scripting_fspec && scripting_fspec.Exists()) {
+ if (scripting_fspec &&
+ FileSystem::Instance().Exists(scripting_fspec)) {
if (should_load == eLoadScriptFromSymFileWarn) {
if (feedback_stream)
feedback_stream->Printf(
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 2737c0c6cb7..01d5da7cb3b 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -864,7 +864,7 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
continue;
search_path_spec.AppendPathComponent(
module_spec.GetFileSpec().GetFilename().AsCString());
- if (!search_path_spec.Exists())
+ if (!FileSystem::Instance().Exists(search_path_spec))
continue;
auto resolved_module_spec(module_spec);
@@ -905,13 +905,15 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
// Don't look for the file if it appears to be the same one we already
// checked for above...
if (located_binary_modulespec.GetFileSpec() != module_file_spec) {
- if (!located_binary_modulespec.GetFileSpec().Exists()) {
+ if (!FileSystem::Instance().Exists(
+ located_binary_modulespec.GetFileSpec())) {
located_binary_modulespec.GetFileSpec().GetPath(path, sizeof(path));
if (path[0] == '\0')
module_file_spec.GetPath(path, sizeof(path));
// How can this check ever be true? This branch it is false, and we
// haven't modified file_spec.
- if (located_binary_modulespec.GetFileSpec().Exists()) {
+ if (FileSystem::Instance().Exists(
+ located_binary_modulespec.GetFileSpec())) {
std::string uuid_str;
if (uuid_ptr && uuid_ptr->IsValid())
uuid_str = uuid_ptr->GetAsString();
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index 6c4056687fb..f0a81117293 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -163,7 +163,8 @@ void PluginManager::Initialize() {
const bool find_other = true;
char dir_path[PATH_MAX];
if (FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
- if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
+ if (FileSystem::Instance().Exists(dir_spec) &&
+ dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
find_files, find_other,
LoadPluginCallback, nullptr);
@@ -171,7 +172,8 @@ void PluginManager::Initialize() {
}
if (FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
- if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
+ if (FileSystem::Instance().Exists(dir_spec) &&
+ dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSystem::Instance().EnumerateDirectory(dir_path, find_directories,
find_files, find_other,
LoadPluginCallback, nullptr);
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index 05e1cc1376f..58c414b4346 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -92,7 +92,7 @@ SourceManager::FileSP SourceManager::GetFile(const FileSpec &file_spec) {
file_sp->UpdateIfNeeded();
// If file_sp is no good or it points to a non-existent file, reset it.
- if (!file_sp || !file_sp->GetFileSpec().Exists()) {
+ if (!file_sp || !FileSystem::Instance().Exists(file_sp->GetFileSpec())) {
if (target_sp)
file_sp = std::make_shared<File>(file_spec, target_sp.get());
else
@@ -427,7 +427,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec,
}
}
// Try remapping if m_file_spec does not correspond to an existing file.
- if (!m_file_spec.Exists()) {
+ if (!FileSystem::Instance().Exists(m_file_spec)) {
FileSpec new_file_spec;
// Check target specific source remappings first, then fall back to
// modules objects can have individual path remappings that were
OpenPOWER on IntegriCloud