summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-11-12 21:24:50 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-11-12 21:24:50 +0000
commit87e403aa4f62d7385999041abce5fdadb8741a47 (patch)
tree50a1ddaec65b06269d32c1455915f0fd4340f41e /lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
parente565e5a9621de42e7b82ad50803fe03beafa0334 (diff)
downloadbcm5719-llvm-87e403aa4f62d7385999041abce5fdadb8741a47.tar.gz
bcm5719-llvm-87e403aa4f62d7385999041abce5fdadb8741a47.zip
Re-land "Extract construction of DataBufferLLVM into FileSystem"
This fixes some UB in isLocal detected by the sanitized bot. llvm-svn: 346707
Diffstat (limited to 'lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp')
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 347870ec231..ae7409352c5 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -33,7 +33,6 @@ typedef struct ar_hdr {
#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 @@ ObjectContainer *ObjectContainerBSDArchive::CreateInstance(
// 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 @@ size_t ObjectContainerBSDArchive::GetModuleSpecifications(
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(
OpenPOWER on IntegriCloud