summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/OptionValueFileSpec.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-03-06 23:42:14 +0000
committerZachary Turner <zturner@google.com>2017-03-06 23:42:14 +0000
commit7f6a7a37521e3610be7242ccec7ca9a15c1c307a (patch)
treee2b7f59e0254269500347dfbd067108d86ca70a0 /lldb/source/Interpreter/OptionValueFileSpec.cpp
parent15492af547112d272572994bfef2d560ce651d7b (diff)
downloadbcm5719-llvm-7f6a7a37521e3610be7242ccec7ca9a15c1c307a.tar.gz
bcm5719-llvm-7f6a7a37521e3610be7242ccec7ca9a15c1c307a.zip
Remove FileSpec::ReadFileContents.
This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private sections, and in some cases we were using ReadFileContents and then modifying the buffer. To address that I've added a flag to the DataBufferLLVM methods that allow you to map privately, which disables the mmaping path entirely. Eventually we should teach DataBufferLLVM to use mmap with writable private, but that is orthogonal to this effort. Differential Revision: https://reviews.llvm.org/D30622 llvm-svn: 297095
Diffstat (limited to 'lldb/source/Interpreter/OptionValueFileSpec.cpp')
-rw-r--r--lldb/source/Interpreter/OptionValueFileSpec.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/OptionValueFileSpec.cpp b/lldb/source/Interpreter/OptionValueFileSpec.cpp
index a6eb5375851..0df581af5d6 100644
--- a/lldb/source/Interpreter/OptionValueFileSpec.cpp
+++ b/lldb/source/Interpreter/OptionValueFileSpec.cpp
@@ -15,6 +15,7 @@
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Utility/DataBufferLLVM.h"
using namespace lldb;
using namespace lldb_private;
@@ -118,10 +119,8 @@ OptionValueFileSpec::GetFileContents(bool null_terminate) {
const auto file_mod_time = FileSystem::GetModificationTime(m_current_value);
if (m_data_sp && m_data_mod_time == file_mod_time)
return m_data_sp;
- if (null_terminate)
- m_data_sp = m_current_value.ReadFileContentsAsCString();
- else
- m_data_sp = m_current_value.ReadFileContents();
+ m_data_sp = DataBufferLLVM::CreateFromPath(m_current_value.GetPath(),
+ null_terminate);
m_data_mod_time = file_mod_time;
}
return m_data_sp;
OpenPOWER on IntegriCloud