<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">LLDB has a consistent notion right now of "is a directory" or "is a regular file." <div class="">If LLVM's notion of this will stay consistent with LLDB going forward, great – we can use LLVM's function.</div><div class="">But if we believe there will be a distinction between the convention in LLDB vs that in LLVM (whether it's about symlink resolution, or anything else), then we should make sure not to force each place that uses the function to be different.</div><div class="">As an aesthetic point, <font face="Menlo" class="">llvm::sys::fs::is_directory(src.ref().GetPath()) </font>is a lot more to write than <font face="Menlo" class="">IsDirectory(src.ref())</font> and takes up more columns.</div><div class=""><br class=""></div><div class="">Sean</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 7, 2017, at 10:25 AM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I actually think there should be a strong separation between FileSpec and the underlying FileSystem, because a FileSpec doesn't necessarily represent something on the local file system, and we shouldn't give off the false impression that it does.  <div class=""><br class=""></div><div class="">I don't follow regarding the global function though.  Do you mean less one-time churn for doing the initial switch, or less continuous churn whenever the underlying API changes?  Because If we don't go through the FileSpec API, I don't follow how a global function in LLDB leads to less churn in either case.</div><div class=""><br class=""></div><div class="">In any case, I really think we need as little code in LLDB as possible.  Every bit of code in LLDB is just an additional thing that is (most likely) insufficiently tested, and a one-line wrapper just so that it's in the LLDB namespace helps nobody.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Mar 7, 2017 at 10:17 AM Sean Callanan via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, Pavel.<br class="gmail_msg">
I think if we do this again we should indirect the new API through the LLDB FileSpec API or at least a global function somewhere in LLDB, so that we can change implementations without having to touch so much source code.<br class="gmail_msg">
<br class="gmail_msg">
Sean<br class="gmail_msg">
<br class="gmail_msg">
> On Mar 7, 2017, at 5:19 AM, Pavel Labath via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="gmail_msg" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
> Author: labath<br class="gmail_msg">
> Date: Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> New Revision: 297139<br class="gmail_msg">
><br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=297139&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=297139&view=rev</a><br class="gmail_msg">
> Log:<br class="gmail_msg">
> Revert "Use LLVM for all stat-related functionality."<br class="gmail_msg">
><br class="gmail_msg">
> this reverts r297116 because it breaks the unittests and<br class="gmail_msg">
> TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but<br class="gmail_msg">
> the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat<br class="gmail_msg">
> functionality is not a drop-in replacement for lldb's. The former is<br class="gmail_msg">
> based on stat(2) (which does symlink resolution), while the latter is<br class="gmail_msg">
> based on lstat(2) (which does not).<br class="gmail_msg">
><br class="gmail_msg">
> This also reverts subsequent build fixes (r297128, r297120, 297117) and<br class="gmail_msg">
> r297119 (Remove FileSpec dependency on FileSystem) which builds on top<br class="gmail_msg">
> of this.<br class="gmail_msg">
><br class="gmail_msg">
> Modified:<br class="gmail_msg">
>    lldb/trunk/include/lldb/Host/FileSpec.h<br class="gmail_msg">
>    lldb/trunk/source/API/SBPlatform.cpp<br class="gmail_msg">
>    lldb/trunk/source/Commands/CommandCompletions.cpp<br class="gmail_msg">
>    lldb/trunk/source/Commands/CommandObjectTarget.cpp<br class="gmail_msg">
>    lldb/trunk/source/Core/Debugger.cpp<br class="gmail_msg">
>    lldb/trunk/source/Core/FileSpecList.cpp<br class="gmail_msg">
>    lldb/trunk/source/Core/Module.cpp<br class="gmail_msg">
>    lldb/trunk/source/Core/ModuleList.cpp<br class="gmail_msg">
>    lldb/trunk/source/Core/PluginManager.cpp<br class="gmail_msg">
>    lldb/trunk/source/Host/common/FileSpec.cpp<br class="gmail_msg">
>    lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp<br class="gmail_msg">
>    lldb/trunk/source/Host/common/Symbols.cpp<br class="gmail_msg">
>    lldb/trunk/source/Host/macosx/Host.mm<br class="gmail_msg">
>    lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm<br class="gmail_msg">
>    lldb/trunk/source/Host/macosx/Symbols.cpp<br class="gmail_msg">
>    lldb/trunk/source/Host/posix/FileSystem.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp<br class="gmail_msg">
>    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp<br class="gmail_msg">
>    lldb/trunk/source/Target/ModuleCache.cpp<br class="gmail_msg">
>    lldb/trunk/source/Target/Platform.cpp<br class="gmail_msg">
>    lldb/trunk/source/Target/TargetList.cpp<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/include/lldb/Host/FileSpec.h<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSpec.h?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSpec.h?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/include/lldb/Host/FileSpec.h (original)<br class="gmail_msg">
> +++ lldb/trunk/include/lldb/Host/FileSpec.h Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -22,7 +22,6 @@<br class="gmail_msg">
> #include "lldb/lldb-private.h"<br class="gmail_msg">
><br class="gmail_msg">
> #include "llvm/ADT/Triple.h"<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> #include "llvm/Support/FormatVariadic.h"<br class="gmail_msg">
><br class="gmail_msg">
> namespace lldb_private {<br class="gmail_msg">
> @@ -47,6 +46,17 @@ namespace lldb_private {<br class="gmail_msg">
> //----------------------------------------------------------------------<br class="gmail_msg">
> class FileSpec {<br class="gmail_msg">
> public:<br class="gmail_msg">
> +  typedef enum FileType {<br class="gmail_msg">
> +    eFileTypeInvalid = -1,<br class="gmail_msg">
> +    eFileTypeUnknown = 0,<br class="gmail_msg">
> +    eFileTypeDirectory,<br class="gmail_msg">
> +    eFileTypePipe,<br class="gmail_msg">
> +    eFileTypeRegular,<br class="gmail_msg">
> +    eFileTypeSocket,<br class="gmail_msg">
> +    eFileTypeSymbolicLink,<br class="gmail_msg">
> +    eFileTypeOther<br class="gmail_msg">
> +  } FileType;<br class="gmail_msg">
> +<br class="gmail_msg">
>   enum PathSyntax {<br class="gmail_msg">
>     ePathSyntaxPosix,<br class="gmail_msg">
>     ePathSyntaxWindows,<br class="gmail_msg">
> @@ -445,6 +455,8 @@ public:<br class="gmail_msg">
>   //------------------------------------------------------------------<br class="gmail_msg">
>   ConstString GetFileNameStrippingExtension() const;<br class="gmail_msg">
><br class="gmail_msg">
> +  FileType GetFileType() const;<br class="gmail_msg">
> +<br class="gmail_msg">
>   //------------------------------------------------------------------<br class="gmail_msg">
>   /// Return the current permissions of the path.<br class="gmail_msg">
>   ///<br class="gmail_msg">
> @@ -459,6 +471,20 @@ public:<br class="gmail_msg">
>   //------------------------------------------------------------------<br class="gmail_msg">
>   uint32_t GetPermissions() const;<br class="gmail_msg">
><br class="gmail_msg">
> +  bool IsDirectory() const {<br class="gmail_msg">
> +    return GetFileType() == FileSpec::eFileTypeDirectory;<br class="gmail_msg">
> +  }<br class="gmail_msg">
> +<br class="gmail_msg">
> +  bool IsPipe() const { return GetFileType() == FileSpec::eFileTypePipe; }<br class="gmail_msg">
> +<br class="gmail_msg">
> +  bool IsRegularFile() const {<br class="gmail_msg">
> +    return GetFileType() == FileSpec::eFileTypeRegular;<br class="gmail_msg">
> +  }<br class="gmail_msg">
> +<br class="gmail_msg">
> +  bool IsSocket() const { return GetFileType() == FileSpec::eFileTypeSocket; }<br class="gmail_msg">
> +<br class="gmail_msg">
> +  bool IsSymbolicLink() const;<br class="gmail_msg">
> +<br class="gmail_msg">
>   //------------------------------------------------------------------<br class="gmail_msg">
>   /// Get the memory cost of this object.<br class="gmail_msg">
>   ///<br class="gmail_msg">
> @@ -570,7 +596,7 @@ public:<br class="gmail_msg">
>   };<br class="gmail_msg">
><br class="gmail_msg">
>   typedef EnumerateDirectoryResult (*EnumerateDirectoryCallbackType)(<br class="gmail_msg">
> -      void *baton, llvm::sys::fs::file_type file_type, const FileSpec &spec);<br class="gmail_msg">
> +      void *baton, FileType file_type, const FileSpec &spec);<br class="gmail_msg">
><br class="gmail_msg">
>   static EnumerateDirectoryResult<br class="gmail_msg">
>   EnumerateDirectory(llvm::StringRef dir_path, bool find_directories,<br class="gmail_msg">
> @@ -578,8 +604,8 @@ public:<br class="gmail_msg">
>                      EnumerateDirectoryCallbackType callback,<br class="gmail_msg">
>                      void *callback_baton);<br class="gmail_msg">
><br class="gmail_msg">
> -  typedef std::function<EnumerateDirectoryResult(<br class="gmail_msg">
> -      llvm::sys::fs::file_type file_type, const FileSpec &spec)><br class="gmail_msg">
> +  typedef std::function<EnumerateDirectoryResult(FileType file_type,<br class="gmail_msg">
> +                                                 const FileSpec &spec)><br class="gmail_msg">
>       DirectoryCallback;<br class="gmail_msg">
><br class="gmail_msg">
>   static EnumerateDirectoryResult<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/API/SBPlatform.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBPlatform.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBPlatform.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/API/SBPlatform.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/API/SBPlatform.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -19,8 +19,6 @@<br class="gmail_msg">
> #include "lldb/Target/Target.h"<br class="gmail_msg">
> #include "lldb/Utility/Error.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> #include <functional><br class="gmail_msg">
><br class="gmail_msg">
> using namespace lldb;<br class="gmail_msg">
> @@ -365,7 +363,7 @@ SBError SBPlatform::Put(SBFileSpec &src,<br class="gmail_msg">
>     if (src.Exists()) {<br class="gmail_msg">
>       uint32_t permissions = src.ref().GetPermissions();<br class="gmail_msg">
>       if (permissions == 0) {<br class="gmail_msg">
> -        if (llvm::sys::fs::is_directory(src.ref().GetPath()))<br class="gmail_msg">
> +        if (src.ref().GetFileType() == FileSpec::eFileTypeDirectory)<br class="gmail_msg">
>           permissions = eFilePermissionsDirectoryDefault;<br class="gmail_msg">
>         else<br class="gmail_msg">
>           permissions = eFilePermissionsFileDefault;<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Commands/CommandCompletions.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Commands/CommandCompletions.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Commands/CommandCompletions.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -33,7 +33,6 @@<br class="gmail_msg">
> #include "lldb/Utility/CleanUp.h"<br class="gmail_msg">
><br class="gmail_msg">
> #include "llvm/ADT/SmallString.h"<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
><br class="gmail_msg">
> using namespace lldb_private;<br class="gmail_msg">
><br class="gmail_msg">
> @@ -110,7 +109,7 @@ typedef struct DiskFilesOrDirectoriesBat<br class="gmail_msg">
> } DiskFilesOrDirectoriesBaton;<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -DiskFilesOrDirectoriesCallback(void *baton, llvm::sys::fs::file_type file_type,<br class="gmail_msg">
> +DiskFilesOrDirectoriesCallback(void *baton, FileSpec::FileType file_type,<br class="gmail_msg">
>                                const FileSpec &spec) {<br class="gmail_msg">
>   const char *name = spec.GetFilename().AsCString();<br class="gmail_msg">
><br class="gmail_msg">
> @@ -139,10 +138,10 @@ DiskFilesOrDirectoriesCallback(void *bat<br class="gmail_msg">
>     strcpy(end_ptr, name);<br class="gmail_msg">
><br class="gmail_msg">
>     bool isa_directory = false;<br class="gmail_msg">
> -    if (file_type == llvm::sys::fs::file_type::directory_file)<br class="gmail_msg">
> +    if (file_type == FileSpec::eFileTypeDirectory)<br class="gmail_msg">
>       isa_directory = true;<br class="gmail_msg">
> -    else if (file_type == llvm::sys::fs::file_type::symlink_file) {<br class="gmail_msg">
> -      if (llvm::sys::fs::is_directory(partial_name_copy))<br class="gmail_msg">
> +    else if (file_type == FileSpec::eFileTypeSymbolicLink) {<br class="gmail_msg">
> +      if (FileSpec(partial_name_copy, false).IsDirectory())<br class="gmail_msg">
>         isa_directory = true;<br class="gmail_msg">
>     }<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -50,8 +50,6 @@<br class="gmail_msg">
> #include "lldb/Target/Thread.h"<br class="gmail_msg">
> #include "lldb/Target/ThreadSpec.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> // C Includes<br class="gmail_msg">
> // C++ Includes<br class="gmail_msg">
> #include <cerrno><br class="gmail_msg">
> @@ -4138,21 +4136,20 @@ protected:<br class="gmail_msg">
>         module_sp->SetSymbolFileFileSpec(FileSpec());<br class="gmail_msg">
>       }<br class="gmail_msg">
><br class="gmail_msg">
> -      namespace fs = llvm::sys::fs;<br class="gmail_msg">
>       if (module_spec.GetUUID().IsValid()) {<br class="gmail_msg">
>         StreamString ss_symfile_uuid;<br class="gmail_msg">
>         module_spec.GetUUID().Dump(&ss_symfile_uuid);<br class="gmail_msg">
>         result.AppendErrorWithFormat(<br class="gmail_msg">
>             "symbol file '%s' (%s) does not match any existing module%s\n",<br class="gmail_msg">
>             symfile_path, ss_symfile_uuid.GetData(),<br class="gmail_msg">
> -            !fs::is_regular_file(symbol_fspec.GetPath())<br class="gmail_msg">
> +            (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)<br class="gmail_msg">
>                 ? "\n       please specify the full path to the symbol file"<br class="gmail_msg">
>                 : "");<br class="gmail_msg">
>       } else {<br class="gmail_msg">
>         result.AppendErrorWithFormat(<br class="gmail_msg">
>             "symbol file '%s' does not match any existing module%s\n",<br class="gmail_msg">
>             symfile_path,<br class="gmail_msg">
> -            !fs::is_regular_file(symbol_fspec.GetPath())<br class="gmail_msg">
> +            (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)<br class="gmail_msg">
>                 ? "\n       please specify the full path to the symbol file"<br class="gmail_msg">
>                 : "");<br class="gmail_msg">
>       }<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Core/Debugger.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Core/Debugger.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Core/Debugger.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -557,7 +557,7 @@ bool Debugger::LoadPlugin(const FileSpec<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> static FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +LoadPluginCallback(void *baton, FileSpec::FileType file_type,<br class="gmail_msg">
>                    const FileSpec &file_spec) {<br class="gmail_msg">
>   Error error;<br class="gmail_msg">
><br class="gmail_msg">
> @@ -569,13 +569,13 @@ LoadPluginCallback(void *baton, llvm::sy<br class="gmail_msg">
><br class="gmail_msg">
>   Debugger *debugger = (Debugger *)baton;<br class="gmail_msg">
><br class="gmail_msg">
> -  namespace fs = llvm::sys::fs;<br class="gmail_msg">
>   // If we have a regular file, a symbolic link or unknown file type, try<br class="gmail_msg">
>   // and process the file. We must handle unknown as sometimes the directory<br class="gmail_msg">
>   // enumeration might be enumerating a file system that doesn't have correct<br class="gmail_msg">
>   // file type information.<br class="gmail_msg">
> -  if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||<br class="gmail_msg">
> -      ft == fs::file_type::type_unknown) {<br class="gmail_msg">
> +  if (file_type == FileSpec::eFileTypeRegular ||<br class="gmail_msg">
> +      file_type == FileSpec::eFileTypeSymbolicLink ||<br class="gmail_msg">
> +      file_type == FileSpec::eFileTypeUnknown) {<br class="gmail_msg">
>     FileSpec plugin_file_spec(file_spec);<br class="gmail_msg">
>     plugin_file_spec.ResolvePath();<br class="gmail_msg">
><br class="gmail_msg">
> @@ -588,9 +588,9 @@ LoadPluginCallback(void *baton, llvm::sy<br class="gmail_msg">
>     debugger->LoadPlugin(plugin_file_spec, plugin_load_error);<br class="gmail_msg">
><br class="gmail_msg">
>     return FileSpec::eEnumerateDirectoryResultNext;<br class="gmail_msg">
> -  } else if (ft == fs::file_type::directory_file ||<br class="gmail_msg">
> -             ft == fs::file_type::symlink_file ||<br class="gmail_msg">
> -             ft == fs::file_type::type_unknown) {<br class="gmail_msg">
> +  } else if (file_type == FileSpec::eFileTypeUnknown ||<br class="gmail_msg">
> +             file_type == FileSpec::eFileTypeDirectory ||<br class="gmail_msg">
> +             file_type == FileSpec::eFileTypeSymbolicLink) {<br class="gmail_msg">
>     // Try and recurse into anything that a directory or symbolic link.<br class="gmail_msg">
>     // We must also do this for unknown as sometimes the directory enumeration<br class="gmail_msg">
>     // might be enumerating a file system that doesn't have correct file type<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Core/FileSpecList.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpecList.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpecList.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Core/FileSpecList.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Core/FileSpecList.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -16,7 +16,6 @@<br class="gmail_msg">
> // Other libraries and framework includes<br class="gmail_msg">
> // Project includes<br class="gmail_msg">
> #include "lldb/Utility/Stream.h"<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
><br class="gmail_msg">
> using namespace lldb_private;<br class="gmail_msg">
> using namespace std;<br class="gmail_msg">
> @@ -151,23 +150,32 @@ size_t FileSpecList::GetFilesMatchingPar<br class="gmail_msg">
>                                                  FileSpecList &matches) {<br class="gmail_msg">
> #if 0 // FIXME: Just sketching...<br class="gmail_msg">
>     matches.Clear();<br class="gmail_msg">
> -    using namespace llvm::sys::fs;<br class="gmail_msg">
> -    file_status stats;<br class="gmail_msg">
> -    if (status(path, stats))<br class="gmail_msg">
> -      return 0;<br class="gmail_msg">
> -    if (exists(stats)) {<br class="gmail_msg">
> -      if (stats.type() == file_type::symlink_file) {<br class="gmail_msg">
> -        // Shouldn't there be a method that realpath's a file?<br class="gmail_msg">
> -      }<br class="gmail_msg">
> -      if (is_regular_file(stats) || (is_directory(stats) && dir_okay)) {<br class="gmail_msg">
> -        matches.Append(FileSpec(path));<br class="gmail_msg">
> -        return 1;<br class="gmail_msg">
> -      } else if (is_directory(stats)) {<br class="gmail_msg">
> -        // Fill the match list with all the files in the directory:<br class="gmail_msg">
> -      } else {<br class="gmail_msg">
> -        return 0;<br class="gmail_msg">
> -      }<br class="gmail_msg">
> -    } else {<br class="gmail_msg">
> +    FileSpec path_spec = FileSpec (path);<br class="gmail_msg">
> +    if (path_spec.Exists ())<br class="gmail_msg">
> +    {<br class="gmail_msg">
> +        FileSpec::FileType type = path_spec.GetFileType();<br class="gmail_msg">
> +        if (type == FileSpec::eFileTypeSymbolicLink)<br class="gmail_msg">
> +            // Shouldn't there be a Resolve on a file spec that real-path's it?<br class="gmail_msg">
> +        {<br class="gmail_msg">
> +        }<br class="gmail_msg">
> +<br class="gmail_msg">
> +        if (type == FileSpec::eFileTypeRegular<br class="gmail_msg">
> +            || (type == FileSpec::eFileTypeDirectory && dir_okay))<br class="gmail_msg">
> +        {<br class="gmail_msg">
> +            matches.Append (path_spec);<br class="gmail_msg">
> +            return 1;<br class="gmail_msg">
> +        }<br class="gmail_msg">
> +        else if (type == FileSpec::eFileTypeDirectory)<br class="gmail_msg">
> +        {<br class="gmail_msg">
> +            // Fill the match list with all the files in the directory:<br class="gmail_msg">
> +        }<br class="gmail_msg">
> +        else<br class="gmail_msg">
> +        {<br class="gmail_msg">
> +            return 0;<br class="gmail_msg">
> +        }<br class="gmail_msg">
> +    }<br class="gmail_msg">
> +    else<br class="gmail_msg">
> +    {<br class="gmail_msg">
>         ConstString dir_name = path_spec.GetDirectory();<br class="gmail_msg">
>         ConstString file_name = GetFilename();<br class="gmail_msg">
>         if (dir_name == nullptr)<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Core/Module.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Core/Module.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Core/Module.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -12,7 +12,6 @@<br class="gmail_msg">
> // C Includes<br class="gmail_msg">
> // C++ Includes<br class="gmail_msg">
> // Other libraries and framework includes<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> #include "llvm/Support/Signals.h"<br class="gmail_msg">
> #include "llvm/Support/raw_os_ostream.h"<br class="gmail_msg">
><br class="gmail_msg">
> @@ -1440,7 +1439,7 @@ void Module::SetSymbolFileFileSpec(const<br class="gmail_msg">
>         // ("/tmp/a.out.dSYM/Contents/Resources/DWARF/a.out"). So we need to<br class="gmail_msg">
>         // check this<br class="gmail_msg">
><br class="gmail_msg">
> -        if (llvm::sys::fs::is_directory(file.GetPath())) {<br class="gmail_msg">
> +        if (file.IsDirectory()) {<br class="gmail_msg">
>           std::string new_path(file.GetPath());<br class="gmail_msg">
>           std::string old_path(obj_file->GetFileSpec().GetPath());<br class="gmail_msg">
>           if (old_path.find(new_path) == 0) {<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Core/ModuleList.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Core/ModuleList.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Core/ModuleList.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -26,7 +26,6 @@<br class="gmail_msg">
> #include "lldb/Symbol/VariableList.h"<br class="gmail_msg">
> #include "lldb/Utility/Log.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> #include "llvm/Support/Threading.h"<br class="gmail_msg">
><br class="gmail_msg">
> using namespace lldb;<br class="gmail_msg">
> @@ -767,8 +766,7 @@ Error ModuleList::GetSharedModule(const<br class="gmail_msg">
>       auto search_path_spec = module_search_paths_ptr->GetFileSpecAtIndex(idx);<br class="gmail_msg">
>       if (!search_path_spec.ResolvePath())<br class="gmail_msg">
>         continue;<br class="gmail_msg">
> -      namespace fs = llvm::sys::fs;<br class="gmail_msg">
> -      if (!fs::is_directory(search_path_spec.GetPath()))<br class="gmail_msg">
> +      if (!search_path_spec.Exists() || !search_path_spec.IsDirectory())<br class="gmail_msg">
>         continue;<br class="gmail_msg">
>       search_path_spec.AppendPathComponent(<br class="gmail_msg">
>           module_spec.GetFileSpec().GetFilename().AsCString());<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Core/PluginManager.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/PluginManager.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Core/PluginManager.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Core/PluginManager.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -79,18 +79,18 @@ template <typename FPtrTy> static FPtrTy<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> static FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +LoadPluginCallback(void *baton, FileSpec::FileType file_type,<br class="gmail_msg">
>                    const FileSpec &file_spec) {<br class="gmail_msg">
>   //    PluginManager *plugin_manager = (PluginManager *)baton;<br class="gmail_msg">
>   Error error;<br class="gmail_msg">
><br class="gmail_msg">
> -  namespace fs = llvm::sys::fs;<br class="gmail_msg">
>   // If we have a regular file, a symbolic link or unknown file type, try<br class="gmail_msg">
>   // and process the file. We must handle unknown as sometimes the directory<br class="gmail_msg">
>   // enumeration might be enumerating a file system that doesn't have correct<br class="gmail_msg">
>   // file type information.<br class="gmail_msg">
> -  if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||<br class="gmail_msg">
> -      ft == fs::file_type::type_unknown) {<br class="gmail_msg">
> +  if (file_type == FileSpec::eFileTypeRegular ||<br class="gmail_msg">
> +      file_type == FileSpec::eFileTypeSymbolicLink ||<br class="gmail_msg">
> +      file_type == FileSpec::eFileTypeUnknown) {<br class="gmail_msg">
>     FileSpec plugin_file_spec(file_spec);<br class="gmail_msg">
>     plugin_file_spec.ResolvePath();<br class="gmail_msg">
><br class="gmail_msg">
> @@ -135,8 +135,9 @@ LoadPluginCallback(void *baton, llvm::sy<br class="gmail_msg">
>     }<br class="gmail_msg">
>   }<br class="gmail_msg">
><br class="gmail_msg">
> -  if (ft == fs::file_type::directory_file ||<br class="gmail_msg">
> -      ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {<br class="gmail_msg">
> +  if (file_type == FileSpec::eFileTypeUnknown ||<br class="gmail_msg">
> +      file_type == FileSpec::eFileTypeDirectory ||<br class="gmail_msg">
> +      file_type == FileSpec::eFileTypeSymbolicLink) {<br class="gmail_msg">
>     // Try and recurse into anything that a directory or symbolic link.<br class="gmail_msg">
>     // We must also do this for unknown as sometimes the directory enumeration<br class="gmail_msg">
>     // might be enumerating a file system that doesn't have correct file type<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Host/common/FileSpec.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Host/common/FileSpec.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Host/common/FileSpec.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -27,6 +27,7 @@<br class="gmail_msg">
><br class="gmail_msg">
> #include "lldb/Core/StringList.h"<br class="gmail_msg">
> #include "lldb/Host/FileSpec.h"<br class="gmail_msg">
> +#include "lldb/Host/FileSystem.h"<br class="gmail_msg">
> #include "lldb/Utility/CleanUp.h"<br class="gmail_msg">
> #include "lldb/Utility/RegularExpression.h"<br class="gmail_msg">
> #include "lldb/Utility/Stream.h"<br class="gmail_msg">
> @@ -44,18 +45,10 @@ using namespace lldb_private;<br class="gmail_msg">
><br class="gmail_msg">
> namespace {<br class="gmail_msg">
><br class="gmail_msg">
> -static constexpr FileSpec::PathSyntax GetNativeSyntax() {<br class="gmail_msg">
> -#if defined(LLVM_ON_WIN32)<br class="gmail_msg">
> -  return FileSpec::ePathSyntaxWindows;<br class="gmail_msg">
> -#else<br class="gmail_msg">
> -  return FileSpec::ePathSyntaxPosix;<br class="gmail_msg">
> -#endif<br class="gmail_msg">
> -}<br class="gmail_msg">
> -<br class="gmail_msg">
> bool PathSyntaxIsPosix(FileSpec::PathSyntax syntax) {<br class="gmail_msg">
>   return (syntax == FileSpec::ePathSyntaxPosix ||<br class="gmail_msg">
>           (syntax == FileSpec::ePathSyntaxHostNative &&<br class="gmail_msg">
> -           GetNativeSyntax() == FileSpec::ePathSyntaxPosix));<br class="gmail_msg">
> +           FileSystem::GetNativePathSyntax() == FileSpec::ePathSyntaxPosix));<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> const char *GetPathSeparators(FileSpec::PathSyntax syntax) {<br class="gmail_msg">
> @@ -91,6 +84,13 @@ void Denormalize(llvm::SmallVectorImpl<c<br class="gmail_msg">
>   std::replace(path.begin(), path.end(), '/', '\\');<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> +bool GetFileStats(const FileSpec *file_spec, struct stat *stats_ptr) {<br class="gmail_msg">
> +  char resolved_path[PATH_MAX];<br class="gmail_msg">
> +  if (file_spec->GetPath(resolved_path, sizeof(resolved_path)))<br class="gmail_msg">
> +    return FileSystem::Stat(resolved_path, stats_ptr) == 0;<br class="gmail_msg">
> +  return false;<br class="gmail_msg">
> +}<br class="gmail_msg">
> +<br class="gmail_msg">
> size_t FilenamePos(llvm::StringRef str, FileSpec::PathSyntax syntax) {<br class="gmail_msg">
>   if (str.size() == 2 && IsPathSeparator(str[0], syntax) && str[0] == str[1])<br class="gmail_msg">
>     return 0;<br class="gmail_msg">
> @@ -273,7 +273,7 @@ void FileSpec::Resolve(llvm::SmallVector<br class="gmail_msg">
>   }<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> -FileSpec::FileSpec() : m_syntax(GetNativeSyntax()) {}<br class="gmail_msg">
> +FileSpec::FileSpec() : m_syntax(FileSystem::GetNativePathSyntax()) {}<br class="gmail_msg">
><br class="gmail_msg">
> //------------------------------------------------------------------<br class="gmail_msg">
> // Default constructor that can take an optional full path to a<br class="gmail_msg">
> @@ -336,7 +336,9 @@ void FileSpec::SetFile(llvm::StringRef p<br class="gmail_msg">
>   m_filename.Clear();<br class="gmail_msg">
>   m_directory.Clear();<br class="gmail_msg">
>   m_is_resolved = false;<br class="gmail_msg">
> -  m_syntax = (syntax == ePathSyntaxHostNative) ? GetNativeSyntax() : syntax;<br class="gmail_msg">
> +  m_syntax = (syntax == ePathSyntaxHostNative)<br class="gmail_msg">
> +                 ? FileSystem::GetNativePathSyntax()<br class="gmail_msg">
> +                 : syntax;<br class="gmail_msg">
><br class="gmail_msg">
>   if (pathname.empty())<br class="gmail_msg">
>     return;<br class="gmail_msg">
> @@ -613,10 +615,16 @@ void FileSpec::Dump(Stream *s) const {<br class="gmail_msg">
> //------------------------------------------------------------------<br class="gmail_msg">
> // Returns true if the file exists.<br class="gmail_msg">
> //------------------------------------------------------------------<br class="gmail_msg">
> -bool FileSpec::Exists() const { return llvm::sys::fs::exists(GetPath()); }<br class="gmail_msg">
> +bool FileSpec::Exists() const {<br class="gmail_msg">
> +  struct stat file_stats;<br class="gmail_msg">
> +  return GetFileStats(this, &file_stats);<br class="gmail_msg">
> +}<br class="gmail_msg">
><br class="gmail_msg">
> bool FileSpec::Readable() const {<br class="gmail_msg">
> -  return GetPermissions() & llvm::sys::fs::perms::all_read;<br class="gmail_msg">
> +  const uint32_t permissions = GetPermissions();<br class="gmail_msg">
> +  if (permissions & eFilePermissionsEveryoneR)<br class="gmail_msg">
> +    return true;<br class="gmail_msg">
> +  return false;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> bool FileSpec::ResolveExecutableLocation() {<br class="gmail_msg">
> @@ -669,21 +677,67 @@ bool FileSpec::ResolvePath() {<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> uint64_t FileSpec::GetByteSize() const {<br class="gmail_msg">
> -  uint64_t Size = 0;<br class="gmail_msg">
> -  if (llvm::sys::fs::file_size(GetPath(), Size))<br class="gmail_msg">
> -    return 0;<br class="gmail_msg">
> -  return Size;<br class="gmail_msg">
> +  struct stat file_stats;<br class="gmail_msg">
> +  if (GetFileStats(this, &file_stats))<br class="gmail_msg">
> +    return file_stats.st_size;<br class="gmail_msg">
> +  return 0;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::PathSyntax FileSpec::GetPathSyntax() const { return m_syntax; }<br class="gmail_msg">
><br class="gmail_msg">
> -uint32_t FileSpec::GetPermissions() const {<br class="gmail_msg">
> -  namespace fs = llvm::sys::fs;<br class="gmail_msg">
> -  fs::file_status st;<br class="gmail_msg">
> -  if (fs::status(GetPath(), st))<br class="gmail_msg">
> -    return fs::perms::perms_not_known;<br class="gmail_msg">
> +FileSpec::FileType FileSpec::GetFileType() const {<br class="gmail_msg">
> +  struct stat file_stats;<br class="gmail_msg">
> +  if (GetFileStats(this, &file_stats)) {<br class="gmail_msg">
> +    mode_t file_type = file_stats.st_mode & S_IFMT;<br class="gmail_msg">
> +    switch (file_type) {<br class="gmail_msg">
> +    case S_IFDIR:<br class="gmail_msg">
> +      return eFileTypeDirectory;<br class="gmail_msg">
> +    case S_IFREG:<br class="gmail_msg">
> +      return eFileTypeRegular;<br class="gmail_msg">
> +#ifndef _WIN32<br class="gmail_msg">
> +    case S_IFIFO:<br class="gmail_msg">
> +      return eFileTypePipe;<br class="gmail_msg">
> +    case S_IFSOCK:<br class="gmail_msg">
> +      return eFileTypeSocket;<br class="gmail_msg">
> +    case S_IFLNK:<br class="gmail_msg">
> +      return eFileTypeSymbolicLink;<br class="gmail_msg">
> +#endif<br class="gmail_msg">
> +    default:<br class="gmail_msg">
> +      break;<br class="gmail_msg">
> +    }<br class="gmail_msg">
> +    return eFileTypeUnknown;<br class="gmail_msg">
> +  }<br class="gmail_msg">
> +  return eFileTypeInvalid;<br class="gmail_msg">
> +}<br class="gmail_msg">
> +<br class="gmail_msg">
> +bool FileSpec::IsSymbolicLink() const {<br class="gmail_msg">
> +  char resolved_path[PATH_MAX];<br class="gmail_msg">
> +  if (!GetPath(resolved_path, sizeof(resolved_path)))<br class="gmail_msg">
> +    return false;<br class="gmail_msg">
> +<br class="gmail_msg">
> +#ifdef _WIN32<br class="gmail_msg">
> +  std::wstring wpath;<br class="gmail_msg">
> +  if (!llvm::ConvertUTF8toWide(resolved_path, wpath))<br class="gmail_msg">
> +    return false;<br class="gmail_msg">
> +  auto attrs = ::GetFileAttributesW(wpath.c_str());<br class="gmail_msg">
> +  if (attrs == INVALID_FILE_ATTRIBUTES)<br class="gmail_msg">
> +    return false;<br class="gmail_msg">
><br class="gmail_msg">
> -  return st.permissions();<br class="gmail_msg">
> +  return (attrs & FILE_ATTRIBUTE_REPARSE_POINT);<br class="gmail_msg">
> +#else<br class="gmail_msg">
> +  struct stat file_stats;<br class="gmail_msg">
> +  if (::lstat(resolved_path, &file_stats) != 0)<br class="gmail_msg">
> +    return false;<br class="gmail_msg">
> +<br class="gmail_msg">
> +  return (file_stats.st_mode & S_IFMT) == S_IFLNK;<br class="gmail_msg">
> +#endif<br class="gmail_msg">
> +}<br class="gmail_msg">
> +<br class="gmail_msg">
> +uint32_t FileSpec::GetPermissions() const {<br class="gmail_msg">
> +  uint32_t file_permissions = 0;<br class="gmail_msg">
> +  if (*this)<br class="gmail_msg">
> +    FileSystem::GetFilePermissions(*this, file_permissions);<br class="gmail_msg">
> +  return file_permissions;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> //------------------------------------------------------------------<br class="gmail_msg">
> @@ -799,8 +853,7 @@ FileSpec::ForEachItemInDirectory(llvm::S<br class="gmail_msg">
>     }<br class="gmail_msg">
><br class="gmail_msg">
>     do {<br class="gmail_msg">
> -      namespace fs = llvm::sys::fs;<br class="gmail_msg">
> -      fs::file_type ft = fs::file_type::type_unknown;<br class="gmail_msg">
> +      FileSpec::FileType file_type = eFileTypeUnknown;<br class="gmail_msg">
>       if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {<br class="gmail_msg">
>         size_t len = wcslen(ffd.cFileName);<br class="gmail_msg">
><br class="gmail_msg">
> @@ -810,11 +863,11 @@ FileSpec::ForEachItemInDirectory(llvm::S<br class="gmail_msg">
>         if (len == 2 && ffd.cFileName[0] == L'.' && ffd.cFileName[1] == L'.')<br class="gmail_msg">
>           continue;<br class="gmail_msg">
><br class="gmail_msg">
> -        ft = fs::file_type::directory_file;<br class="gmail_msg">
> +        file_type = eFileTypeDirectory;<br class="gmail_msg">
>       } else if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DEVICE) {<br class="gmail_msg">
> -        ft = fs::file_type::type_unknown;<br class="gmail_msg">
> +        file_type = eFileTypeOther;<br class="gmail_msg">
>       } else {<br class="gmail_msg">
> -        ft = fs::file_type::regular_file;<br class="gmail_msg">
> +        file_type = eFileTypeRegular;<br class="gmail_msg">
>       }<br class="gmail_msg">
><br class="gmail_msg">
>       std::string fileName;<br class="gmail_msg">
> @@ -826,7 +879,7 @@ FileSpec::ForEachItemInDirectory(llvm::S<br class="gmail_msg">
>       // Don't resolve the file type or path<br class="gmail_msg">
>       FileSpec child_path_spec(child_path.data(), false);<br class="gmail_msg">
><br class="gmail_msg">
> -      EnumerateDirectoryResult result = callback(ft, child_path_spec);<br class="gmail_msg">
> +      EnumerateDirectoryResult result = callback(file_type, child_path_spec);<br class="gmail_msg">
><br class="gmail_msg">
>       switch (result) {<br class="gmail_msg">
>       case eEnumerateDirectoryResultNext:<br class="gmail_msg">
> @@ -887,38 +940,37 @@ FileSpec::ForEachItemInDirectory(llvm::S<br class="gmail_msg">
>             continue;<br class="gmail_msg">
>         }<br class="gmail_msg">
><br class="gmail_msg">
> -        using namespace llvm::sys::fs;<br class="gmail_msg">
> -        file_type ft = file_type::type_unknown;<br class="gmail_msg">
> +        FileSpec::FileType file_type = eFileTypeUnknown;<br class="gmail_msg">
><br class="gmail_msg">
>         switch (dp->d_type) {<br class="gmail_msg">
>         default:<br class="gmail_msg">
>         case DT_UNKNOWN:<br class="gmail_msg">
> -          ft = file_type::type_unknown;<br class="gmail_msg">
> +          file_type = eFileTypeUnknown;<br class="gmail_msg">
>           break;<br class="gmail_msg">
>         case DT_FIFO:<br class="gmail_msg">
> -          ft = file_type::fifo_file;<br class="gmail_msg">
> +          file_type = eFileTypePipe;<br class="gmail_msg">
>           break;<br class="gmail_msg">
>         case DT_CHR:<br class="gmail_msg">
> -          ft = file_type::character_file;<br class="gmail_msg">
> +          file_type = eFileTypeOther;<br class="gmail_msg">
>           break;<br class="gmail_msg">
>         case DT_DIR:<br class="gmail_msg">
> -          ft = file_type::directory_file;<br class="gmail_msg">
> +          file_type = eFileTypeDirectory;<br class="gmail_msg">
>           break;<br class="gmail_msg">
>         case DT_BLK:<br class="gmail_msg">
> -          ft = file_type::block_file;<br class="gmail_msg">
> +          file_type = eFileTypeOther;<br class="gmail_msg">
>           break;<br class="gmail_msg">
>         case DT_REG:<br class="gmail_msg">
> -          ft = file_type::regular_file;<br class="gmail_msg">
> +          file_type = eFileTypeRegular;<br class="gmail_msg">
>           break;<br class="gmail_msg">
>         case DT_LNK:<br class="gmail_msg">
> -          ft = file_type::symlink_file;<br class="gmail_msg">
> +          file_type = eFileTypeSymbolicLink;<br class="gmail_msg">
>           break;<br class="gmail_msg">
>         case DT_SOCK:<br class="gmail_msg">
> -          ft = file_type::socket_file;<br class="gmail_msg">
> +          file_type = eFileTypeSocket;<br class="gmail_msg">
>           break;<br class="gmail_msg">
> #if !defined(__OpenBSD__)<br class="gmail_msg">
>         case DT_WHT:<br class="gmail_msg">
> -          ft = file_type::type_unknown;<br class="gmail_msg">
> +          file_type = eFileTypeOther;<br class="gmail_msg">
>           break;<br class="gmail_msg">
> #endif<br class="gmail_msg">
>         }<br class="gmail_msg">
> @@ -933,7 +985,8 @@ FileSpec::ForEachItemInDirectory(llvm::S<br class="gmail_msg">
>         // Don't resolve the file type or path<br class="gmail_msg">
>         FileSpec child_path_spec(child_path, false);<br class="gmail_msg">
><br class="gmail_msg">
> -        EnumerateDirectoryResult result = callback(ft, child_path_spec);<br class="gmail_msg">
> +        EnumerateDirectoryResult result =<br class="gmail_msg">
> +            callback(file_type, child_path_spec);<br class="gmail_msg">
><br class="gmail_msg">
>         switch (result) {<br class="gmail_msg">
>         case eEnumerateDirectoryResultNext:<br class="gmail_msg">
> @@ -987,14 +1040,14 @@ FileSpec::EnumerateDirectory(llvm::Strin<br class="gmail_msg">
>                              void *callback_baton) {<br class="gmail_msg">
>   return ForEachItemInDirectory(<br class="gmail_msg">
>       dir_path,<br class="gmail_msg">
> -      [&find_directories, &find_files, &find_other, &callback, &callback_baton](<br class="gmail_msg">
> -          llvm::sys::fs::file_type file_type, const FileSpec &file_spec) {<br class="gmail_msg">
> +      [&find_directories, &find_files, &find_other, &callback,<br class="gmail_msg">
> +       &callback_baton](FileType file_type, const FileSpec &file_spec) {<br class="gmail_msg">
>         switch (file_type) {<br class="gmail_msg">
> -        case llvm::sys::fs::file_type::directory_file:<br class="gmail_msg">
> +        case FileType::eFileTypeDirectory:<br class="gmail_msg">
>           if (find_directories)<br class="gmail_msg">
>             return callback(callback_baton, file_type, file_spec);<br class="gmail_msg">
>           break;<br class="gmail_msg">
> -        case llvm::sys::fs::file_type::regular_file:<br class="gmail_msg">
> +        case FileType::eFileTypeRegular:<br class="gmail_msg">
>           if (find_files)<br class="gmail_msg">
>             return callback(callback_baton, file_type, file_spec);<br class="gmail_msg">
>           break;<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -17,8 +17,6 @@<br class="gmail_msg">
> #include "lldb/Utility/Error.h"<br class="gmail_msg">
> #include "lldb/Utility/Log.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> using namespace lldb;<br class="gmail_msg">
> using namespace lldb_private;<br class="gmail_msg">
><br class="gmail_msg">
> @@ -40,8 +38,8 @@ MonitoringProcessLauncher::LaunchProcess<br class="gmail_msg">
><br class="gmail_msg">
>   FileSpec exe_spec(resolved_info.GetExecutableFile());<br class="gmail_msg">
><br class="gmail_msg">
> -  llvm::sys::fs::file_status stats;<br class="gmail_msg">
> -  if (status(exe_spec.GetPath(), stats) || !is_regular_file(stats)) {<br class="gmail_msg">
> +  FileSpec::FileType file_type = exe_spec.GetFileType();<br class="gmail_msg">
> +  if (file_type != FileSpec::eFileTypeRegular) {<br class="gmail_msg">
>     ModuleSpec module_spec(exe_spec, arch_spec);<br class="gmail_msg">
>     lldb::ModuleSP exe_module_sp;<br class="gmail_msg">
>     error =<br class="gmail_msg">
> @@ -54,7 +52,7 @@ MonitoringProcessLauncher::LaunchProcess<br class="gmail_msg">
>       exe_spec = exe_module_sp->GetFileSpec();<br class="gmail_msg">
>   }<br class="gmail_msg">
><br class="gmail_msg">
> -  if (exists(stats)) {<br class="gmail_msg">
> +  if (exe_spec.Exists()) {<br class="gmail_msg">
>     exe_spec.GetPath(exe_path, sizeof(exe_path));<br class="gmail_msg">
>   } else {<br class="gmail_msg">
>     resolved_info.GetExecutableFile().GetPath(exe_path, sizeof(exe_path));<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Host/common/Symbols.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Host/common/Symbols.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Host/common/Symbols.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -229,7 +229,7 @@ FileSpec Symbols::LocateExecutableSymbol<br class="gmail_msg">
>     for (size_t idx = 0; idx < num_directories; ++idx) {<br class="gmail_msg">
>       FileSpec dirspec = debug_file_search_paths.GetFileSpecAtIndex(idx);<br class="gmail_msg">
>       dirspec.ResolvePath();<br class="gmail_msg">
> -      if (!llvm::sys::fs::is_directory(dirspec.GetPath()))<br class="gmail_msg">
> +      if (!dirspec.Exists() || !dirspec.IsDirectory())<br class="gmail_msg">
>         continue;<br class="gmail_msg">
><br class="gmail_msg">
>       std::vector<std::string> files;<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Host/macosx/Host.mm<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Host/macosx/Host.mm (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Host/macosx/Host.mm Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -75,8 +75,6 @@<br class="gmail_msg">
> #include "lldb/Utility/NameMatches.h"<br class="gmail_msg">
> #include "lldb/Utility/StreamString.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> #include "cfcpp/CFCBundle.h"<br class="gmail_msg">
> #include "cfcpp/CFCMutableArray.h"<br class="gmail_msg">
> #include "cfcpp/CFCMutableDictionary.h"<br class="gmail_msg">
> @@ -103,7 +101,7 @@ using namespace lldb_private;<br class="gmail_msg">
> bool Host::GetBundleDirectory(const FileSpec &file,<br class="gmail_msg">
>                               FileSpec &bundle_directory) {<br class="gmail_msg">
> #if defined(__APPLE__)<br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(file.GetPath())) {<br class="gmail_msg">
> +  if (file.GetFileType() == FileSpec::eFileTypeDirectory) {<br class="gmail_msg">
>     char path[PATH_MAX];<br class="gmail_msg">
>     if (file.GetPath(path, sizeof(path))) {<br class="gmail_msg">
>       CFCBundle bundle(path);<br class="gmail_msg">
> @@ -120,7 +118,7 @@ bool Host::GetBundleDirectory(const File<br class="gmail_msg">
><br class="gmail_msg">
> bool Host::ResolveExecutableInBundle(FileSpec &file) {<br class="gmail_msg">
> #if defined(__APPLE__)<br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(file.GetPath())) {<br class="gmail_msg">
> +  if (file.GetFileType() == FileSpec::eFileTypeDirectory) {<br class="gmail_msg">
>     char path[PATH_MAX];<br class="gmail_msg">
>     if (file.GetPath(path, sizeof(path))) {<br class="gmail_msg">
>       CFCBundle bundle(path);<br class="gmail_msg">
> @@ -1186,8 +1184,8 @@ Error Host::LaunchProcess(ProcessLaunchI<br class="gmail_msg">
>   ModuleSpec exe_module_spec(launch_info.GetExecutableFile(),<br class="gmail_msg">
>                              launch_info.GetArchitecture());<br class="gmail_msg">
><br class="gmail_msg">
> -  if (!llvm::sys::fs::is_regular_file(<br class="gmail_msg">
> -          exe_module_spec.GetFileSpec().GetPath())) {<br class="gmail_msg">
> +  FileSpec::FileType file_type = exe_module_spec.GetFileSpec().GetFileType();<br class="gmail_msg">
> +  if (file_type != FileSpec::eFileTypeRegular) {<br class="gmail_msg">
>     lldb::ModuleSP exe_module_sp;<br class="gmail_msg">
>     error = host_platform_sp->ResolveExecutable(exe_module_spec, exe_module_sp,<br class="gmail_msg">
>                                                 NULL);<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -18,7 +18,6 @@<br class="gmail_msg">
> #include "lldb/Utility/SafeMachO.h"<br class="gmail_msg">
><br class="gmail_msg">
> #include "llvm/ADT/SmallString.h"<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> #include "llvm/Support/raw_ostream.h"<br class="gmail_msg">
><br class="gmail_msg">
> // C++ Includes<br class="gmail_msg">
> @@ -153,7 +152,7 @@ bool HostInfoMacOSX::ComputeSupportExeDi<br class="gmail_msg">
>     // the lldb driver.<br class="gmail_msg">
>     raw_path.append("/../bin");<br class="gmail_msg">
>     FileSpec support_dir_spec(raw_path, true);<br class="gmail_msg">
> -    if (!llvm::sys::fs::is_directory(support_dir_spec.GetPath())) {<br class="gmail_msg">
> +    if (!support_dir_spec.Exists() || !support_dir_spec.IsDirectory()) {<br class="gmail_msg">
>       Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);<br class="gmail_msg">
>       if (log)<br class="gmail_msg">
>         log->Printf("HostInfoMacOSX::%s(): failed to find support directory",<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Host/macosx/Symbols.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Host/macosx/Symbols.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Host/macosx/Symbols.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -38,8 +38,6 @@<br class="gmail_msg">
> #include "lldb/Utility/UUID.h"<br class="gmail_msg">
> #include "mach/machine.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> using namespace lldb;<br class="gmail_msg">
> using namespace lldb_private;<br class="gmail_msg">
> using namespace llvm::MachO;<br class="gmail_msg">
> @@ -103,7 +101,7 @@ int LocateMacOSXFilesUsingDebugSymbols(c<br class="gmail_msg">
>             }<br class="gmail_msg">
>             FileSpec dsym_filespec(path, path[0] == '~');<br class="gmail_msg">
><br class="gmail_msg">
> -            if (llvm::sys::fs::is_directory(dsym_filespec.GetPath())) {<br class="gmail_msg">
> +            if (dsym_filespec.GetFileType() == FileSpec::eFileTypeDirectory) {<br class="gmail_msg">
>               dsym_filespec =<br class="gmail_msg">
>                   Symbols::FindSymbolFileInBundle(dsym_filespec, uuid, arch);<br class="gmail_msg">
>               ++items_found;<br class="gmail_msg">
> @@ -166,10 +164,8 @@ int LocateMacOSXFilesUsingDebugSymbols(c<br class="gmail_msg">
>                 FileSpec file_spec(path, true);<br class="gmail_msg">
>                 ModuleSpecList module_specs;<br class="gmail_msg">
>                 ModuleSpec matched_module_spec;<br class="gmail_msg">
> -                using namespace llvm::sys::fs;<br class="gmail_msg">
> -                switch (get_file_type(file_spec.GetPath())) {<br class="gmail_msg">
> -<br class="gmail_msg">
> -                case file_type::directory_file: // Bundle directory?<br class="gmail_msg">
> +                switch (file_spec.GetFileType()) {<br class="gmail_msg">
> +                case FileSpec::eFileTypeDirectory: // Bundle directory?<br class="gmail_msg">
>                 {<br class="gmail_msg">
>                   CFCBundle bundle(path);<br class="gmail_msg">
>                   CFCReleaser<CFURLRef> bundle_exe_url(<br class="gmail_msg">
> @@ -197,17 +193,15 @@ int LocateMacOSXFilesUsingDebugSymbols(c<br class="gmail_msg">
>                   }<br class="gmail_msg">
>                 } break;<br class="gmail_msg">
><br class="gmail_msg">
> -                case file_type::fifo_file:      // Forget pipes<br class="gmail_msg">
> -                case file_type::socket_file:    // We can't process socket files<br class="gmail_msg">
> -                case file_type::file_not_found: // File doesn't exist...<br class="gmail_msg">
> -                case file_type::status_error:<br class="gmail_msg">
> +                case FileSpec::eFileTypePipe:   // Forget pipes<br class="gmail_msg">
> +                case FileSpec::eFileTypeSocket: // We can't process socket files<br class="gmail_msg">
> +                case FileSpec::eFileTypeInvalid: // File doesn't exist...<br class="gmail_msg">
>                   break;<br class="gmail_msg">
><br class="gmail_msg">
> -                case file_type::type_unknown:<br class="gmail_msg">
> -                case file_type::regular_file:<br class="gmail_msg">
> -                case file_type::symlink_file:<br class="gmail_msg">
> -                case file_type::block_file:<br class="gmail_msg">
> -                case file_type::character_file:<br class="gmail_msg">
> +                case FileSpec::eFileTypeUnknown:<br class="gmail_msg">
> +                case FileSpec::eFileTypeRegular:<br class="gmail_msg">
> +                case FileSpec::eFileTypeSymbolicLink:<br class="gmail_msg">
> +                case FileSpec::eFileTypeOther:<br class="gmail_msg">
>                   if (ObjectFile::GetModuleSpecifications(file_spec, 0, 0,<br class="gmail_msg">
>                                                           module_specs) &&<br class="gmail_msg">
>                       module_specs.FindMatchingModuleSpec(module_spec,<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Host/posix/FileSystem.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/FileSystem.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/FileSystem.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Host/posix/FileSystem.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Host/posix/FileSystem.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -29,8 +29,6 @@<br class="gmail_msg">
> #include "lldb/Utility/Error.h"<br class="gmail_msg">
> #include "lldb/Utility/StreamString.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> using namespace lldb;<br class="gmail_msg">
> using namespace lldb_private;<br class="gmail_msg">
><br class="gmail_msg">
> @@ -63,7 +61,7 @@ Error FileSystem::MakeDirectory(const Fi<br class="gmail_msg">
>         return error;<br class="gmail_msg">
>       } break;<br class="gmail_msg">
>       case EEXIST: {<br class="gmail_msg">
> -        if (llvm::sys::fs::is_directory(file_spec.GetPath()))<br class="gmail_msg">
> +        if (file_spec.IsDirectory())<br class="gmail_msg">
>           return Error(); // It is a directory and it already exists<br class="gmail_msg">
>       } break;<br class="gmail_msg">
>       }<br class="gmail_msg">
> @@ -85,9 +83,9 @@ Error FileSystem::DeleteDirectory(const<br class="gmail_msg">
>       FileSpec::ForEachItemInDirectory(<br class="gmail_msg">
>           file_spec.GetCString(),<br class="gmail_msg">
>           [&error, &sub_directories](<br class="gmail_msg">
> -              llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +              FileSpec::FileType file_type,<br class="gmail_msg">
>               const FileSpec &spec) -> FileSpec::EnumerateDirectoryResult {<br class="gmail_msg">
> -            if (ft == llvm::sys::fs::file_type::directory_file) {<br class="gmail_msg">
> +            if (file_type == FileSpec::eFileTypeDirectory) {<br class="gmail_msg">
>               // Save all directorires and process them after iterating through<br class="gmail_msg">
>               // this directory<br class="gmail_msg">
>               sub_directories.push_back(spec);<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -20,7 +20,6 @@<br class="gmail_msg">
> #include "clang/Parse/Parser.h"<br class="gmail_msg">
> #include "clang/Sema/Lookup.h"<br class="gmail_msg">
> #include "clang/Serialization/ASTReader.h"<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> #include "llvm/Support/Path.h"<br class="gmail_msg">
> #include "llvm/Support/Threading.h"<br class="gmail_msg">
><br class="gmail_msg">
> @@ -607,7 +606,7 @@ ClangModulesDeclVendor::Create(Target &t<br class="gmail_msg">
>   {<br class="gmail_msg">
>     FileSpec clang_resource_dir = GetResourceDir();<br class="gmail_msg">
><br class="gmail_msg">
> -    if (llvm::sys::fs::is_directory(clang_resource_dir.GetPath())) {<br class="gmail_msg">
> +    if (clang_resource_dir.IsDirectory()) {<br class="gmail_msg">
>       compiler_invocation_arguments.push_back("-resource-dir");<br class="gmail_msg">
>       compiler_invocation_arguments.push_back(clang_resource_dir.GetPath());<br class="gmail_msg">
>     }<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -28,8 +28,6 @@<br class="gmail_msg">
> #include "lldb/Utility/Log.h"<br class="gmail_msg">
> #include "lldb/Utility/StreamString.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> using namespace lldb;<br class="gmail_msg">
> using namespace lldb_private;<br class="gmail_msg">
><br class="gmail_msg">
> @@ -248,9 +246,9 @@ Error PlatformAppleTVSimulator::ResolveE<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> static FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -EnumerateDirectoryCallback(void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +EnumerateDirectoryCallback(void *baton, FileSpec::FileType file_type,<br class="gmail_msg">
>                            const FileSpec &file_spec) {<br class="gmail_msg">
> -  if (ft == llvm::sys::fs::file_type::directory_file) {<br class="gmail_msg">
> +  if (file_type == FileSpec::eFileTypeDirectory) {<br class="gmail_msg">
>     const char *filename = file_spec.GetFilename().GetCString();<br class="gmail_msg">
>     if (filename &&<br class="gmail_msg">
>         strncmp(filename, "AppleTVSimulator", strlen("AppleTVSimulator")) ==<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -248,9 +248,9 @@ Error PlatformAppleWatchSimulator::Resol<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> static FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -EnumerateDirectoryCallback(void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +EnumerateDirectoryCallback(void *baton, FileSpec::FileType file_type,<br class="gmail_msg">
>                            const FileSpec &file_spec) {<br class="gmail_msg">
> -  if (ft == llvm::sys::fs::file_type::directory_file) {<br class="gmail_msg">
> +  if (file_type == FileSpec::eFileTypeDirectory) {<br class="gmail_msg">
>     const char *filename = file_spec.GetFilename().GetCString();<br class="gmail_msg">
>     if (filename &&<br class="gmail_msg">
>         strncmp(filename, "AppleWatchSimulator",<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -41,7 +41,6 @@<br class="gmail_msg">
> #include "lldb/Utility/Error.h"<br class="gmail_msg">
> #include "lldb/Utility/Log.h"<br class="gmail_msg">
> #include "llvm/ADT/STLExtras.h"<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> #include "llvm/Support/Threading.h"<br class="gmail_msg">
><br class="gmail_msg">
> #if defined(__APPLE__)<br class="gmail_msg">
> @@ -202,15 +201,8 @@ Error PlatformDarwin::ResolveSymbolFile(<br class="gmail_msg">
>                                         FileSpec &sym_file) {<br class="gmail_msg">
>   Error error;<br class="gmail_msg">
>   sym_file = sym_spec.GetSymbolFileSpec();<br class="gmail_msg">
> -<br class="gmail_msg">
> -  llvm::sys::fs::file_status st;<br class="gmail_msg">
> -  if (status(sym_file.GetPath(), st)) {<br class="gmail_msg">
> -    error.SetErrorString("Could not stat file!");<br class="gmail_msg">
> -    return error;<br class="gmail_msg">
> -  }<br class="gmail_msg">
> -<br class="gmail_msg">
> -  if (exists(st)) {<br class="gmail_msg">
> -    if (is_directory(st)) {<br class="gmail_msg">
> +  if (sym_file.Exists()) {<br class="gmail_msg">
> +    if (sym_file.GetFileType() == FileSpec::eFileTypeDirectory) {<br class="gmail_msg">
>       sym_file = Symbols::FindSymbolFileInBundle(<br class="gmail_msg">
>           sym_file, sym_spec.GetUUIDPtr(), sym_spec.GetArchitecturePtr());<br class="gmail_msg">
>     }<br class="gmail_msg">
> @@ -1202,7 +1194,7 @@ const char *PlatformDarwin::GetDeveloper<br class="gmail_msg">
>           developer_dir_path[i] = '\0';<br class="gmail_msg">
><br class="gmail_msg">
>           FileSpec devel_dir(developer_dir_path, false);<br class="gmail_msg">
> -          if (llvm::sys::fs::is_directory(devel_dir.GetPath())) {<br class="gmail_msg">
> +          if (devel_dir.Exists() && devel_dir.IsDirectory()) {<br class="gmail_msg">
>             developer_dir_path_valid = true;<br class="gmail_msg">
>           }<br class="gmail_msg">
>         }<br class="gmail_msg">
> @@ -1447,8 +1439,9 @@ bool PlatformDarwin::SDKSupportsModules(<br class="gmail_msg">
>   return false;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> -FileSpec::EnumerateDirectoryResult PlatformDarwin::DirectoryEnumerator(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type file_type, const FileSpec &spec) {<br class="gmail_msg">
> +FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> +PlatformDarwin::DirectoryEnumerator(void *baton, FileSpec::FileType file_type,<br class="gmail_msg">
> +                                    const FileSpec &spec) {<br class="gmail_msg">
>   SDKEnumeratorInfo *enumerator_info = static_cast<SDKEnumeratorInfo *>(baton);<br class="gmail_msg">
><br class="gmail_msg">
>   if (SDKSupportsModules(enumerator_info->sdk_type, spec)) {<br class="gmail_msg">
> @@ -1463,9 +1456,8 @@ FileSpec PlatformDarwin::FindSDKInXcodeF<br class="gmail_msg">
>                                                   const FileSpec &sdks_spec) {<br class="gmail_msg">
>   // Look inside Xcode for the required installed iOS SDK version<br class="gmail_msg">
><br class="gmail_msg">
> -  if (!llvm::sys::fs::is_directory(sdks_spec.GetPath())) {<br class="gmail_msg">
> +  if (!sdks_spec.IsDirectory())<br class="gmail_msg">
>     return FileSpec();<br class="gmail_msg">
> -  }<br class="gmail_msg">
><br class="gmail_msg">
>   const bool find_directories = true;<br class="gmail_msg">
>   const bool find_files = false;<br class="gmail_msg">
> @@ -1479,7 +1471,7 @@ FileSpec PlatformDarwin::FindSDKInXcodeF<br class="gmail_msg">
>                                find_files, find_other, DirectoryEnumerator,<br class="gmail_msg">
>                                &enumerator_info);<br class="gmail_msg">
><br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(enumerator_info.found_path.GetPath()))<br class="gmail_msg">
> +  if (enumerator_info.found_path.IsDirectory())<br class="gmail_msg">
>     return enumerator_info.found_path;<br class="gmail_msg">
>   else<br class="gmail_msg">
>     return FileSpec();<br class="gmail_msg">
> @@ -1638,7 +1630,7 @@ void PlatformDarwin::AddClangModuleCompi<br class="gmail_msg">
>     sysroot_spec = GetSDKDirectoryForModules(sdk_type);<br class="gmail_msg">
>   }<br class="gmail_msg">
><br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(sysroot_spec.GetPath())) {<br class="gmail_msg">
> +  if (sysroot_spec.IsDirectory()) {<br class="gmail_msg">
>     options.push_back("-isysroot");<br class="gmail_msg">
>     options.push_back(sysroot_spec.GetPath());<br class="gmail_msg">
>   }<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -18,7 +18,6 @@<br class="gmail_msg">
> #include "Plugins/Platform/POSIX/PlatformPOSIX.h"<br class="gmail_msg">
> #include "lldb/Host/FileSpec.h"<br class="gmail_msg">
> #include "llvm/ADT/StringRef.h"<br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
><br class="gmail_msg">
> #include <string><br class="gmail_msg">
> #include <tuple><br class="gmail_msg">
> @@ -113,7 +112,7 @@ protected:<br class="gmail_msg">
>   };<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -  DirectoryEnumerator(void *baton, llvm::sys::fs::file_type file_type,<br class="gmail_msg">
> +  DirectoryEnumerator(void *baton, lldb_private::FileSpec::FileType file_type,<br class="gmail_msg">
>                       const lldb_private::FileSpec &spec);<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -36,8 +36,6 @@<br class="gmail_msg">
> #include "lldb/Utility/Log.h"<br class="gmail_msg">
> #include "lldb/Utility/StreamString.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> #include <CoreFoundation/CoreFoundation.h><br class="gmail_msg">
><br class="gmail_msg">
> #include "Host/macosx/cfcpp/CFCBundle.h"<br class="gmail_msg">
> @@ -383,7 +381,7 @@ void PlatformDarwinKernel::CollectKextAn<br class="gmail_msg">
><br class="gmail_msg">
>   // Add simple directory /Applications/Xcode.app/Contents/Developer/../Symbols<br class="gmail_msg">
>   FileSpec possible_dir(developer_dir + "/../Symbols", true);<br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(possible_dir.GetPath()))<br class="gmail_msg">
> +  if (possible_dir.Exists() && possible_dir.IsDirectory())<br class="gmail_msg">
>     m_search_directories.push_back(possible_dir);<br class="gmail_msg">
><br class="gmail_msg">
>   // Add simple directory of the current working directory<br class="gmail_msg">
> @@ -398,7 +396,7 @@ void PlatformDarwinKernel::GetUserSpecif<br class="gmail_msg">
>   for (uint32_t i = 0; i < user_dirs_count; i++) {<br class="gmail_msg">
>     FileSpec dir = user_dirs.GetFileSpecAtIndex(i);<br class="gmail_msg">
>     dir.ResolvePath();<br class="gmail_msg">
> -    if (llvm::sys::fs::is_directory(dir.GetPath())) {<br class="gmail_msg">
> +    if (dir.Exists() && dir.IsDirectory()) {<br class="gmail_msg">
>       m_search_directories.push_back(dir);<br class="gmail_msg">
>     }<br class="gmail_msg">
>   }<br class="gmail_msg">
> @@ -414,7 +412,7 @@ void PlatformDarwinKernel::AddRootSubdir<br class="gmail_msg">
>       nullptr};<br class="gmail_msg">
>   for (int i = 0; subdirs[i] != nullptr; i++) {<br class="gmail_msg">
>     FileSpec testdir(dir + subdirs[i], true);<br class="gmail_msg">
> -    if (llvm::sys::fs::is_directory(testdir.GetPath()))<br class="gmail_msg">
> +    if (testdir.Exists() && testdir.IsDirectory())<br class="gmail_msg">
>       thisp->m_search_directories.push_back(testdir);<br class="gmail_msg">
>   }<br class="gmail_msg">
><br class="gmail_msg">
> @@ -437,12 +435,12 @@ void PlatformDarwinKernel::AddSDKSubdirs<br class="gmail_msg">
> // Helper function to find *.sdk and *.kdk directories in a given directory.<br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> PlatformDarwinKernel::FindKDKandSDKDirectoriesInDirectory(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec) {<br class="gmail_msg">
> +    void *baton, FileSpec::FileType file_type, const FileSpec &file_spec) {<br class="gmail_msg">
>   static ConstString g_sdk_suffix = ConstString("sdk");<br class="gmail_msg">
>   static ConstString g_kdk_suffix = ConstString("kdk");<br class="gmail_msg">
><br class="gmail_msg">
>   PlatformDarwinKernel *thisp = (PlatformDarwinKernel *)baton;<br class="gmail_msg">
> -  if (ft == llvm::sys::fs::file_type::directory_file &&<br class="gmail_msg">
> +  if (file_type == FileSpec::eFileTypeDirectory &&<br class="gmail_msg">
>       (file_spec.GetFileNameExtension() == g_sdk_suffix ||<br class="gmail_msg">
>        file_spec.GetFileNameExtension() == g_kdk_suffix)) {<br class="gmail_msg">
>     AddRootSubdirsToSearchPaths(thisp, file_spec.GetPath());<br class="gmail_msg">
> @@ -488,19 +486,20 @@ void PlatformDarwinKernel::SearchForKext<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> PlatformDarwinKernel::GetKernelsAndKextsInDirectoryWithRecursion(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec) {<br class="gmail_msg">
> -  return GetKernelsAndKextsInDirectoryHelper(baton, ft, file_spec, true);<br class="gmail_msg">
> +    void *baton, FileSpec::FileType file_type, const FileSpec &file_spec) {<br class="gmail_msg">
> +  return GetKernelsAndKextsInDirectoryHelper(baton, file_type, file_spec, true);<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> PlatformDarwinKernel::GetKernelsAndKextsInDirectoryNoRecursion(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec) {<br class="gmail_msg">
> -  return GetKernelsAndKextsInDirectoryHelper(baton, ft, file_spec, false);<br class="gmail_msg">
> +    void *baton, FileSpec::FileType file_type, const FileSpec &file_spec) {<br class="gmail_msg">
> +  return GetKernelsAndKextsInDirectoryHelper(baton, file_type, file_spec,<br class="gmail_msg">
> +                                             false);<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> PlatformDarwinKernel::GetKernelsAndKextsInDirectoryHelper(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec,<br class="gmail_msg">
> +    void *baton, FileSpec::FileType file_type, const FileSpec &file_spec,<br class="gmail_msg">
>     bool recurse) {<br class="gmail_msg">
>   static ConstString g_kext_suffix = ConstString("kext");<br class="gmail_msg">
>   static ConstString g_dsym_suffix = ConstString("dSYM");<br class="gmail_msg">
> @@ -513,8 +512,8 @@ PlatformDarwinKernel::GetKernelsAndKexts<br class="gmail_msg">
>                 file_spec.GetPath().c_str());<br class="gmail_msg">
><br class="gmail_msg">
>   PlatformDarwinKernel *thisp = (PlatformDarwinKernel *)baton;<br class="gmail_msg">
> -  if (ft == llvm::sys::fs::file_type::regular_file ||<br class="gmail_msg">
> -      ft == llvm::sys::fs::file_type::symlink_file) {<br class="gmail_msg">
> +  if (file_type == FileSpec::eFileTypeRegular ||<br class="gmail_msg">
> +      file_type == FileSpec::eFileTypeSymbolicLink) {<br class="gmail_msg">
>     ConstString filename = file_spec.GetFilename();<br class="gmail_msg">
>     if ((strncmp(filename.GetCString(), "kernel", 6) == 0 ||<br class="gmail_msg">
>          strncmp(filename.GetCString(), "mach", 4) == 0) &&<br class="gmail_msg">
> @@ -525,17 +524,17 @@ PlatformDarwinKernel::GetKernelsAndKexts<br class="gmail_msg">
>         thisp->m_kernel_binaries_without_dsyms.push_back(file_spec);<br class="gmail_msg">
>       return FileSpec::eEnumerateDirectoryResultNext;<br class="gmail_msg">
>     }<br class="gmail_msg">
> -  } else if (ft == llvm::sys::fs::file_type::directory_file &&<br class="gmail_msg">
> +  } else if (file_type == FileSpec::eFileTypeDirectory &&<br class="gmail_msg">
>              file_spec_extension == g_kext_suffix) {<br class="gmail_msg">
>     AddKextToMap(thisp, file_spec);<br class="gmail_msg">
>     // Look to see if there is a PlugIns subdir with more kexts<br class="gmail_msg">
>     FileSpec contents_plugins(file_spec.GetPath() + "/Contents/PlugIns", false);<br class="gmail_msg">
>     std::string search_here_too;<br class="gmail_msg">
> -    if (llvm::sys::fs::is_directory(contents_plugins.GetPath())) {<br class="gmail_msg">
> +    if (contents_plugins.Exists() && contents_plugins.IsDirectory()) {<br class="gmail_msg">
>       search_here_too = contents_plugins.GetPath();<br class="gmail_msg">
>     } else {<br class="gmail_msg">
>       FileSpec plugins(file_spec.GetPath() + "/PlugIns", false);<br class="gmail_msg">
> -      if (llvm::sys::fs::is_directory(plugins.GetPath())) {<br class="gmail_msg">
> +      if (plugins.Exists() && plugins.IsDirectory()) {<br class="gmail_msg">
>         search_here_too = plugins.GetPath();<br class="gmail_msg">
>       }<br class="gmail_msg">
>     }<br class="gmail_msg">
> @@ -592,7 +591,7 @@ bool PlatformDarwinKernel::KextHasdSYMSi<br class="gmail_msg">
>   std::string filename = dsym_fspec.GetFilename().AsCString();<br class="gmail_msg">
>   filename += ".dSYM";<br class="gmail_msg">
>   dsym_fspec.GetFilename() = ConstString(filename);<br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(dsym_fspec.GetPath())) {<br class="gmail_msg">
> +  if (dsym_fspec.Exists() && dsym_fspec.IsDirectory()) {<br class="gmail_msg">
>     return true;<br class="gmail_msg">
>   }<br class="gmail_msg">
>   // Should probably get the CFBundleExecutable here or call<br class="gmail_msg">
> @@ -606,7 +605,7 @@ bool PlatformDarwinKernel::KextHasdSYMSi<br class="gmail_msg">
>   deep_bundle_str += executable_name.AsCString();<br class="gmail_msg">
>   deep_bundle_str += ".dSYM";<br class="gmail_msg">
>   dsym_fspec.SetFile(deep_bundle_str, true);<br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(dsym_fspec.GetPath())) {<br class="gmail_msg">
> +  if (dsym_fspec.Exists() && dsym_fspec.IsDirectory()) {<br class="gmail_msg">
>     return true;<br class="gmail_msg">
>   }<br class="gmail_msg">
><br class="gmail_msg">
> @@ -616,7 +615,7 @@ bool PlatformDarwinKernel::KextHasdSYMSi<br class="gmail_msg">
>   shallow_bundle_str += executable_name.AsCString();<br class="gmail_msg">
>   shallow_bundle_str += ".dSYM";<br class="gmail_msg">
>   dsym_fspec.SetFile(shallow_bundle_str, true);<br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(dsym_fspec.GetPath())) {<br class="gmail_msg">
> +  if (dsym_fspec.Exists() && dsym_fspec.IsDirectory()) {<br class="gmail_msg">
>     return true;<br class="gmail_msg">
>   }<br class="gmail_msg">
>   return false;<br class="gmail_msg">
> @@ -630,7 +629,7 @@ bool PlatformDarwinKernel::KernelHasdSYM<br class="gmail_msg">
>   std::string filename = kernel_binary.GetFilename().AsCString();<br class="gmail_msg">
>   filename += ".dSYM";<br class="gmail_msg">
>   kernel_dsym.GetFilename() = ConstString(filename);<br class="gmail_msg">
> -  if (llvm::sys::fs::is_directory(kernel_dsym.GetPath())) {<br class="gmail_msg">
> +  if (kernel_dsym.Exists() && kernel_dsym.IsDirectory()) {<br class="gmail_msg">
>     return true;<br class="gmail_msg">
>   }<br class="gmail_msg">
>   return false;<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -20,8 +20,6 @@<br class="gmail_msg">
> // Other libraries and framework includes<br class="gmail_msg">
> #include "lldb/Host/FileSpec.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> // Project includes<br class="gmail_msg">
> #include "PlatformDarwin.h"<br class="gmail_msg">
><br class="gmail_msg">
> @@ -107,25 +105,26 @@ protected:<br class="gmail_msg">
>   void AddSDKSubdirsToSearchPaths(const std::string &dir);<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -  FindKDKandSDKDirectoriesInDirectory(void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> -                                      const lldb_private::FileSpec &file_spec);<br class="gmail_msg">
> +  FindKDKandSDKDirectoriesInDirectory(<br class="gmail_msg">
> +      void *baton, lldb_private::FileSpec::FileType file_type,<br class="gmail_msg">
> +      const lldb_private::FileSpec &file_spec);<br class="gmail_msg">
><br class="gmail_msg">
>   void SearchForKextsAndKernelsRecursively();<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
>   GetKernelsAndKextsInDirectoryWithRecursion(<br class="gmail_msg">
> -      void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +      void *baton, lldb_private::FileSpec::FileType file_type,<br class="gmail_msg">
>       const lldb_private::FileSpec &file_spec);<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
>   GetKernelsAndKextsInDirectoryNoRecursion(<br class="gmail_msg">
> -      void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +      void *baton, lldb_private::FileSpec::FileType file_type,<br class="gmail_msg">
>       const lldb_private::FileSpec &file_spec);<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> -  GetKernelsAndKextsInDirectoryHelper(void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> -                                      const lldb_private::FileSpec &file_spec,<br class="gmail_msg">
> -                                      bool recurse);<br class="gmail_msg">
> +  GetKernelsAndKextsInDirectoryHelper(<br class="gmail_msg">
> +      void *baton, lldb_private::FileSpec::FileType file_type,<br class="gmail_msg">
> +      const lldb_private::FileSpec &file_spec, bool recurse);<br class="gmail_msg">
><br class="gmail_msg">
>   static void AddKextToMap(PlatformDarwinKernel *thisp,<br class="gmail_msg">
>                            const lldb_private::FileSpec &file_spec);<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -250,7 +250,7 @@ Error PlatformRemoteAppleTV::ResolveExec<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> PlatformRemoteAppleTV::GetContainedFilesIntoVectorOfStringsCallback(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec) {<br class="gmail_msg">
> +    void *baton, FileSpec::FileType file_type, const FileSpec &file_spec) {<br class="gmail_msg">
>   ((PlatformRemoteAppleTV::SDKDirectoryInfoCollection *)baton)<br class="gmail_msg">
>       ->push_back(PlatformRemoteAppleTV::SDKDirectoryInfo(file_spec));<br class="gmail_msg">
>   return FileSpec::eEnumerateDirectoryResultNext;<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -18,8 +18,6 @@<br class="gmail_msg">
> // Project includes<br class="gmail_msg">
> #include "lldb/Host/FileSpec.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> #include "PlatformDarwin.h"<br class="gmail_msg">
><br class="gmail_msg">
> class PlatformRemoteAppleTV : public PlatformDarwin {<br class="gmail_msg">
> @@ -118,7 +116,7 @@ protected:<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
>   GetContainedFilesIntoVectorOfStringsCallback(<br class="gmail_msg">
> -      void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +      void *baton, lldb_private::FileSpec::FileType file_type,<br class="gmail_msg">
>       const lldb_private::FileSpec &file_spec);<br class="gmail_msg">
><br class="gmail_msg">
>   uint32_t FindFileInAllSDKs(const char *platform_file_path,<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -260,7 +260,7 @@ Error PlatformRemoteAppleWatch::ResolveE<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> PlatformRemoteAppleWatch::GetContainedFilesIntoVectorOfStringsCallback(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec) {<br class="gmail_msg">
> +    void *baton, FileSpec::FileType file_type, const FileSpec &file_spec) {<br class="gmail_msg">
>   ((PlatformRemoteAppleWatch::SDKDirectoryInfoCollection *)baton)<br class="gmail_msg">
>       ->push_back(PlatformRemoteAppleWatch::SDKDirectoryInfo(file_spec));<br class="gmail_msg">
>   return FileSpec::eEnumerateDirectoryResultNext;<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -21,8 +21,6 @@<br class="gmail_msg">
><br class="gmail_msg">
> #include "PlatformDarwin.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> class PlatformRemoteAppleWatch : public PlatformDarwin {<br class="gmail_msg">
> public:<br class="gmail_msg">
>   PlatformRemoteAppleWatch();<br class="gmail_msg">
> @@ -120,7 +118,7 @@ protected:<br class="gmail_msg">
><br class="gmail_msg">
>   static lldb_private::FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
>   GetContainedFilesIntoVectorOfStringsCallback(<br class="gmail_msg">
> -      void *baton, llvm::sys::fs::file_type ft,<br class="gmail_msg">
> +      void *baton, lldb_private::FileSpec::FileType file_type,<br class="gmail_msg">
>       const lldb_private::FileSpec &file_spec);<br class="gmail_msg">
><br class="gmail_msg">
>   uint32_t FindFileInAllSDKs(const char *platform_file_path,<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -255,7 +255,7 @@ Error PlatformRemoteiOS::ResolveExecutab<br class="gmail_msg">
><br class="gmail_msg">
> FileSpec::EnumerateDirectoryResult<br class="gmail_msg">
> PlatformRemoteiOS::GetContainedFilesIntoVectorOfStringsCallback(<br class="gmail_msg">
> -    void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec) {<br class="gmail_msg">
> +    void *baton, FileSpec::FileType file_type, const FileSpec &file_spec) {<br class="gmail_msg">
>   ((PlatformRemoteiOS::SDKDirectoryInfoCollection *)baton)<br class="gmail_msg">
>       ->push_back(PlatformRemoteiOS::SDKDirectoryInfo(file_spec));<br class="gmail_msg">
>   return FileSpec::eEnumerateDirectoryResultNext;<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h?rev=297139&r1=297138&r2=297139&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h?rev=297139&r1=297138&r2=297139&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h Tue Mar  7 07:19:15 2017<br class="gmail_msg">
> @@ -19,8 +19,6 @@<br class="gmail_msg">
> #include "PlatformDarwin.h"<br class="gmail_msg">
> #include "lldb/Host/FileSpec.h"<br class="gmail_msg">
><br class="gmail_msg">
> -#include "llvm/Support/FileSystem.h"<br class="gmail_msg">
> -<br class="gmail_msg">
> class PlatformRemoteiOS : public PlatformDarwin {<br class="gmail_msg">
> public:<br class="gmail_msg">
>  </blockquote></div>
</div></blockquote></div><br class=""></div></body></html>