diff options
Diffstat (limited to 'lldb/source/Symbol')
-rw-r--r-- | lldb/source/Symbol/Block.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Symbol/ClangASTImporter.cpp | 140 | ||||
-rw-r--r-- | lldb/source/Symbol/CompileUnit.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Symbol/Function.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Symbol/ObjectFile.cpp | 82 | ||||
-rw-r--r-- | lldb/source/Symbol/SymbolVendor.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Symbol/Type.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Symbol/Variable.cpp | 2 |
8 files changed, 116 insertions, 138 deletions
diff --git a/lldb/source/Symbol/Block.cpp b/lldb/source/Symbol/Block.cpp index 4ab86e54bf6..70d63e9e148 100644 --- a/lldb/source/Symbol/Block.cpp +++ b/lldb/source/Symbol/Block.cpp @@ -83,9 +83,9 @@ Block::Dump(Stream *s, addr_t base_addr, int32_t depth, bool show_context) const } } - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<const void*>(this)); s->Indent(); - *s << "Block" << ((const UserID&)*this); + *s << "Block" << static_cast<const UserID&>(*this); const Block* parent_block = GetParent(); if (parent_block) { @@ -100,7 +100,7 @@ Block::Dump(Stream *s, addr_t base_addr, int32_t depth, bool show_context) const if (!m_ranges.IsEmpty()) { *s << ", ranges ="; - + size_t num_ranges = m_ranges.GetSize(); for (size_t i=0; i<num_ranges; ++i) { diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index afdca97ece2..1bf35f34c3b 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -142,39 +142,36 @@ ClangASTImporter::DeportDecl (clang::ASTContext *dst_ctx, clang::Decl *decl) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - + if (log) log->Printf(" [ClangASTImporter] DeportDecl called on (%sDecl*)%p from (ASTContext*)%p to (ASTContex*)%p", - decl->getDeclKindName(), - decl, - src_ctx, - dst_ctx); - + decl->getDeclKindName(), static_cast<void*>(decl), + static_cast<void*>(src_ctx), + static_cast<void*>(dst_ctx)); + MinionSP minion_sp (GetMinion (dst_ctx, src_ctx)); - + if (!minion_sp) return NULL; - + std::set<NamedDecl *> decls_to_deport; std::set<NamedDecl *> decls_already_deported; - + minion_sp->InitDeportWorkQueues(&decls_to_deport, &decls_already_deported); - + clang::Decl *result = CopyDecl(dst_ctx, src_ctx, decl); minion_sp->ExecuteDeportWorkQueues(); - + if (!result) return NULL; - + if (log) log->Printf(" [ClangASTImporter] DeportDecl deported (%sDecl*)%p to (%sDecl*)%p", - decl->getDeclKindName(), - decl, - result->getDeclKindName(), - result); - + decl->getDeclKindName(), static_cast<void*>(decl), + result->getDeclKindName(), static_cast<void*>(result)); + return result; } @@ -183,11 +180,10 @@ ClangASTImporter::CompleteDecl (clang::Decl *decl) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - if (log) + if (log) log->Printf(" [ClangASTImporter] CompleteDecl called on (%sDecl*)%p", - decl->getDeclKindName(), - decl); - + decl->getDeclKindName(), static_cast<void*>(decl)); + if (ObjCInterfaceDecl *interface_decl = dyn_cast<ObjCInterfaceDecl>(decl)) { if (!interface_decl->getDefinition()) @@ -412,9 +408,10 @@ void ClangASTImporter::ForgetDestination (clang::ASTContext *dst_ast) { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - + if (log) - log->Printf(" [ClangASTImporter] Forgetting destination (ASTContext*)%p", dst_ast); + log->Printf(" [ClangASTImporter] Forgetting destination (ASTContext*)%p", + static_cast<void*>(dst_ast)); m_metadata_map.erase(dst_ast); } @@ -423,17 +420,18 @@ void ClangASTImporter::ForgetSource (clang::ASTContext *dst_ast, clang::ASTContext *src_ast) { ASTContextMetadataSP md = MaybeGetContextMetadata (dst_ast); - + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - + if (log) - log->Printf(" [ClangASTImporter] Forgetting source->dest (ASTContext*)%p->(ASTContext*)%p", src_ast, dst_ast); - + log->Printf(" [ClangASTImporter] Forgetting source->dest (ASTContext*)%p->(ASTContext*)%p", + static_cast<void*>(src_ast), static_cast<void*>(dst_ast)); + if (!md) return; - + md->m_minions.erase(src_ast); - + for (OriginMap::iterator iter = md->m_origins.begin(); iter != md->m_origins.end(); ) @@ -572,64 +570,60 @@ clang::Decl * ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to) { ClangASTMetrics::RegisterClangImport(); - + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); - + if (log) { lldb::user_id_t user_id; ClangASTMetadata *metadata = m_master.GetDeclMetadata(from); if (metadata) user_id = metadata->GetUserID(); - + if (NamedDecl *from_named_decl = dyn_cast<clang::NamedDecl>(from)) { std::string name_string; llvm::raw_string_ostream name_stream(name_string); from_named_decl->printName(name_stream); name_stream.flush(); - + log->Printf(" [ClangASTImporter] Imported (%sDecl*)%p, named %s (from (Decl*)%p), metadata 0x%" PRIx64, - from->getDeclKindName(), - to, - name_string.c_str(), - from, + from->getDeclKindName(), static_cast<void*>(to), + name_string.c_str(), static_cast<void*>(from), user_id); } else { log->Printf(" [ClangASTImporter] Imported (%sDecl*)%p (from (Decl*)%p), metadata 0x%" PRIx64, - from->getDeclKindName(), - to, - from, - user_id); + from->getDeclKindName(), static_cast<void*>(to), + static_cast<void*>(from), user_id); } } ASTContextMetadataSP to_context_md = m_master.GetContextMetadata(&to->getASTContext()); ASTContextMetadataSP from_context_md = m_master.MaybeGetContextMetadata(m_source_ctx); - + if (from_context_md) { OriginMap &origins = from_context_md->m_origins; - + OriginMap::iterator origin_iter = origins.find(from); - + if (origin_iter != origins.end()) { to_context_md->m_origins[to] = origin_iter->second; - + MinionSP direct_completer = m_master.GetMinion(&to->getASTContext(), origin_iter->second.ctx); - + if (direct_completer.get() != this) direct_completer->ASTImporter::Imported(origin_iter->second.decl, to); - + if (log) log->Printf(" [ClangASTImporter] Propagated origin (Decl*)%p/(ASTContext*)%p from (ASTContext*)%p to (ASTContext*)%p", - origin_iter->second.decl, - origin_iter->second.ctx, - &from->getASTContext(), - &to->getASTContext()); + static_cast<void*>(origin_iter->second.decl), + static_cast<void*>(origin_iter->second.ctx), + static_cast<void*>(&from->getASTContext()), + static_cast<void*>(&to->getASTContext())); } else { @@ -638,27 +632,27 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to) if (isa<TagDecl>(to) || isa<ObjCInterfaceDecl>(to)) { NamedDecl *to_named_decl = dyn_cast<NamedDecl>(to); - + if (!m_decls_already_deported->count(to_named_decl)) m_decls_to_deport->insert(to_named_decl); } } to_context_md->m_origins[to] = DeclOrigin(m_source_ctx, from); - + if (log) log->Printf(" [ClangASTImporter] Decl has no origin information in (ASTContext*)%p", - &from->getASTContext()); + static_cast<void*>(&from->getASTContext())); } - + if (clang::NamespaceDecl *to_namespace = dyn_cast<clang::NamespaceDecl>(to)) { clang::NamespaceDecl *from_namespace = dyn_cast<clang::NamespaceDecl>(from); - + NamespaceMetaMap &namespace_maps = from_context_md->m_namespace_maps; - + NamespaceMetaMap::iterator namespace_map_iter = namespace_maps.find(from_namespace); - + if (namespace_map_iter != namespace_maps.end()) to_context_md->m_namespace_maps[to_namespace] = namespace_map_iter->second; } @@ -666,21 +660,21 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to) else { to_context_md->m_origins[to] = DeclOrigin (m_source_ctx, from); - + if (log) log->Printf(" [ClangASTImporter] Sourced origin (Decl*)%p/(ASTContext*)%p into (ASTContext*)%p", - from, - m_source_ctx, - &to->getASTContext()); + static_cast<void*>(from), + static_cast<void*>(m_source_ctx), + static_cast<void*>(&to->getASTContext())); } - + if (TagDecl *from_tag_decl = dyn_cast<TagDecl>(from)) { TagDecl *to_tag_decl = dyn_cast<TagDecl>(to); - + to_tag_decl->setHasExternalLexicalStorage(); to_tag_decl->setMustBuildLookupTable(); - + if (log) log->Printf(" [ClangASTImporter] To is a TagDecl - attributes %s%s [%s->%s]", (to_tag_decl->hasExternalLexicalStorage() ? " Lexical" : ""), @@ -688,32 +682,32 @@ ClangASTImporter::Minion::Imported (clang::Decl *from, clang::Decl *to) (from_tag_decl->isCompleteDefinition() ? "complete" : "incomplete"), (to_tag_decl->isCompleteDefinition() ? "complete" : "incomplete")); } - + if (isa<NamespaceDecl>(from)) { NamespaceDecl *to_namespace_decl = dyn_cast<NamespaceDecl>(to); - + m_master.BuildNamespaceMap(to_namespace_decl); - + to_namespace_decl->setHasExternalVisibleStorage(); } - + if (isa<ObjCInterfaceDecl>(from)) { ObjCInterfaceDecl *to_interface_decl = dyn_cast<ObjCInterfaceDecl>(to); - + to_interface_decl->setHasExternalLexicalStorage(); to_interface_decl->setHasExternalVisibleStorage(); - + /*to_interface_decl->setExternallyCompleted();*/ - + if (log) log->Printf(" [ClangASTImporter] To is an ObjCInterfaceDecl - attributes %s%s%s", (to_interface_decl->hasExternalLexicalStorage() ? " Lexical" : ""), (to_interface_decl->hasExternalVisibleStorage() ? " Visible" : ""), (to_interface_decl->hasDefinition() ? " HasDefinition" : "")); } - + return clang::ASTImporter::Imported(from, to); } diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp index 62ae1cc1cbe..f5ff8e8acf2 100644 --- a/lldb/source/Symbol/CompileUnit.cpp +++ b/lldb/source/Symbol/CompileUnit.cpp @@ -99,11 +99,11 @@ CompileUnit::GetDescription(Stream *s, lldb::DescriptionLevel level) const void CompileUnit::Dump(Stream *s, bool show_context) const { - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<const void*>(this)); s->Indent(); - *s << "CompileUnit" << (const UserID&)*this - << ", language = \"" << (const Language&)*this - << "\", file = '" << (const FileSpec&)*this << "'\n"; + *s << "CompileUnit" << static_cast<const UserID&>(*this) + << ", language = \"" << reinterpret_cast<const Language&>(*this) + << "\", file = '" << static_cast<const FileSpec&>(*this) << "'\n"; // m_types.Dump(s); diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index e6d6c000bc9..85132144c88 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -354,20 +354,16 @@ Function::GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target void Function::Dump(Stream *s, bool show_context) const { - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<const void*>(this)); s->Indent(); - *s << "Function" << (const UserID&)*this; + *s << "Function" << static_cast<const UserID&>(*this); m_mangled.Dump(s); if (m_type) - { - s->Printf(", type = %p", m_type); - } + s->Printf(", type = %p", static_cast<void*>(m_type)); else if (m_type_uid != LLDB_INVALID_UID) - { s->Printf(", type_uid = 0x%8.8" PRIx64, m_type_uid); - } s->EOL(); // Dump the root object diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index c3294c94375..9c5567aed0e 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -42,7 +42,9 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, Timer scoped_timer (__PRETTY_FUNCTION__, "ObjectFile::FindPlugin (module = %s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")", module_sp->GetFileSpec().GetPath().c_str(), - file, (uint64_t) file_offset, (uint64_t) file_size); + static_cast<const void*>(file), + static_cast<uint64_t>(file_offset), + static_cast<uint64_t>(file_size)); if (file) { FileSpec archive_file; @@ -60,10 +62,10 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, for (uint32_t idx = 0; (create_object_container_callback = PluginManager::GetObjectContainerCreateCallbackAtIndex(idx)) != NULL; ++idx) { std::unique_ptr<ObjectContainer> object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); - + if (object_container_ap.get()) object_file_sp = object_container_ap->GetObjectFile(file); - + if (object_file_sp.get()) return object_file_sp; } @@ -102,10 +104,10 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, for (uint32_t idx = 0; (create_object_container_callback = PluginManager::GetObjectContainerCreateCallbackAtIndex(idx)) != NULL; ++idx) { std::unique_ptr<ObjectContainer> object_container_ap(create_object_container_callback(module_sp, data_sp, data_offset, file, file_offset, file_size)); - + if (object_container_ap.get()) object_file_sp = object_container_ap->GetObjectFile(file); - + if (object_file_sp.get()) return object_file_sp; } @@ -157,15 +159,15 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, DataBufferSP &data_sp) { ObjectFileSP object_file_sp; - + if (module_sp) { Timer scoped_timer (__PRETTY_FUNCTION__, "ObjectFile::FindPlugin (module = %s, process = %p, header_addr = 0x%" PRIx64 ")", module_sp->GetFileSpec().GetPath().c_str(), - process_sp.get(), header_addr); + static_cast<void*>(process_sp.get()), header_addr); uint32_t idx; - + // Check if this is a normal object file by iterating through // all object file plugin instances. ObjectFileCreateMemoryInstance create_callback; @@ -175,8 +177,8 @@ ObjectFile::FindPlugin (const lldb::ModuleSP &module_sp, if (object_file_sp.get()) return object_file_sp; } - } + // We didn't find it, so clear our shared pointer in case it // contains anything and return an empty shared pointer object_file_sp.reset(); @@ -261,27 +263,12 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, m_data.SetData (data_sp, data_offset, length); Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - { - if (m_file) - { - log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), file = %s, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64, - this, - module_sp.get(), - module_sp->GetSpecificationDescription().c_str(), - m_file.GetPath().c_str(), - m_file_offset, - m_length); - } - else - { - log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), file = <NULL>, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64, - this, - module_sp.get(), - module_sp->GetSpecificationDescription().c_str(), - m_file_offset, - m_length); - } - } + log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), file = %s, file_offset = 0x%8.8" PRIx64 ", size = %" PRIu64, + static_cast<void*>(this), + static_cast<void*>(module_sp.get()), + module_sp->GetSpecificationDescription().c_str(), + m_file ? m_file.GetPath().c_str() : "<NULL>", + m_file_offset, m_length); } @@ -306,14 +293,11 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, m_data.SetData (header_data_sp, 0, header_data_sp->GetByteSize()); Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - { log->Printf ("%p ObjectFile::ObjectFile() module = %p (%s), process = %p, header_addr = 0x%" PRIx64, - this, - module_sp.get(), + static_cast<void*>(this), + static_cast<void*>(module_sp.get()), module_sp->GetSpecificationDescription().c_str(), - process_sp.get(), - m_memory_addr); - } + static_cast<void*>(process_sp.get()), m_memory_addr); } @@ -321,7 +305,8 @@ ObjectFile::~ObjectFile() { Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - log->Printf ("%p ObjectFile::~ObjectFile ()\n", this); + log->Printf ("%p ObjectFile::~ObjectFile ()\n", + static_cast<void*>(this)); } bool @@ -350,9 +335,12 @@ ObjectFile::GetAddressClass (addr_t file_addr) const SectionType section_type = section_sp->GetType(); switch (section_type) { - case eSectionTypeInvalid: return eAddressClassUnknown; - case eSectionTypeCode: return eAddressClassCode; - case eSectionTypeContainer: return eAddressClassUnknown; + case eSectionTypeInvalid: + return eAddressClassUnknown; + case eSectionTypeCode: + return eAddressClassCode; + case eSectionTypeContainer: + return eAddressClassUnknown; case eSectionTypeData: case eSectionTypeDataCString: case eSectionTypeDataCStringPointers: @@ -382,16 +370,18 @@ ObjectFile::GetAddressClass (addr_t file_addr) case eSectionTypeDWARFAppleNamespaces: case eSectionTypeDWARFAppleObjC: return eAddressClassDebug; - case eSectionTypeEHFrame: return eAddressClassRuntime; + case eSectionTypeEHFrame: + return eAddressClassRuntime; case eSectionTypeELFSymbolTable: case eSectionTypeELFDynamicSymbols: case eSectionTypeELFRelocationEntries: case eSectionTypeELFDynamicLinkInfo: - case eSectionTypeOther: return eAddressClassUnknown; + case eSectionTypeOther: + return eAddressClassUnknown; } } } - + const SymbolType symbol_type = symbol->GetType(); switch (symbol_type) { @@ -601,11 +591,9 @@ ObjectFile::ClearSymtab () lldb_private::Mutex::Locker locker(module_sp->GetMutex()); Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) - { log->Printf ("%p ObjectFile::ClearSymtab () symtab = %p", - this, - m_symtab_ap.get()); - } + static_cast<void*>(this), + static_cast<void*>(m_symtab_ap.get())); m_symtab_ap.reset(); } } diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp index b51ac5a550f..bfa560044ab 100644 --- a/lldb/source/Symbol/SymbolVendor.cpp +++ b/lldb/source/Symbol/SymbolVendor.cpp @@ -382,7 +382,7 @@ SymbolVendor::Dump(Stream *s) { bool show_context = false; - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<void*>(this)); s->Indent(); s->PutCString("SymbolVendor"); if (m_sym_file_ap.get()) diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index 073940e8a7f..b38a4506298 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -201,9 +201,9 @@ Type::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name) void Type::Dump (Stream *s, bool show_context) { - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<void*>(this)); s->Indent(); - *s << "Type" << (const UserID&)*this << ' '; + *s << "Type" << static_cast<const UserID&>(*this) << ' '; if (m_name) *s << ", name = \"" << m_name << "\""; diff --git a/lldb/source/Symbol/Variable.cpp b/lldb/source/Symbol/Variable.cpp index 36fe3b1d79d..2314da512a2 100644 --- a/lldb/source/Symbol/Variable.cpp +++ b/lldb/source/Symbol/Variable.cpp @@ -93,7 +93,7 @@ Variable::GetType() void Variable::Dump(Stream *s, bool show_context) const { - s->Printf("%p: ", this); + s->Printf("%p: ", static_cast<const void*>(this)); s->Indent(); *s << "Variable" << (const UserID&)*this; |