[Process] Clean up some logic around LanguageRuntimes

llvm-svn: 361666
This commit is contained in:
Alex Langford 2019-05-24 19:39:50 +00:00
parent 56503865ed
commit 96f02a8db8
1 changed files with 10 additions and 7 deletions

View File

@ -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);
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);
if (!runtime)
return nullptr;
assert(runtime->GetLanguageType() == eLanguageTypeObjC);
return static_cast<ObjCLanguageRuntime *>(runtime);
}
bool Process::IsPossibleDynamicValue(ValueObject &in_value) {