diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index 7a7d9b8293684d..60afa126ce90c8 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -597,7 +597,7 @@ addr_t ClangExpressionDeclMap::GetSymbolAddress(ConstString name, lldb::VariableSP ClangExpressionDeclMap::FindGlobalVariable( Target &target, ModuleSP &module, ConstString name, - CompilerDeclContext *namespace_decl, TypeFromUser *type) { + CompilerDeclContext *namespace_decl) { VariableList vars; if (module && namespace_decl) @@ -605,19 +605,9 @@ lldb::VariableSP ClangExpressionDeclMap::FindGlobalVariable( else target.GetImages().FindGlobalVariables(name, -1, vars); - if (vars.GetSize()) { - if (type) { - for (VariableSP var_sp : vars) { - if (ClangASTContext::AreTypesSame( - *type, var_sp->GetType()->GetFullCompilerType())) - return var_sp; - } - } else { - return vars.GetVariableAtIndex(0); - } - } - - return VariableSP(); + if (vars.GetSize() == 0) + return VariableSP(); + return vars.GetVariableAtIndex(0); } ClangASTContext *ClangExpressionDeclMap::GetClangASTContext() { @@ -1443,8 +1433,7 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls( if (target) { ValueObjectSP valobj; VariableSP var; - var = - FindGlobalVariable(*target, module_sp, name, &namespace_decl, nullptr); + var = FindGlobalVariable(*target, module_sp, name, &namespace_decl); if (var) { valobj = ValueObjectVariable::Create(target, var); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h index 41e41c1f1fef38..722f5e15a2aa2b 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -521,17 +521,11 @@ class ClangExpressionDeclMap : public ClangASTSource { /// \param[in] namespace_decl /// If non-NULL and module is non-NULL, the parent namespace. /// - /// \param[in] type - /// The required type for the variable. This function may be called - /// during parsing, in which case we don't know its type; hence the - /// default. - /// /// \return /// The LLDB Variable found, or NULL if none was found. lldb::VariableSP FindGlobalVariable(Target &target, lldb::ModuleSP &module, ConstString name, - CompilerDeclContext *namespace_decl, - TypeFromUser *type = nullptr); + CompilerDeclContext *namespace_decl); /// Get the value of a variable in a given execution context and return the /// associated Types if needed.