/// @return
/// Whatever SetExternalVisibleDeclsForName returns.
//------------------------------------------------------------------
- clang::DeclContextLookupResult
+ bool
FindExternalVisibleDeclsByName (const clang::DeclContext *DC,
clang::DeclarationName Name);
{
}
- clang::DeclContextLookupResult
+ bool
FindExternalVisibleDeclsByName (const clang::DeclContext *DC,
clang::DeclarationName Name)
{
return clang::ELR_Failure;
}
- virtual clang::DeclContextLookupResult
+ virtual bool
FindExternalVisibleDeclsByName (const clang::DeclContext *decl_ctx,
clang::DeclarationName decl_name);
}
// The core lookup interface.
-DeclContext::lookup_result
+bool
ClangASTSource::FindExternalVisibleDeclsByName
(
const DeclContext *decl_ctx,
)
{
if (!m_ast_context)
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ {
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
+ }
if (GetImportInProgress())
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
-
+ {
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
+ }
+
std::string decl_name (clang_decl_name.getAsString());
// if (m_decl_map.DoingASTImport ())
if (!identifier_info ||
identifier_info->getBuiltinID() != 0)
{
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
}
}
break;
// Operator names. Not important for now.
case DeclarationName::CXXOperatorName:
case DeclarationName::CXXLiteralOperatorName:
- return DeclContext::lookup_result();
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
// Using directives found in this context.
// Tell Sema we didn't find any or we'll end up getting asked a *lot*.
case DeclarationName::CXXUsingDirective:
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case DeclarationName::ObjCZeroArgSelector:
case DeclarationName::ObjCOneArgSelector:
FindObjCMethodDecls(method_search_context);
- return SetExternalVisibleDeclsForName (decl_ctx, clang_decl_name, method_decls);
+ SetExternalVisibleDeclsForName (decl_ctx, clang_decl_name, method_decls);
+ return (method_decls.size() > 0);
}
// These aren't possible in the global context.
case DeclarationName::CXXConstructorName:
case DeclarationName::CXXDestructorName:
case DeclarationName::CXXConversionFunctionName:
- return DeclContext::lookup_result();
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
}
}
else
{
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
}
}
if (m_active_lookups.find (uniqued_const_decl_name) != m_active_lookups.end())
{
// We are currently looking up this name...
- return DeclContext::lookup_result();
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
}
m_active_lookups.insert(uniqued_const_decl_name);
// static uint32_t g_depth = 0;
llvm::SmallVector<NamedDecl*, 4> name_decls;
NameSearchContext name_search_context(*this, name_decls, clang_decl_name, decl_ctx);
FindExternalVisibleDecls(name_search_context);
- DeclContext::lookup_result result (SetExternalVisibleDeclsForName (decl_ctx, clang_decl_name, name_decls));
+ SetExternalVisibleDeclsForName (decl_ctx, clang_decl_name, name_decls);
// --g_depth;
m_active_lookups.erase (uniqued_const_decl_name);
- return result;
+ return (name_decls.size() != 0);
}
void
if (!copied_decl)
return NULL;
-
+
NamespaceDecl *copied_namespace_decl = dyn_cast<NamespaceDecl>(copied_decl);
+ if (!copied_namespace_decl)
+ return NULL;
+
+ context.m_decls.push_back(copied_namespace_decl);
+
m_ast_importer->RegisterNamespaceMap(copied_namespace_decl, namespace_decls);
return dyn_cast<NamespaceDecl>(copied_decl);
{
}
- clang::DeclContextLookupResult
+ bool
FindExternalVisibleDeclsByName (const clang::DeclContext *decl_ctx,
clang::DeclarationName name)
{
if (!m_type_vendor.FinishDecl(non_const_interface_decl))
break;
-
- return non_const_interface_decl->lookup(name);
+
+ clang::DeclContext::lookup_const_result result = non_const_interface_decl->lookup(name);
+
+ return (result.size() != 0);
}
while(0);
- return clang::DeclContextLookupResult();
+ SetNoExternalVisibleDeclsForName(decl_ctx, name);
+ return false;
}
clang::ExternalLoadResult
using namespace clang;
using namespace lldb_private;
-clang::DeclContextLookupResult
+bool
ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName
(
const clang::DeclContext *decl_ctx,
m_callback_find_by_name (m_callback_baton, decl_ctx, clang_decl_name, &results);
- DeclContextLookupResult lookup_result (SetExternalVisibleDeclsForName(decl_ctx, clang_decl_name, results));
+ SetExternalVisibleDeclsForName(decl_ctx, clang_decl_name, results);
- return lookup_result;
+ return (results.size() != 0);
}
std::string decl_name (clang_decl_name.getAsString());
case clang::DeclarationName::Identifier:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"Identifier\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
if (clang_decl_name.getAsIdentifierInfo()->getBuiltinID() != 0)
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ {
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
+ }
break;
case clang::DeclarationName::ObjCZeroArgSelector:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"ObjCZeroArgSelector\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case clang::DeclarationName::ObjCOneArgSelector:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"ObjCOneArgSelector\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case clang::DeclarationName::ObjCMultiArgSelector:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"ObjCMultiArgSelector\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case clang::DeclarationName::CXXConstructorName:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"CXXConstructorName\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
+
case clang::DeclarationName::CXXDestructorName:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"CXXDestructorName\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case clang::DeclarationName::CXXConversionFunctionName:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"CXXConversionFunctionName\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case clang::DeclarationName::CXXOperatorName:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"CXXOperatorName\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case clang::DeclarationName::CXXLiteralOperatorName:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"CXXLiteralOperatorName\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return DeclContext::lookup_result();
- break;
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
case clang::DeclarationName::CXXUsingDirective:
//printf ("ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName(decl_ctx = %p, decl_name = { kind = \"CXXUsingDirective\", name = \"%s\")\n", decl_ctx, decl_name.c_str());
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
}
- return DeclContext::lookup_result();
+ SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ return false;
}
void