mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 15:14:31 +00:00
Use Host::File in lldb_private::StreamFile and other places to cleanup host
layer a bit more. llvm-svn: 125149
This commit is contained in:
1 parent
7eaacc517b
commit
51b1e2d271
17 files changed
+554
-302
No files matched your search
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "lldb/API/SBStream.h"
|
||||
|
||||
#include "lldb/Core/Error.h"
|
||||
#include "lldb/Core/Stream.h"
|
||||
#include "lldb/Core/StreamFile.h"
|
||||
#include "lldb/Core/StreamString.h"
|
||||
@@ -75,7 +76,13 @@ SBStream::RedirectToFile (const char *path, bool append)
|
||||
if (!m_is_file)
|
||||
local_data.swap(static_cast<StreamString *>(m_opaque_ap.get())->GetString());
|
||||
}
|
||||
m_opaque_ap.reset (new StreamFile (path, append ? "a" : "w"));
|
||||
StreamFile *stream_file = new StreamFile;
|
||||
uint32_t open_options = File::eOpenOptionWrite | File::eOpenOptionCanCreate;
|
||||
if (append)
|
||||
open_options |= File::eOpenOptionAppend;
|
||||
stream_file->GetFile().Open (path, open_options, File::ePermissionsDefault);
|
||||
|
||||
m_opaque_ap.reset (stream_file);
|
||||
|
||||
if (m_opaque_ap.get())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user