Re-land "Extract construction of DataBufferLLVM into FileSystem"

This fixes some UB in isLocal detected by the sanitized bot.

llvm-svn: 346707
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 347870e..ae74093 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -33,7 +33,6 @@
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Utility/ArchSpec.h"
-#include "lldb/Utility/DataBufferLLVM.h"
 #include "lldb/Utility/Stream.h"
 #include "lldb/Utility/Timer.h"
 
@@ -313,7 +312,7 @@
       // file gets updated by a new build while this .a file is being used for
       // debugging
       DataBufferSP archive_data_sp =
-          DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset);
+          FileSystem::Instance().CreateDataBuffer(*file, length, file_offset);
       if (!archive_data_sp)
         return nullptr;
 
@@ -468,7 +467,7 @@
   if (!archive_sp) {
     set_archive_arch = true;
     data_sp =
-        DataBufferLLVM::CreateSliceFromPath(file.GetPath(), file_size, file_offset);
+        FileSystem::Instance().CreateDataBuffer(file, file_size, file_offset);
     if (data_sp) {
       data.SetData(data_sp, 0, data_sp->GetByteSize());
       archive_sp = Archive::ParseAndCacheArchiveForFile(