diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 16:43:34 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-11-01 16:43:34 +0000 |
| commit | 0bca15a35a5b507c4115f7b466957a7a0c2b5d74 (patch) | |
| tree | fd194df73fa5c86d7f74d4b284933db1f21178a6 | |
| parent | 544a66d8bb0dd414c39ca1d77c1d42be54d3f088 (diff) | |
| download | bcm5719-llvm-0bca15a35a5b507c4115f7b466957a7a0c2b5d74.tar.gz bcm5719-llvm-0bca15a35a5b507c4115f7b466957a7a0c2b5d74.zip | |
[FileSystem] Improve assert and add Terminate in unit test.
Speculative fix for the Xcode bots where we were seeing the assertion
being triggered because we would re-initialize the FileSystem without
terminating it.
llvm-svn: 345849
| -rw-r--r-- | lldb/source/Host/common/FileSystem.cpp | 7 | ||||
| -rw-r--r-- | lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Host/common/FileSystem.cpp b/lldb/source/Host/common/FileSystem.cpp index aa181ecdd11..5f8d8fb4282 100644 --- a/lldb/source/Host/common/FileSystem.cpp +++ b/lldb/source/Host/common/FileSystem.cpp @@ -9,6 +9,7 @@ #include "lldb/Host/FileSystem.h" +#include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/TildeExpressionResolver.h" #include "llvm/Support/FileSystem.h" @@ -25,17 +26,17 @@ using namespace llvm; FileSystem &FileSystem::Instance() { return *InstanceImpl(); } void FileSystem::Initialize() { - assert(!InstanceImpl()); + lldbassert(!InstanceImpl() && "Already initialized."); InstanceImpl().emplace(); } void FileSystem::Initialize(IntrusiveRefCntPtr<vfs::FileSystem> fs) { - assert(!InstanceImpl()); + lldbassert(!InstanceImpl() && "Already initialized."); InstanceImpl().emplace(fs); } void FileSystem::Terminate() { - assert(InstanceImpl()); + lldbassert(InstanceImpl() && "Already terminated."); InstanceImpl().reset(); } diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp index 66680f10563..7bc8f64b485 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp @@ -38,4 +38,6 @@ void PythonTestSuite::TearDown() { PyGILState_Release(m_gil_state); ScriptInterpreterPython::Terminate(); + HostInfoBase::Terminate(); + FileSystem::Terminate(); } |

