From d5a925f42bd8ec752f148ef69baf3f8cc5075986 Mon Sep 17 00:00:00 2001 From: Aaron Smith Date: Thu, 22 Mar 2018 19:21:34 +0000 Subject: [PATCH] [SymbolFilePDB] Ignore compiler generated functions when creating the LLDB type from a PDB llvm-svn: 328230 --- lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp | 3 +++ lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp index 9fd5f7d..e9d10d0 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp @@ -312,6 +312,9 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) { std::string name; PDBSymbolTypeFunctionSig *func_sig = nullptr; if (auto pdb_func = llvm::dyn_cast(&type)) { + if (pdb_func->isCompilerGenerated()) + return nullptr; + auto sig = pdb_func->getSignature(); if (!sig) return nullptr; diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index 915a4ff..c958d0c 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -130,7 +130,7 @@ uint32_t SymbolFilePDB::CalculateAbilities() { } } } - if (!m_session_up.get()) + if (!m_session_up) return 0; auto enum_tables_up = m_session_up->getEnumTables(); @@ -507,7 +507,7 @@ lldb_private::Type *SymbolFilePDB::ResolveTypeUID(lldb::user_id_t type_uid) { return nullptr; lldb::TypeSP result = pdb->CreateLLDBTypeFromPDBType(*pdb_type); - if (result.get()) { + if (result) { m_types.insert(std::make_pair(type_uid, result)); auto type_list = GetTypeList(); if (type_list) @@ -637,7 +637,7 @@ uint32_t SymbolFilePDB::ResolveSymbolContext( SymbolContext sc; auto cu = ParseCompileUnitForUID(compiland->getSymIndexId()); - if (!cu.get()) + if (!cu) continue; sc.comp_unit = cu.get(); sc.module_sp = cu->GetModule(); @@ -1132,7 +1132,7 @@ size_t SymbolFilePDB::GetTypes(lldb_private::SymbolContextScope *sc_scope, } else { for (uint32_t cu_idx = 0; cu_idx < GetNumCompileUnits(); ++cu_idx) { auto cu_sp = ParseCompileUnitAtIndex(cu_idx); - if (cu_sp.get()) { + if (cu_sp) { if (auto compiland_up = GetPDBCompilandByUID(cu_sp->GetID())) GetTypesForPDBSymbol(*compiland_up, type_mask, type_collection); } -- 2.7.4