summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/PluginManager.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-03-07 13:19:15 +0000
committerPavel Labath <labath@google.com>2017-03-07 13:19:15 +0000
commit30e6cbfcfca4836c2b3497d84ffc2043b548b2a6 (patch)
tree3b24106c96c514a5490b04bfe541e2e6a2ac5518 /lldb/source/Core/PluginManager.cpp
parent3d0af578ccc071dc1f9fc1672af55a969e0beb5a (diff)
downloadbcm5719-llvm-30e6cbfcfca4836c2b3497d84ffc2043b548b2a6.tar.gz
bcm5719-llvm-30e6cbfcfca4836c2b3497d84ffc2043b548b2a6.zip
Revert "Use LLVM for all stat-related functionality."
this reverts r297116 because it breaks the unittests and TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat functionality is not a drop-in replacement for lldb's. The former is based on stat(2) (which does symlink resolution), while the latter is based on lstat(2) (which does not). This also reverts subsequent build fixes (r297128, r297120, 297117) and r297119 (Remove FileSpec dependency on FileSystem) which builds on top of this. llvm-svn: 297139
Diffstat (limited to 'lldb/source/Core/PluginManager.cpp')
-rw-r--r--lldb/source/Core/PluginManager.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index 136d722e9bc..71a0f6eccea 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -79,18 +79,18 @@ template <typename FPtrTy> static FPtrTy CastToFPtr(void *VPtr) {
}
static FileSpec::EnumerateDirectoryResult
-LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
+LoadPluginCallback(void *baton, FileSpec::FileType file_type,
const FileSpec &file_spec) {
// PluginManager *plugin_manager = (PluginManager *)baton;
Error error;
- namespace fs = llvm::sys::fs;
// If we have a regular file, a symbolic link or unknown file type, try
// and process the file. We must handle unknown as sometimes the directory
// enumeration might be enumerating a file system that doesn't have correct
// file type information.
- if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
- ft == fs::file_type::type_unknown) {
+ if (file_type == FileSpec::eFileTypeRegular ||
+ file_type == FileSpec::eFileTypeSymbolicLink ||
+ file_type == FileSpec::eFileTypeUnknown) {
FileSpec plugin_file_spec(file_spec);
plugin_file_spec.ResolvePath();
@@ -135,8 +135,9 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
}
}
- if (ft == fs::file_type::directory_file ||
- ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
+ if (file_type == FileSpec::eFileTypeUnknown ||
+ file_type == FileSpec::eFileTypeDirectory ||
+ file_type == FileSpec::eFileTypeSymbolicLink) {
// Try and recurse into anything that a directory or symbolic link.
// We must also do this for unknown as sometimes the directory enumeration
// might be enumerating a file system that doesn't have correct file type
OpenPOWER on IntegriCloud