diff options
author | Greg Clayton <gclayton@apple.com> | 2015-08-24 23:46:31 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2015-08-24 23:46:31 +0000 |
commit | 99558cc424fee346a4070b42ac9c62546d499333 (patch) | |
tree | 3057c0119872e7d5ab68b4571f99ea64eaad1378 /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | |
parent | 774b5e296ff49ef15809182440715959f8db674b (diff) | |
download | bcm5719-llvm-99558cc424fee346a4070b42ac9c62546d499333.tar.gz bcm5719-llvm-99558cc424fee346a4070b42ac9c62546d499333.zip |
Final bit of type system cleanup that abstracts declaration contexts into lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions.
Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files.
Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types.
Bulk renames for things that used to return a ClangASTType which is now CompilerType:
"Type::GetClangFullType()" to "Type::GetFullCompilerType()"
"Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()"
"Type::GetClangForwardType()" to "Type::GetForwardCompilerType()"
"Value::GetClangType()" to "Value::GetCompilerType()"
"Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)"
"ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()"
many more renames that are similar.
llvm-svn: 245905
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index e2ab962a948..dc0c42e22a0 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -877,7 +877,7 @@ uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables ( const ConstString &name, - const ClangNamespaceDecl *namespace_decl, + const CompilerDeclContext *parent_decl_ctx, const std::vector<uint32_t> &indexes, // Indexes into the symbol table that match "name" uint32_t max_matches, VariableList& variables @@ -894,7 +894,7 @@ SymbolFileDWARFDebugMap::PrivateFindGlobalVariables SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx); if (oso_dwarf) { - if (oso_dwarf->FindGlobalVariables(name, namespace_decl, true, max_matches, variables)) + if (oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, true, max_matches, variables)) if (variables.GetSize() > max_matches) break; } @@ -904,7 +904,11 @@ SymbolFileDWARFDebugMap::PrivateFindGlobalVariables } uint32_t -SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables) +SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, + const CompilerDeclContext *parent_decl_ctx, + bool append, + uint32_t max_matches, + VariableList& variables) { // If we aren't appending the results to this list, then clear the list @@ -919,7 +923,7 @@ SymbolFileDWARFDebugMap::FindGlobalVariables (const ConstString &name, const Cla ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { const uint32_t oso_matches = oso_dwarf->FindGlobalVariables (name, - namespace_decl, + parent_decl_ctx, true, max_matches, variables); @@ -1097,7 +1101,12 @@ RemoveFunctionsWithModuleNotEqualTo (const ModuleSP &module_sp, SymbolContextLis } uint32_t -SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list) +SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, + const CompilerDeclContext *parent_decl_ctx, + uint32_t name_type_mask, + bool include_inlines, + bool append, + SymbolContextList& sc_list) { Timer scoped_timer (__PRETTY_FUNCTION__, "SymbolFileDWARFDebugMap::FindFunctions (name = %s)", @@ -1111,7 +1120,7 @@ SymbolFileDWARFDebugMap::FindFunctions(const ConstString &name, const ClangNames ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { uint32_t sc_idx = sc_list.GetSize(); - if (oso_dwarf->FindFunctions(name, namespace_decl, name_type_mask, include_inlines, true, sc_list)) + if (oso_dwarf->FindFunctions(name, parent_decl_ctx, name_type_mask, include_inlines, true, sc_list)) { RemoveFunctionsWithModuleNotEqualTo (m_obj_file->GetModule(), sc_list, sc_idx); } @@ -1286,8 +1295,8 @@ SymbolFileDWARFDebugMap::FindTypes ( const SymbolContext& sc, const ConstString &name, - const ClangNamespaceDecl *namespace_decl, - bool append, + const CompilerDeclContext *parent_decl_ctx, + bool append, uint32_t max_matches, TypeList& types ) @@ -1302,12 +1311,12 @@ SymbolFileDWARFDebugMap::FindTypes { oso_dwarf = GetSymbolFile (sc); if (oso_dwarf) - return oso_dwarf->FindTypes (sc, name, namespace_decl, append, max_matches, types); + return oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, types); } else { ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { - oso_dwarf->FindTypes (sc, name, namespace_decl, append, max_matches, types); + oso_dwarf->FindTypes (sc, name, parent_decl_ctx, append, max_matches, types); return false; }); } @@ -1326,24 +1335,24 @@ SymbolFileDWARFDebugMap::FindTypes //} -ClangNamespaceDecl +CompilerDeclContext SymbolFileDWARFDebugMap::FindNamespace (const lldb_private::SymbolContext& sc, const lldb_private::ConstString &name, - const ClangNamespaceDecl *parent_namespace_decl) + const CompilerDeclContext *parent_decl_ctx) { - ClangNamespaceDecl matching_namespace; + CompilerDeclContext matching_namespace; SymbolFileDWARF *oso_dwarf; if (sc.comp_unit) { oso_dwarf = GetSymbolFile (sc); if (oso_dwarf) - matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_namespace_decl); + matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_decl_ctx); } else { ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { - matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_namespace_decl); + matching_namespace = oso_dwarf->FindNamespace (sc, name, parent_decl_ctx); return (bool)matching_namespace; }); @@ -1433,24 +1442,24 @@ SymbolFileDWARFDebugMap::SetCompileUnit (SymbolFileDWARF *oso_dwarf, const CompU } } -clang::DeclContext* -SymbolFileDWARFDebugMap::GetClangDeclContextContainingTypeUID (lldb::user_id_t type_uid) +CompilerDeclContext +SymbolFileDWARFDebugMap::GetDeclContextForUID (lldb::user_id_t type_uid) { const uint64_t oso_idx = GetOSOIndexFromUserID (type_uid); SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx); if (oso_dwarf) - return oso_dwarf->GetClangDeclContextContainingTypeUID (type_uid); - return NULL; + return oso_dwarf->GetDeclContextForUID (type_uid); + return CompilerDeclContext(); } -clang::DeclContext* -SymbolFileDWARFDebugMap::GetClangDeclContextForTypeUID (const lldb_private::SymbolContext &sc, lldb::user_id_t type_uid) +CompilerDeclContext +SymbolFileDWARFDebugMap::GetDeclContextContainingUID (lldb::user_id_t type_uid) { const uint64_t oso_idx = GetOSOIndexFromUserID (type_uid); SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex (oso_idx); if (oso_dwarf) - return oso_dwarf->GetClangDeclContextForTypeUID (sc, type_uid); - return NULL; + return oso_dwarf->GetDeclContextContainingUID (type_uid); + return CompilerDeclContext(); } bool |