summaryrefslogtreecommitdiff
path: root/lldb/source/Target/ModuleCache.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-21 05:47:57 +0000
committerZachary Turner <zturner@google.com>2017-03-21 05:47:57 +0000
commit07db3f7e3f268c01e66e87608968c5cb71e35f82 (patch)
tree77190cb10ea2358a0c94a8289919bb779d11c6f8 /lldb/source/Target/ModuleCache.cpp
parent9b7bbeca48b10a0eb81708650777703ce41e67d7 (diff)
Resubmit r298334 after fixing OSX build errors.
Hopefully this works, I can't test since I don't have Mac hardware, however. llvm-svn: 298340
Diffstat (limited to 'lldb/source/Target/ModuleCache.cpp')
-rw-r--r--lldb/source/Target/ModuleCache.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Target/ModuleCache.cpp b/lldb/source/Target/ModuleCache.cpp
index b35e2d79b20e..a4aa26a0e480 100644
--- a/lldb/source/Target/ModuleCache.cpp
+++ b/lldb/source/Target/ModuleCache.cpp
@@ -13,7 +13,6 @@
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/File.h"
-#include "lldb/Host/FileSystem.h"
#include "lldb/Host/LockFile.h"
#include "lldb/Utility/Log.h"
#include "llvm/Support/FileSystem.h"
@@ -101,11 +100,12 @@ void DeleteExistingModule(const FileSpec &root_dir_spec,
module_uuid.GetAsString().c_str(), error.AsCString());
}
- auto link_count = FileSystem::GetHardlinkCount(sysroot_module_path_spec);
- if (link_count == -1)
+ namespace fs = llvm::sys::fs;
+ fs::file_status st;
+ if (status(sysroot_module_path_spec.GetPath(), st))
return;
- if (link_count > 2) // module is referred by other hosts.
+ if (st.getLinkCount() > 2) // module is referred by other hosts.
return;
const auto module_spec_dir = GetModuleDirectory(root_dir_spec, module_uuid);
@@ -119,11 +119,10 @@ void DecrementRefExistingModule(const FileSpec &root_dir_spec,
DeleteExistingModule(root_dir_spec, sysroot_module_path_spec);
// Remove sysroot link.
- FileSystem::Unlink(sysroot_module_path_spec);
+ llvm::sys::fs::remove(sysroot_module_path_spec.GetPath());
FileSpec symfile_spec = GetSymbolFileSpec(sysroot_module_path_spec);
- if (symfile_spec.Exists()) // delete module's symbol file if exists.
- FileSystem::Unlink(symfile_spec);
+ llvm::sys::fs::remove(symfile_spec.GetPath());
}
Error CreateHostSysRootModuleLink(const FileSpec &root_dir_spec,
@@ -146,7 +145,8 @@ Error CreateHostSysRootModuleLink(const FileSpec &root_dir_spec,
if (error.Fail())
return error;
- return FileSystem::Hardlink(sysroot_module_path_spec, local_module_spec);
+ return llvm::sys::fs::create_hard_link(local_module_spec.GetPath(),
+ sysroot_module_path_spec.GetPath());
}
} // namespace
@@ -179,7 +179,7 @@ void ModuleLock::Delete() {
return;
m_file.Close();
- FileSystem::Unlink(m_file_spec);
+ llvm::sys::fs::remove(m_file_spec.GetPath());
}
/////////////////////////////////////////////////////////////////////////