[Lldb-commits] [PATCH] D65165: [Symbol] Fix some botched logic in Variable::GetLanguage

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 23 13:31:49 PDT 2019


xiaobai created this revision.
xiaobai added a reviewer: labath.
Herald added a reviewer: jdoerfert.

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


https://reviews.llvm.org/D65165

Files:
  source/Symbol/Variable.cpp


Index: source/Symbol/Variable.cpp
===================================================================
--- source/Symbol/Variable.cpp
+++ source/Symbol/Variable.cpp
@@ -59,12 +59,12 @@
     return lang;
 
   if (auto *func = m_owner_scope->CalculateSymbolContextFunction()) {
-    if ((lang = func->GetLanguage()) && lang != lldb::eLanguageTypeUnknown)
+    if ((lang = func->GetLanguage()))
+      return lang;
+  } else if (auto *comp_unit =
+                 m_owner_scope->CalculateSymbolContextCompileUnit()) {
+    if ((lang = comp_unit->GetLanguage()))
       return lang;
-    else if (auto *comp_unit =
-                 m_owner_scope->CalculateSymbolContextCompileUnit())
-      if ((lang = func->GetLanguage()) && lang != lldb::eLanguageTypeUnknown)
-        return lang;
   }
 
   return lldb::eLanguageTypeUnknown;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65165.211352.patch
Type: text/x-patch
Size: 827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190723/2b419ce5/attachment.bin>


More information about the lldb-commits mailing list