diff options
| author | Alex Langford <apl@fb.com> | 2019-05-24 19:39:50 +0000 |
|---|---|---|
| committer | Alex Langford <apl@fb.com> | 2019-05-24 19:39:50 +0000 |
| commit | 96f02a8db843daa5c016c097d0375e6dfa65bb4d (patch) | |
| tree | 0264415819ad7c2958cf8682b3d95ad1dd4aa659 /lldb/source/Target/Process.cpp | |
| parent | 56503865ed4d034d46efd84b274c42428fb61d9f (diff) | |
| download | bcm5719-llvm-96f02a8db843daa5c016c097d0375e6dfa65bb4d.tar.gz bcm5719-llvm-96f02a8db843daa5c016c097d0375e6dfa65bb4d.zip | |
[Process] Clean up some logic around LanguageRuntimes
llvm-svn: 361666
Diffstat (limited to 'lldb/source/Target/Process.cpp')
| -rw-r--r-- | lldb/source/Target/Process.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 871eae56d4b..4162571fbd6 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1569,19 +1569,22 @@ CPPLanguageRuntime *Process::GetCPPLanguageRuntime(bool retry_if_null) { std::lock_guard<std::recursive_mutex> guard(m_language_runtimes_mutex); LanguageRuntime *runtime = GetLanguageRuntime(eLanguageTypeC_plus_plus, retry_if_null); - if (runtime != nullptr && - runtime->GetLanguageType() == eLanguageTypeC_plus_plus) - return static_cast<CPPLanguageRuntime *>(runtime); - return nullptr; + if (!runtime) + return nullptr; + + assert(runtime->GetLanguageType() == eLanguageTypeC_plus_plus); + return static_cast<CPPLanguageRuntime *>(runtime); } ObjCLanguageRuntime *Process::GetObjCLanguageRuntime(bool retry_if_null) { std::lock_guard<std::recursive_mutex> guard(m_language_runtimes_mutex); LanguageRuntime *runtime = GetLanguageRuntime(eLanguageTypeObjC, retry_if_null); - if (runtime != nullptr && runtime->GetLanguageType() == eLanguageTypeObjC) - return static_cast<ObjCLanguageRuntime *>(runtime); - return nullptr; + if (!runtime) + return nullptr; + + assert(runtime->GetLanguageType() == eLanguageTypeObjC); + return static_cast<ObjCLanguageRuntime *>(runtime); } bool Process::IsPossibleDynamicValue(ValueObject &in_value) { |

