Resubmit FileSystem changes.

This was originall reverted due to some test failures in
ModuleCache and TestCompDirSymlink.  These issues have all
been resolved and the code now passes all tests.

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

llvm-svn: 297300
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 37dec18..c8871c8 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -50,6 +50,8 @@
 #include "lldb/Target/Thread.h"
 #include "lldb/Target/ThreadSpec.h"
 
+#include "llvm/Support/FileSystem.h"
+
 // C Includes
 // C++ Includes
 #include <cerrno>
@@ -4136,20 +4138,21 @@
         module_sp->SetSymbolFileFileSpec(FileSpec());
       }
 
+      namespace fs = llvm::sys::fs;
       if (module_spec.GetUUID().IsValid()) {
         StreamString ss_symfile_uuid;
         module_spec.GetUUID().Dump(&ss_symfile_uuid);
         result.AppendErrorWithFormat(
             "symbol file '%s' (%s) does not match any existing module%s\n",
             symfile_path, ss_symfile_uuid.GetData(),
-            (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)
+            !fs::is_regular_file(symbol_fspec.GetPath())
                 ? "\n       please specify the full path to the symbol file"
                 : "");
       } else {
         result.AppendErrorWithFormat(
             "symbol file '%s' does not match any existing module%s\n",
             symfile_path,
-            (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)
+            !fs::is_regular_file(symbol_fspec.GetPath())
                 ? "\n       please specify the full path to the symbol file"
                 : "");
       }