diff options
author | Zachary Turner <zturner@google.com> | 2017-03-07 03:43:17 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-03-07 03:43:17 +0000 |
commit | 990e3cd8e25970e477840d81972290858caffd50 (patch) | |
tree | 50278a2ce428ac02066aa7611cbe42cc89b11e6e /lldb/source/Target/ModuleCache.cpp | |
parent | 06ec03c2110e1a17271699a95ba28b0a56d9e17b (diff) | |
download | bcm5719-llvm-990e3cd8e25970e477840d81972290858caffd50.tar.gz bcm5719-llvm-990e3cd8e25970e477840d81972290858caffd50.zip |
Use LLVM for all stat-related functionality.
This deletes LLDB's FileType enumeration and replaces all
users, and all calls to functions that check whether a file
exists etc with corresponding calls to LLVM.
Differential Revision: https://reviews.llvm.org/D30624
llvm-svn: 297116
Diffstat (limited to 'lldb/source/Target/ModuleCache.cpp')
-rw-r--r-- | lldb/source/Target/ModuleCache.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lldb/source/Target/ModuleCache.cpp b/lldb/source/Target/ModuleCache.cpp index d01307c23e8..123b6876af2 100644 --- a/lldb/source/Target/ModuleCache.cpp +++ b/lldb/source/Target/ModuleCache.cpp @@ -59,15 +59,19 @@ public: void Delete(); }; -FileSpec JoinPath(const FileSpec &path1, const char *path2) { +static FileSpec JoinPath(const FileSpec &path1, const char *path2) { FileSpec result_spec(path1); result_spec.AppendPathComponent(path2); return result_spec; } -Error MakeDirectory(const FileSpec &dir_path) { - if (dir_path.Exists()) { - if (!dir_path.IsDirectory()) +static Error MakeDirectory(const FileSpec &dir_path) { + llvm::sys::fs::file_status st; + if (status(dir_path.GetPath(), st)) + return Error("Could not stat path"); + + if (exists(st)) { + if (!is_directory(st)) return Error("Invalid existing path"); return Error(); |