diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-12-23 12:18:49 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-23 12:43:47 +0100 |
| commit | b6c29d9de027692cfe93a4f701cf49f1d5f99574 (patch) | |
| tree | 23690b2c26090c8a255d449abe1707b9ec473b16 /lldb/source/Plugins/ExpressionParser | |
| parent | a175c6a6f6bd98a5afc3bb90b41362e812134309 (diff) | |
| download | bcm5719-llvm-b6c29d9de027692cfe93a4f701cf49f1d5f99574.tar.gz bcm5719-llvm-b6c29d9de027692cfe93a4f701cf49f1d5f99574.zip | |
[lldb][NFC] Remove unused 'type' parameter in ClangExpressionDeclMap::FindGlobalVariable
We never pass something else than a nullptr as the 'type' so the related code in this function is never reached.
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp | 21 | ||||
| -rw-r--r-- | lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h | 8 |
2 files changed, 6 insertions, 23 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index 7a7d9b82936..60afa126ce9 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 41e41c1f1fe..722f5e15a2a 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -521,17 +521,11 @@ private: /// \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. |

