diff options
author | Jason Molenda <jmolenda@apple.com> | 2017-03-21 04:45:10 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2017-03-21 04:45:10 +0000 |
commit | 2eb3227f97e9ed5d086a9cc80f9ed590e8a1ff93 (patch) | |
tree | f27e0e5634a00556430f635e843a97543abc6b81 /lldb/source/Target/ModuleCache.cpp | |
parent | 3724ae4e7092c8145e22f5f1fbe4825c0682b907 (diff) | |
download | bcm5719-llvm-2eb3227f97e9ed5d086a9cc80f9ed590e8a1ff93.tar.gz bcm5719-llvm-2eb3227f97e9ed5d086a9cc80f9ed590e8a1ff93.zip |
Revert r298334 until Zachary has a chance to fix the buildbot failure
on macosx.
llvm-svn: 298338
Diffstat (limited to 'lldb/source/Target/ModuleCache.cpp')
-rw-r--r-- | lldb/source/Target/ModuleCache.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Target/ModuleCache.cpp b/lldb/source/Target/ModuleCache.cpp index a4aa26a0e48..b35e2d79b20 100644 --- a/lldb/source/Target/ModuleCache.cpp +++ b/lldb/source/Target/ModuleCache.cpp @@ -13,6 +13,7 @@ #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" @@ -100,12 +101,11 @@ void DeleteExistingModule(const FileSpec &root_dir_spec, module_uuid.GetAsString().c_str(), error.AsCString()); } - namespace fs = llvm::sys::fs; - fs::file_status st; - if (status(sysroot_module_path_spec.GetPath(), st)) + auto link_count = FileSystem::GetHardlinkCount(sysroot_module_path_spec); + if (link_count == -1) return; - if (st.getLinkCount() > 2) // module is referred by other hosts. + if (link_count > 2) // module is referred by other hosts. return; const auto module_spec_dir = GetModuleDirectory(root_dir_spec, module_uuid); @@ -119,10 +119,11 @@ void DecrementRefExistingModule(const FileSpec &root_dir_spec, DeleteExistingModule(root_dir_spec, sysroot_module_path_spec); // Remove sysroot link. - llvm::sys::fs::remove(sysroot_module_path_spec.GetPath()); + FileSystem::Unlink(sysroot_module_path_spec); FileSpec symfile_spec = GetSymbolFileSpec(sysroot_module_path_spec); - llvm::sys::fs::remove(symfile_spec.GetPath()); + if (symfile_spec.Exists()) // delete module's symbol file if exists. + FileSystem::Unlink(symfile_spec); } Error CreateHostSysRootModuleLink(const FileSpec &root_dir_spec, @@ -145,8 +146,7 @@ Error CreateHostSysRootModuleLink(const FileSpec &root_dir_spec, if (error.Fail()) return error; - return llvm::sys::fs::create_hard_link(local_module_spec.GetPath(), - sysroot_module_path_spec.GetPath()); + return FileSystem::Hardlink(sysroot_module_path_spec, local_module_spec); } } // namespace @@ -179,7 +179,7 @@ void ModuleLock::Delete() { return; m_file.Close(); - llvm::sys::fs::remove(m_file_spec.GetPath()); + FileSystem::Unlink(m_file_spec); } ///////////////////////////////////////////////////////////////////////// |