[Symbol] Fix some botched logic in Variable::GetLanguage

Summary:
I messed up the logic for this. Fixing with some improvements suggested
by Pavel.

Reviewers: labath, jdoerfert

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D65165

llvm-svn: 366950
This commit is contained in:
Alex Langford 2019-07-24 22:12:02 +00:00
parent 86e9f9dc26
commit eb6782758a
1 changed files with 5 additions and 5 deletions

View File

@ -59,12 +59,12 @@ lldb::LanguageType Variable::GetLanguage() const {
return lang;
if (auto *func = m_owner_scope->CalculateSymbolContextFunction()) {
if ((lang = func->GetLanguage()) && lang != lldb::eLanguageTypeUnknown)
if ((lang = func->GetLanguage()) != lldb::eLanguageTypeUnknown)
return lang;
} else if (auto *comp_unit =
m_owner_scope->CalculateSymbolContextCompileUnit()) {
if ((lang = comp_unit->GetLanguage()) != lldb::eLanguageTypeUnknown)
return lang;
else if (auto *comp_unit =
m_owner_scope->CalculateSymbolContextCompileUnit())
if ((lang = func->GetLanguage()) && lang != lldb::eLanguageTypeUnknown)
return lang;
}
return lldb::eLanguageTypeUnknown;