Use LLVM for file / directory enumeration.

FileSpec::EnumerateDirectory has a bunch of platform-specific
gunk in it for posix and non-posix platforms. We can get rid
of all this by using LLVM's easy-to-use directory iterators.

Differential Revision: https://reviews.llvm.org/D30807

llvm-svn: 297598
This commit is contained in:
Zachary Turner
2017-03-13 02:44:39 +00:00
parent 2cc5a18dc2
commit 1f8753479e
5 changed files with 48 additions and 257 deletions

View File

@@ -13,6 +13,10 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#if !defined(LLVM_ON_WIN32)
#include <pwd.h>
#endif
using namespace lldb_private;
using namespace llvm;
@@ -46,7 +50,7 @@ bool StandardTildeExpressionResolver::ResolvePartial(StringRef Expr,
if (Expr.empty())
return false;
SmallString<32> Buffer = "~";
SmallString<32> Buffer("~");
setpwent();
struct passwd *user_entry;
Expr = Expr.drop_front();