summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.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/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.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/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index a34c9b89227..fdc13fbc8ac 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -51,7 +51,6 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/FileSystem.h"
using namespace lldb;
using namespace lldb_private;
@@ -2576,13 +2575,9 @@ bool ScriptInterpreterPython::LoadScriptingModule(
Locker::NoSTDIN,
Locker::FreeAcquiredLock |
(init_session ? Locker::TearDownSession : 0));
- namespace fs = llvm::sys::fs;
- fs::file_status st;
- std::error_code ec = status(target_file.GetPath(), st);
- if (ec || st.type() == fs::file_type::status_error ||
- st.type() == fs::file_type::type_unknown ||
- st.type() == fs::file_type::file_not_found) {
+ if (target_file.GetFileType() == FileSpec::eFileTypeInvalid ||
+ target_file.GetFileType() == FileSpec::eFileTypeUnknown) {
// if not a valid file of any sort, check if it might be a filename still
// dot can't be used but / and \ can, and if either is found, reject
if (strchr(pathname, '\\') || strchr(pathname, '/')) {
@@ -2591,8 +2586,9 @@ bool ScriptInterpreterPython::LoadScriptingModule(
}
basename = pathname; // not a filename, probably a package of some sort,
// let it go through
- } else if (is_directory(st) || fs::is_regular_file(st) ||
- st.type() == fs::file_type::symlink_file) {
+ } else if (target_file.GetFileType() == FileSpec::eFileTypeDirectory ||
+ target_file.GetFileType() == FileSpec::eFileTypeRegular ||
+ target_file.GetFileType() == FileSpec::eFileTypeSymbolicLink) {
std::string directory = target_file.GetDirectory().GetCString();
replace_all(directory, "\\", "\\\\");
replace_all(directory, "'", "\\'");
OpenPOWER on IntegriCloud