summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/ObjectFile.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-11-10 22:44:06 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-11-10 22:44:06 +0000
commit1cc0714c68438f6ddf78b84599f8e80642a2233a (patch)
tree8f5101311e228a88b26aec44e303bc0126208a0c /lldb/source/Symbol/ObjectFile.cpp
parent3889c36d3fcc9d1fc7b8426ab8dae05214bf9ba3 (diff)
downloadbcm5719-llvm-1cc0714c68438f6ddf78b84599f8e80642a2233a.tar.gz
bcm5719-llvm-1cc0714c68438f6ddf78b84599f8e80642a2233a.zip
Extract construction of DataBufferLLVM into FileSystem
This moves construction of data buffers into the FileSystem class. Like some of the previous refactorings we don't translate the path yet because the functionality hasn't been landed in LLVM yet. Differential revision: https://reviews.llvm.org/D54272 llvm-svn: 346598
Diffstat (limited to 'lldb/source/Symbol/ObjectFile.cpp')
-rw-r--r--lldb/source/Symbol/ObjectFile.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index bd94ec0ad8c..d56acd230c3 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -19,7 +19,6 @@
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/DataBufferHeap.h"
-#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/Timer.h"
@@ -75,8 +74,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
// container plug-ins can use these bytes to see if they can parse this
// file.
if (file_size > 0) {
- data_sp =
- DataBufferLLVM::CreateSliceFromPath(file->GetPath(), 512, file_offset);
+ data_sp = FileSystem::Instance().CreateDataBuffer(file->GetPath(),
+ 512, file_offset);
data_offset = 0;
}
}
@@ -120,8 +119,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
}
// We failed to find any cached object files in the container plug-
// ins, so lets read the first 512 bytes and try again below...
- data_sp = DataBufferLLVM::CreateSliceFromPath(archive_file.GetPath(),
- 512, file_offset);
+ data_sp = FileSystem::Instance().CreateDataBuffer(
+ archive_file.GetPath(), 512, file_offset);
}
}
}
@@ -209,7 +208,8 @@ size_t ObjectFile::GetModuleSpecifications(const FileSpec &file,
lldb::offset_t file_offset,
lldb::offset_t file_size,
ModuleSpecList &specs) {
- DataBufferSP data_sp = DataBufferLLVM::CreateSliceFromPath(file.GetPath(), 512, file_offset);
+ DataBufferSP data_sp =
+ FileSystem::Instance().CreateDataBuffer(file.GetPath(), 512, file_offset);
if (data_sp) {
if (file_size == 0) {
const lldb::offset_t actual_file_size =
@@ -682,5 +682,5 @@ void ObjectFile::RelocateSection(lldb_private::Section *section)
DataBufferSP ObjectFile::MapFileData(const FileSpec &file, uint64_t Size,
uint64_t Offset) {
- return DataBufferLLVM::CreateSliceFromPath(file.GetPath(), Size, Offset);
+ return FileSystem::Instance().CreateDataBuffer(file.GetPath(), Size, Offset);
}
OpenPOWER on IntegriCloud