diff options
Diffstat (limited to 'lldb/source/Symbol')
-rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 496 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTImporter.cpp | 87 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp | 14 | ||||
-rw-r--r-- | lldb/source/Symbol/SymbolFile.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Symbol/SymbolVendor.cpp | 15 | ||||
-rw-r--r-- | lldb/source/Symbol/Type.cpp | 34 |
6 files changed, 98 insertions, 556 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index ecf37ff32f2..6373b1afd3e 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -2297,6 +2297,9 @@ ClangASTContext::GetCompleteDecl (clang::ASTContext *ast, if (tag_decl->isCompleteDefinition()) return true; + if (!tag_decl->hasExternalLexicalStorage()) + return false; + ast_source->CompleteType(tag_decl); return !tag_decl->getTypeForDecl()->isIncompleteType(); @@ -2448,110 +2451,81 @@ GetCompleteQualType (clang::ASTContext *ast, clang::QualType qual_type, bool all case clang::Type::ConstantArray: case clang::Type::IncompleteArray: case clang::Type::VariableArray: - { - const clang::ArrayType *array_type = llvm::dyn_cast<clang::ArrayType>(qual_type.getTypePtr()); - - if (array_type) - return GetCompleteQualType (ast, array_type->getElementType(), allow_completion); - } + { + const clang::ArrayType *array_type = llvm::dyn_cast<clang::ArrayType>(qual_type.getTypePtr()); + + if (array_type) + return GetCompleteQualType (ast, array_type->getElementType(), allow_completion); + } break; case clang::Type::Record: + case clang::Type::Enum: + { + const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr()); + if (tag_type) { - clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl(); - if (cxx_record_decl) + clang::TagDecl *tag_decl = tag_type->getDecl(); + if (tag_decl) { - bool fields_loaded = cxx_record_decl->hasLoadedFieldsFromExternalStorage(); - if (cxx_record_decl->isCompleteDefinition() && fields_loaded) + if (tag_decl->isCompleteDefinition()) return true; - + if (!allow_completion) return false; - - // Call the field_begin() accessor to for it to use the external source - // to load the fields... - clang::ExternalASTSource *external_ast_source = ast->getExternalSource(); - if (external_ast_source) - { - external_ast_source->CompleteType(cxx_record_decl); - if (cxx_record_decl->isCompleteDefinition()) - { - cxx_record_decl->setHasLoadedFieldsFromExternalStorage (true); - cxx_record_decl->field_begin(); - return cxx_record_decl->hasLoadedFieldsFromExternalStorage(); - } - } - } - return false; - } - break; - - case clang::Type::Enum: - { - const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr()); - if (tag_type) - { - clang::TagDecl *tag_decl = tag_type->getDecl(); - if (tag_decl) + + if (tag_decl->hasExternalLexicalStorage()) { - if (tag_decl->getDefinition()) - return true; - - if (!allow_completion) - return false; - - if (tag_decl->hasExternalLexicalStorage()) + if (ast) { - if (ast) + clang::ExternalASTSource *external_ast_source = ast->getExternalSource(); + if (external_ast_source) { - clang::ExternalASTSource *external_ast_source = ast->getExternalSource(); - if (external_ast_source) - { - external_ast_source->CompleteType(tag_decl); - return !tag_type->isIncompleteType(); - } + external_ast_source->CompleteType(tag_decl); + return !tag_type->isIncompleteType(); } } - return false; } + return false; } - } + + } break; case clang::Type::ObjCObject: case clang::Type::ObjCInterface: + { + const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type); + if (objc_class_type) { - const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type); - if (objc_class_type) + clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface(); + // We currently can't complete objective C types through the newly added ASTContext + // because it only supports TagDecl objects right now... + if (class_interface_decl) { - clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface(); - // We currently can't complete objective C types through the newly added ASTContext - // because it only supports TagDecl objects right now... - if (class_interface_decl) + if (class_interface_decl->getDefinition()) + return true; + + if (!allow_completion) + return false; + + if (class_interface_decl->hasExternalLexicalStorage()) { - if (class_interface_decl->getDefinition()) - return true; - - if (!allow_completion) - return false; - - if (class_interface_decl->hasExternalLexicalStorage()) + if (ast) { - if (ast) + clang::ExternalASTSource *external_ast_source = ast->getExternalSource(); + if (external_ast_source) { - clang::ExternalASTSource *external_ast_source = ast->getExternalSource(); - if (external_ast_source) - { - external_ast_source->CompleteType (class_interface_decl); - return !objc_class_type->isIncompleteType(); - } + external_ast_source->CompleteType (class_interface_decl); + return !objc_class_type->isIncompleteType(); } } - return false; } + return false; } } + } break; case clang::Type::Typedef: @@ -2562,10 +2536,7 @@ GetCompleteQualType (clang::ASTContext *ast, clang::QualType qual_type, bool all case clang::Type::Paren: return GetCompleteQualType (ast, llvm::cast<clang::ParenType>(qual_type)->desugar(), allow_completion); - - case clang::Type::Attributed: - return GetCompleteQualType (ast, llvm::cast<clang::AttributedType>(qual_type)->getModifiedType(), allow_completion); - + default: break; } @@ -7189,16 +7160,6 @@ ClangASTContext::GetAsRecordDecl (const CompilerType& type) return nullptr; } -clang::TagDecl * -ClangASTContext::GetAsTagDecl (const CompilerType& type) -{ - clang::QualType qual_type = GetCanonicalQualType(type); - if (qual_type.isNull()) - return nullptr; - else - return qual_type->getAsTagDecl(); -} - clang::CXXRecordDecl * ClangASTContext::GetAsCXXRecordDecl (lldb::opaque_compiler_type_t type) { @@ -8076,64 +8037,6 @@ ClangASTContext::AddMethodToObjCObjectType (const CompilerType& type, } bool -ClangASTContext::GetHasExternalStorage (const CompilerType &type) -{ - if (IsClangType(type)) - return false; - - clang::QualType qual_type (GetCanonicalQualType(type)); - - const clang::Type::TypeClass type_class = qual_type->getTypeClass(); - switch (type_class) - { - case clang::Type::Record: - { - clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl(); - if (cxx_record_decl) - return cxx_record_decl->hasExternalLexicalStorage () || cxx_record_decl->hasExternalVisibleStorage(); - } - break; - - case clang::Type::Enum: - { - clang::EnumDecl *enum_decl = llvm::cast<clang::EnumType>(qual_type)->getDecl(); - if (enum_decl) - return enum_decl->hasExternalLexicalStorage () || enum_decl->hasExternalVisibleStorage(); - } - break; - - case clang::Type::ObjCObject: - case clang::Type::ObjCInterface: - { - const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr()); - assert (objc_class_type); - if (objc_class_type) - { - clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface(); - - if (class_interface_decl) - return class_interface_decl->hasExternalLexicalStorage () || class_interface_decl->hasExternalVisibleStorage (); - } - } - break; - - case clang::Type::Typedef: - return GetHasExternalStorage (CompilerType(type.GetTypeSystem(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr())); - - case clang::Type::Elaborated: - return GetHasExternalStorage (CompilerType(type.GetTypeSystem(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr())); - - case clang::Type::Paren: - return GetHasExternalStorage (CompilerType(type.GetTypeSystem(), llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr())); - - default: - break; - } - return false; -} - - -bool ClangASTContext::SetHasExternalStorage (lldb::opaque_compiler_type_t type, bool has_extern) { if (!type) @@ -8203,174 +8106,39 @@ ClangASTContext::SetHasExternalStorage (lldb::opaque_compiler_type_t type, bool } -bool -ClangASTContext::CanImport (const CompilerType &type, lldb_private::ClangASTImporter &importer) -{ - if (IsClangType(type)) - { - // TODO: remove external completion BOOL - // CompleteAndFetchChildren should get the Decl out and check for the - - clang::QualType qual_type(GetCanonicalQualType(RemoveFastQualifiers(type))); - - const clang::Type::TypeClass type_class = qual_type->getTypeClass(); - switch (type_class) - { - case clang::Type::Record: - { - const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl(); - if (cxx_record_decl) - { - if (importer.ResolveDeclOrigin (cxx_record_decl, NULL, NULL)) - return true; - } - } - break; - - case clang::Type::Enum: - { - clang::EnumDecl *enum_decl = llvm::cast<clang::EnumType>(qual_type)->getDecl(); - if (enum_decl) - { - if (importer.ResolveDeclOrigin (enum_decl, NULL, NULL)) - return true; - } - } - break; - - case clang::Type::ObjCObject: - case clang::Type::ObjCInterface: - { - const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type); - if (objc_class_type) - { - clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface(); - // We currently can't complete objective C types through the newly added ASTContext - // because it only supports TagDecl objects right now... - if (class_interface_decl) - { - if (importer.ResolveDeclOrigin (class_interface_decl, NULL, NULL)) - return true; - } - } - } - break; - - - case clang::Type::Typedef: - return CanImport(CompilerType (type.GetTypeSystem(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), importer); - - case clang::Type::Elaborated: - return CanImport(CompilerType (type.GetTypeSystem(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), importer); - - case clang::Type::Paren: - return CanImport(CompilerType (type.GetTypeSystem(), llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), importer); +#pragma mark TagDecl - default: - break; - } - } - return false; -} bool -ClangASTContext::Import (const CompilerType &type, lldb_private::ClangASTImporter &importer) +ClangASTContext::StartTagDeclarationDefinition (const CompilerType &type) { - if (IsClangType(type)) + if (type) { - // TODO: remove external completion BOOL - // CompleteAndFetchChildren should get the Decl out and check for the - - clang::QualType qual_type(GetCanonicalQualType(RemoveFastQualifiers(type))); - - const clang::Type::TypeClass type_class = qual_type->getTypeClass(); - switch (type_class) + + clang::QualType qual_type (GetQualType(type)); + const clang::Type *t = qual_type.getTypePtr(); + if (t) { - case clang::Type::Record: + const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(t); + if (tag_type) { - const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl(); - if (cxx_record_decl) + clang::TagDecl *tag_decl = tag_type->getDecl(); + if (tag_decl) { - if (importer.ResolveDeclOrigin (cxx_record_decl, NULL, NULL)) - return importer.CompleteAndFetchChildren(qual_type); - } - } - break; - - case clang::Type::Enum: - { - clang::EnumDecl *enum_decl = llvm::cast<clang::EnumType>(qual_type)->getDecl(); - if (enum_decl) - { - if (importer.ResolveDeclOrigin (enum_decl, NULL, NULL)) - return importer.CompleteAndFetchChildren(qual_type); + tag_decl->startDefinition(); + return true; } } - break; - - case clang::Type::ObjCObject: - case clang::Type::ObjCInterface: + + const clang::ObjCObjectType *object_type = llvm::dyn_cast<clang::ObjCObjectType>(t); + if (object_type) { - const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type); - if (objc_class_type) + clang::ObjCInterfaceDecl *interface_decl = object_type->getInterface(); + if (interface_decl) { - clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface(); - // We currently can't complete objective C types through the newly added ASTContext - // because it only supports TagDecl objects right now... - if (class_interface_decl) - { - if (importer.ResolveDeclOrigin (class_interface_decl, NULL, NULL)) - return importer.CompleteAndFetchChildren(qual_type); - } + interface_decl->startDefinition(); + return true; } } - break; - - - case clang::Type::Typedef: - return Import (CompilerType(type.GetTypeSystem(), llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr()), importer); - - case clang::Type::Elaborated: - return Import (CompilerType(type.GetTypeSystem(),llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr()), importer); - - case clang::Type::Paren: - return Import (CompilerType(type.GetTypeSystem(),llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr()), importer); - - default: - break; - } - } - return false; -} - - -#pragma mark TagDecl - -bool -ClangASTContext::StartTagDeclarationDefinition (const CompilerType &type) -{ - clang::QualType qual_type (ClangASTContext::GetQualType(type)); - if (!qual_type.isNull()) - { - const clang::TagType *tag_type = qual_type->getAs<clang::TagType>(); - if (tag_type) - { - clang::TagDecl *tag_decl = tag_type->getDecl(); - if (tag_decl) - { - tag_decl->startDefinition(); - return true; - } - } - - const clang::ObjCObjectType *object_type = qual_type->getAs<clang::ObjCObjectType>(); - if (object_type) - { - clang::ObjCInterfaceDecl *interface_decl = object_type->getInterface(); - if (interface_decl) - { - interface_decl->startDefinition(); - return true; - } } } return false; @@ -8379,22 +8147,26 @@ ClangASTContext::StartTagDeclarationDefinition (const CompilerType &type) bool ClangASTContext::CompleteTagDeclarationDefinition (const CompilerType& type) { - clang::QualType qual_type (ClangASTContext::GetQualType(type)); - if (!qual_type.isNull()) + if (type) { + clang::QualType qual_type (GetQualType(type)); + if (qual_type.isNull()) + return false; + ClangASTContext *lldb_ast = llvm::dyn_cast<ClangASTContext>(type.GetTypeSystem()); + if (lldb_ast == nullptr) + return false; + clang::ASTContext *ast = lldb_ast->getASTContext(); + clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl(); if (cxx_record_decl) { - if (!cxx_record_decl->isCompleteDefinition()) - cxx_record_decl->completeDefinition(); - cxx_record_decl->setHasLoadedFieldsFromExternalStorage(true); - cxx_record_decl->setHasExternalLexicalStorage (false); - cxx_record_decl->setHasExternalVisibleStorage (false); + cxx_record_decl->completeDefinition(); + return true; } - const clang::EnumType *enutype = qual_type->getAs<clang::EnumType>(); + const clang::EnumType *enutype = llvm::dyn_cast<clang::EnumType>(qual_type.getTypePtr()); if (enutype) { @@ -8402,33 +8174,25 @@ ClangASTContext::CompleteTagDeclarationDefinition (const CompilerType& type) if (enum_decl) { - if (!enum_decl->isCompleteDefinition()) + /// TODO This really needs to be fixed. + + unsigned NumPositiveBits = 1; + unsigned NumNegativeBits = 0; + + clang::QualType promotion_qual_type; + // If the enum integer type is less than an integer in bit width, + // then we must promote it to an integer size. + if (ast->getTypeSize(enum_decl->getIntegerType()) < ast->getTypeSize(ast->IntTy)) { - ClangASTContext *lldb_ast = llvm::dyn_cast<ClangASTContext>(type.GetTypeSystem()); - if (lldb_ast == nullptr) - return false; - clang::ASTContext *ast = lldb_ast->getASTContext(); - - /// TODO This really needs to be fixed. - - unsigned NumPositiveBits = 1; - unsigned NumNegativeBits = 0; - - clang::QualType promotion_qual_type; - // If the enum integer type is less than an integer in bit width, - // then we must promote it to an integer size. - if (ast->getTypeSize(enum_decl->getIntegerType()) < ast->getTypeSize(ast->IntTy)) - { - if (enum_decl->getIntegerType()->isSignedIntegerType()) - promotion_qual_type = ast->IntTy; - else - promotion_qual_type = ast->UnsignedIntTy; - } + if (enum_decl->getIntegerType()->isSignedIntegerType()) + promotion_qual_type = ast->IntTy; else - promotion_qual_type = enum_decl->getIntegerType(); - - enum_decl->completeDefinition(enum_decl->getIntegerType(), promotion_qual_type, NumPositiveBits, NumNegativeBits); + promotion_qual_type = ast->UnsignedIntTy; } + else + promotion_qual_type = enum_decl->getIntegerType(); + + enum_decl->completeDefinition(enum_decl->getIntegerType(), promotion_qual_type, NumPositiveBits, NumNegativeBits); return true; } } @@ -9212,72 +8976,6 @@ ClangASTContext::DumpTypeDescription (lldb::opaque_compiler_type_t type, Stream } } -void -ClangASTContext::DumpTypeName (const CompilerType &type) -{ - if (IsClangType(type)) - { - clang::QualType qual_type(GetCanonicalQualType(RemoveFastQualifiers(type))); - - const clang::Type::TypeClass type_class = qual_type->getTypeClass(); - switch (type_class) - { - case clang::Type::Record: - { - const clang::CXXRecordDecl *cxx_record_decl = qual_type->getAsCXXRecordDecl(); - if (cxx_record_decl) - printf("class %s", cxx_record_decl->getName().str().c_str()); - } - break; - - case clang::Type::Enum: - { - clang::EnumDecl *enum_decl = llvm::cast<clang::EnumType>(qual_type)->getDecl(); - if (enum_decl) - { - printf("enum %s", enum_decl->getName().str().c_str()); - } - } - break; - - case clang::Type::ObjCObject: - case clang::Type::ObjCInterface: - { - const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type); - if (objc_class_type) - { - clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface(); - // We currently can't complete objective C types through the newly added ASTContext - // because it only supports TagDecl objects right now... - if (class_interface_decl) - printf("@class %s", class_interface_decl->getName().str().c_str()); - } - } - break; - - - case clang::Type::Typedef: - printf("typedef %s", llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getName().str().c_str()); - break; - - case clang::Type::Elaborated: - printf("elaborated "); - return DumpTypeName (CompilerType (type.GetTypeSystem(), llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr())); - - case clang::Type::Paren: - printf("paren "); - return DumpTypeName (CompilerType (type.GetTypeSystem(), llvm::cast<clang::ParenType>(qual_type)->desugar().getAsOpaquePtr())); - - default: - printf("ClangASTContext::DumpTypeName() type_class = %u", type_class); - break; - } - } - -} - - - clang::ClassTemplateDecl * ClangASTContext::ParseClassTemplateDecl (clang::DeclContext *decl_ctx, lldb::AccessType access_type, diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index c2233b8f094..94ac816b182 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -67,31 +67,6 @@ ClangASTImporter::CopyType (clang::ASTContext *dst_ast, return CopyType (dst_ast, src_ast, QualType::getFromOpaquePtr(type)).getAsOpaquePtr(); } -CompilerType -ClangASTImporter::CopyType (ClangASTContext &dst_ast, - const CompilerType &src_type) -{ - clang::ASTContext *dst_clang_ast = dst_ast.getASTContext(); - if (dst_clang_ast) - { - ClangASTContext *src_ast = llvm::dyn_cast_or_null<ClangASTContext>(src_type.GetTypeSystem()); - if (src_ast) - { - clang::ASTContext *src_clang_ast = src_ast->getASTContext(); - if (src_clang_ast) - { - lldb::opaque_compiler_type_t dst_clang_type = CopyType(dst_clang_ast, - src_clang_ast, - src_type.GetOpaqueQualType()); - - if (dst_clang_type) - return CompilerType(&dst_ast, dst_clang_type); - } - } - } - return CompilerType(); -} - clang::Decl * ClangASTImporter::CopyDecl (clang::ASTContext *dst_ast, clang::ASTContext *src_ast, @@ -454,68 +429,6 @@ ClangASTImporter::CompleteObjCInterfaceDecl (clang::ObjCInterfaceDecl *interface } bool -ClangASTImporter::CompleteAndFetchChildren (clang::QualType type) -{ - if (!RequireCompleteType(type)) - return false; - - if (const TagType *tag_type = type->getAs<TagType>()) - { - TagDecl *tag_decl = tag_type->getDecl(); - - DeclOrigin decl_origin = GetDeclOrigin(tag_decl); - - if (!decl_origin.Valid()) - return false; - - MinionSP minion_sp (GetMinion(&tag_decl->getASTContext(), decl_origin.ctx)); - - TagDecl *origin_tag_decl = llvm::dyn_cast<TagDecl>(decl_origin.decl); - - for (Decl *origin_child_decl : origin_tag_decl->decls()) - { - minion_sp->Import(origin_child_decl); - } - - if (RecordDecl *record_decl = dyn_cast<RecordDecl>(origin_tag_decl)) - { - record_decl->setHasLoadedFieldsFromExternalStorage(true); - } - - return true; - } - - if (const ObjCObjectType *objc_object_type = type->getAs<ObjCObjectType>()) - { - if (ObjCInterfaceDecl *objc_interface_decl = objc_object_type->getInterface()) - { - DeclOrigin decl_origin = GetDeclOrigin(objc_interface_decl); - - if (!decl_origin.Valid()) - return false; - - MinionSP minion_sp (GetMinion(&objc_interface_decl->getASTContext(), decl_origin.ctx)); - - ObjCInterfaceDecl *origin_interface_decl = llvm::dyn_cast<ObjCInterfaceDecl>(decl_origin.decl); - - for (Decl *origin_child_decl : origin_interface_decl->decls()) - { - minion_sp->Import(origin_child_decl); - } - - return true; - } - else - { - return false; - } - } - - return true; -} - - -bool ClangASTImporter::RequireCompleteType (clang::QualType type) { if (type.isNull()) diff --git a/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp b/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp index 6c804f4d969..cd6972cce97 100644 --- a/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp +++ b/lldb/source/Symbol/ClangExternalASTSourceCallbacks.cpp @@ -41,7 +41,6 @@ #endif #include "lldb/Core/Log.h" -#include "clang/AST/Decl.h" using namespace clang; using namespace lldb_private; @@ -161,16 +160,3 @@ ClangExternalASTSourceCallbacks::layoutRecordType( return false; } -void -ClangExternalASTSourceCallbacks::FindExternalLexicalDecls (const clang::DeclContext *decl_ctx, - llvm::function_ref<bool(clang::Decl::Kind)> IsKindWeWant, - llvm::SmallVectorImpl<clang::Decl *> &decls) -{ - if (m_callback_tag_decl && decl_ctx) - { - clang::TagDecl *tag_decl = llvm::dyn_cast<clang::TagDecl>(const_cast<clang::DeclContext *>(decl_ctx)); - if (tag_decl) - CompleteType(tag_decl); - } -} - diff --git a/lldb/source/Symbol/SymbolFile.cpp b/lldb/source/Symbol/SymbolFile.cpp index 51e35048d5c..5486468181f 100644 --- a/lldb/source/Symbol/SymbolFile.cpp +++ b/lldb/source/Symbol/SymbolFile.cpp @@ -142,11 +142,3 @@ SymbolFile::FindTypes (const SymbolContext& sc, const ConstString &name, const C return 0; } - -size_t -SymbolFile::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types) -{ - if (!append) - types.Clear(); - return 0; -} diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp index b361d400f22..97e2575aaa0 100644 --- a/lldb/source/Symbol/SymbolVendor.cpp +++ b/lldb/source/Symbol/SymbolVendor.cpp @@ -361,21 +361,6 @@ SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const } size_t -SymbolVendor::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types) -{ - ModuleSP module_sp(GetModule()); - if (module_sp) - { - lldb_private::Mutex::Locker locker(module_sp->GetMutex()); - if (m_sym_file_ap.get()) - return m_sym_file_ap->FindTypes(context, append, types); - } - if (!append) - types.Clear(); - return 0; -} - -size_t SymbolVendor::GetTypes (SymbolContextScope *sc_scope, uint32_t type_mask, lldb_private::TypeList &type_list) diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index cd0cb830682..b0c273d2e22 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -7,12 +7,8 @@ // //===----------------------------------------------------------------------===// -// C Includes -#include <stdio.h> - -// C++ Includes // Other libraries and framework includes -// Project includes + #include "lldb/Core/DataExtractor.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Module.h" @@ -40,27 +36,6 @@ using namespace lldb; using namespace lldb_private; -void -CompilerContext::Dump() const -{ - switch (type) - { - case CompilerContextKind::Invalid: printf("Invalid"); break; - case CompilerContextKind::TranslationUnit: printf("TranslationUnit"); break; - case CompilerContextKind::Module: printf("Module"); break; - case CompilerContextKind::Namespace: printf("Namespace"); break; - case CompilerContextKind::Class: printf("Class"); break; - case CompilerContextKind::Structure: printf("Structure"); break; - case CompilerContextKind::Union: printf("Union"); break; - case CompilerContextKind::Function: printf("Function"); break; - case CompilerContextKind::Variable: printf("Variable"); break; - case CompilerContextKind::Enumeration: printf("Enumeration"); break; - case CompilerContextKind::Typedef: printf("Typedef"); break; - default: printf("???(%u)", type); - } - printf("(\"%s\")\n", name.GetCString()); -} - class TypeAppendVisitor { public: @@ -87,13 +62,6 @@ TypeListImpl::Append (const lldb_private::TypeList &type_list) type_list.ForEach(cb); } -SymbolFileType::SymbolFileType (SymbolFile &symbol_file, const lldb::TypeSP &type_sp) : - UserID (type_sp ? type_sp->GetID() : LLDB_INVALID_UID), - m_symbol_file (symbol_file), - m_type_sp (type_sp) -{ -} - Type * SymbolFileType::GetType () |