diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-29 20:54:02 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-29 20:54:02 +0000 |
commit | 96b44c77f8fbc0c704c036b82ea173289b93aa72 (patch) | |
tree | 125d898c77d1f4f835c7982b4110aa5d7749462e /lldb/source/Host/common | |
parent | d01ae675af8eed545e910e6967cd49593a651a23 (diff) | |
download | bcm5719-llvm-96b44c77f8fbc0c704c036b82ea173289b93aa72.tar.gz bcm5719-llvm-96b44c77f8fbc0c704c036b82ea173289b93aa72.zip |
[Reproducers] Pass FileCollector around as a shared_ptr (NFC)
Instead of passing the FileCollector around as a reference or raw
pointer, use a shared_ptr. This change's motivation is twofold. First it
adds compatibility for the newly added `FileCollectorFileSystem`.
Secondly, it addresses a lifetime issue we only see when LLDB is used
from Xcode, where a reference to the FileCollector outlives the
reproducer instance.
llvm-svn: 367258
Diffstat (limited to 'lldb/source/Host/common')
-rw-r--r-- | lldb/source/Host/common/FileSystem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Host/common/FileSystem.cpp b/lldb/source/Host/common/FileSystem.cpp index 3b4db43966e..0d9417120fd 100644 --- a/lldb/source/Host/common/FileSystem.cpp +++ b/lldb/source/Host/common/FileSystem.cpp @@ -49,7 +49,7 @@ void FileSystem::Initialize() { InstanceImpl().emplace(); } -void FileSystem::Initialize(FileCollector &collector) { +void FileSystem::Initialize(std::shared_ptr<FileCollector> collector) { lldbassert(!InstanceImpl() && "Already initialized."); InstanceImpl().emplace(collector); } |