Convert FileSystem::Open() to return Expected<FileUP>
authorLawrence D'Anna <lawrence_danna@apple.com>
Thu, 26 Sep 2019 17:54:59 +0000 (17:54 +0000)
committerLawrence D'Anna <lawrence_danna@apple.com>
Thu, 26 Sep 2019 17:54:59 +0000 (17:54 +0000)
commit2fce1137c7c227f40edbb657c484797addba38ca
tree1aca86d16d377f546f54a9b2c4782e51f113008c
parent875d20bcde2e2b1990f3a4bdfc800959e8a72ed6
Convert FileSystem::Open() to return Expected<FileUP>

Summary:
This patch converts FileSystem::Open from this prototype:

Status
Open(File &File, const FileSpec &file_spec, ...);

to this one:

llvm::Expected<std::unique_ptr<File>>
Open(const FileSpec &file_spec, ...);

This is beneficial on its own, as llvm::Expected is a more modern
and recommended error type than Status.  It is also a necessary step
towards https://reviews.llvm.org/D67891, and further developments
for lldb_private::File.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D67996

llvm-svn: 373003
26 files changed:
lldb/include/lldb/Core/StreamFile.h
lldb/include/lldb/Host/FileCache.h
lldb/include/lldb/Host/FileSystem.h
lldb/include/lldb/lldb-forward.h
lldb/scripts/Python/python-typemaps.swig
lldb/source/API/SBStream.cpp
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Core/StreamFile.cpp
lldb/source/Expression/REPL.cpp
lldb/source/Host/common/FileCache.cpp
lldb/source/Host/common/FileSystem.cpp
lldb/source/Host/windows/Host.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Target/ModuleCache.cpp
lldb/source/Target/Platform.cpp
lldb/unittests/Host/FileSystemTest.cpp
lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp