From f913fd6eb0c228041b77a645d76993760d3b1421 Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Thu, 3 Oct 2019 04:31:46 +0000 Subject: factor out an abstract base class for File Summary: This patch factors out File as an abstract base class and moves most of its actual functionality into a subclass called NativeFile. In the next patch, I'm going to be adding subclasses of File that don't necessarily have any connection to actual OS files, so they will not inherit from NativeFile. This patch was split out as a prerequisite for https://reviews.llvm.org/D68188 Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68317 llvm-svn: 373564 --- lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 5843144..fedd8f6 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -1024,8 +1024,8 @@ FileUP PythonFile::GetUnderlyingFile() const { // File object knows about that. PythonString py_mode = GetAttributeValue("mode").AsType(); auto options = File::GetOptionsFromMode(py_mode.GetString()); - auto file = std::make_unique(PyObject_AsFileDescriptor(m_py_obj), - options, false); + auto file = std::unique_ptr( + new NativeFile(PyObject_AsFileDescriptor(m_py_obj), options, false)); if (!file->IsValid()) return nullptr; return file; -- cgit v1.1