diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h index c8ff7458d055..304b86ae079d 100644 --- a/lldb/include/lldb/Symbol/ClangASTContext.h +++ b/lldb/include/lldb/Symbol/ClangASTContext.h @@ -564,7 +564,7 @@ public: // CompilerDeclContext override functions //---------------------------------------------------------------------- - std::vector + std::vector DeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name) override; bool diff --git a/lldb/include/lldb/Symbol/GoASTContext.h b/lldb/include/lldb/Symbol/GoASTContext.h index 8b6433e2c14c..3de98da59958 100644 --- a/lldb/include/lldb/Symbol/GoASTContext.h +++ b/lldb/include/lldb/Symbol/GoASTContext.h @@ -100,12 +100,6 @@ class GoASTContext : public TypeSystem // CompilerDeclContext functions //---------------------------------------------------------------------- - std::vector - DeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name) override - { - return std::vector(); - } - bool DeclContextIsStructUnionOrClass(void *opaque_decl_ctx) override { diff --git a/lldb/include/lldb/Symbol/TypeSystem.h b/lldb/include/lldb/Symbol/TypeSystem.h index da94bd551c7f..d367bcdc0b14 100644 --- a/lldb/include/lldb/Symbol/TypeSystem.h +++ b/lldb/include/lldb/Symbol/TypeSystem.h @@ -25,6 +25,7 @@ #include "lldb/Core/PluginInterface.h" #include "lldb/Expression/Expression.h" #include "lldb/Host/Mutex.h" +#include "lldb/Symbol/CompilerDecl.h" #include "lldb/Symbol/CompilerDeclContext.h" class DWARFDIE; @@ -141,8 +142,8 @@ public: // CompilerDeclContext functions //---------------------------------------------------------------------- - virtual std::vector - DeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name) = 0; + virtual std::vector + DeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name); virtual bool DeclContextIsStructUnionOrClass (void *opaque_decl_ctx) = 0; diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index 3f90c9367224..541b24ee0fac 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -9627,10 +9627,10 @@ ClangASTContext::DeclGetFunctionArgumentType (void *opaque_decl, size_t idx) // CompilerDeclContext functions //---------------------------------------------------------------------- -std::vector +std::vector ClangASTContext::DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name) { - std::vector found_decls; + std::vector found_decls; if (opaque_decl_ctx) { DeclContext *root_decl_ctx = (DeclContext *)opaque_decl_ctx; @@ -9665,7 +9665,7 @@ ClangASTContext::DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString na { IdentifierInfo *ii = nd->getIdentifier(); if (ii != nullptr && ii->getName().equals(name.AsCString(nullptr))) - found_decls.push_back(nd); + found_decls.push_back(CompilerDecl(this, nd)); } } } @@ -9673,7 +9673,7 @@ ClangASTContext::DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString na { IdentifierInfo *ii = nd->getIdentifier(); if (ii != nullptr && ii->getName().equals(name.AsCString(nullptr))) - found_decls.push_back(nd); + found_decls.push_back(CompilerDecl(this, nd)); } } } diff --git a/lldb/source/Symbol/CompilerDeclContext.cpp b/lldb/source/Symbol/CompilerDeclContext.cpp index a28ea8d86082..e44cee67284c 100644 --- a/lldb/source/Symbol/CompilerDeclContext.cpp +++ b/lldb/source/Symbol/CompilerDeclContext.cpp @@ -17,14 +17,10 @@ using namespace lldb_private; std::vector CompilerDeclContext::FindDeclByName (ConstString name) { - std::vector found_decls; if (IsValid()) - { - std::vector found_opaque_decls = m_type_system->DeclContextFindDeclByName(m_opaque_decl_ctx, name); - for (void *opaque_decl : found_opaque_decls) - found_decls.push_back(CompilerDecl(m_type_system, opaque_decl)); - } - return found_decls; + return m_type_system->DeclContextFindDeclByName(m_opaque_decl_ctx, name); + else + return std::vector(); } bool diff --git a/lldb/source/Symbol/TypeSystem.cpp b/lldb/source/Symbol/TypeSystem.cpp index 41559b0959c0..5c2ab5cceab6 100644 --- a/lldb/source/Symbol/TypeSystem.cpp +++ b/lldb/source/Symbol/TypeSystem.cpp @@ -151,6 +151,14 @@ TypeSystem::DeclGetFunctionArgumentType (void *opaque_decl, size_t arg_idx) return CompilerType(); } + +std::vector +TypeSystem::DeclContextFindDeclByName (void *opaque_decl_ctx, ConstString name) +{ + return std::vector(); +} + + #pragma mark TypeSystemMap TypeSystemMap::TypeSystemMap() :