From a3a8cc80b3a8029ad93a7ec2a3da7b7bd31f56ac Mon Sep 17 00:00:00 2001 From: Aaron Smith Date: Tue, 20 Mar 2018 00:34:18 +0000 Subject: [PATCH] [SymbolFilePDB] Simplify code with newer methods llvm-svn: 327927 --- .../Plugins/SymbolFile/PDB/PDBASTParser.cpp | 4 ++-- .../Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 16 ++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp index e26d46df46b2..fc066c2bc339 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp @@ -438,7 +438,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) { pointer_ast_type = pointee_type->GetFullCompilerType(); if (pointer_type->isReference()) pointer_ast_type = pointer_ast_type.GetLValueReferenceType(); - else if (pointer_type->getRawSymbol().isRValueReference()) + else if (pointer_type->isRValueReference()) pointer_ast_type = pointer_ast_type.GetRValueReferenceType(); else pointer_ast_type = pointer_ast_type.GetPointerType(); @@ -449,7 +449,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) { if (pointer_type->isVolatileType()) pointer_ast_type = pointer_ast_type.AddVolatileModifier(); - if (pointer_type->getRawSymbol().isRestrictedType()) + if (pointer_type->isRestrictedType()) pointer_ast_type = pointer_ast_type.AddRestrictModifier(); return std::make_shared( diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index cdd5fa1f73ad..160d512cc225 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -742,23 +742,11 @@ bool SymbolFilePDB::ResolveFunction(const llvm::pdb::PDBSymbolFunc &pdb_func, bool include_inlines, lldb_private::SymbolContextList &sc_list) { lldb_private::SymbolContext sc; - auto file_vm_addr = pdb_func.getVirtualAddress(); - if (file_vm_addr == LLDB_INVALID_ADDRESS) - return false; - - Address so_addr(file_vm_addr); - sc.comp_unit = GetCompileUnitContainsAddress(so_addr).get(); + sc.comp_unit = ParseCompileUnitForUID(pdb_func.getCompilandId()).get(); if (!sc.comp_unit) return false; sc.module_sp = sc.comp_unit->GetModule(); - auto symbol_up = - m_session_up->findSymbolByAddress(file_vm_addr, PDB_SymType::Function); - if (!symbol_up) - return false; - - auto *func = llvm::dyn_cast(symbol_up.get()); - assert(func); - sc.function = ParseCompileUnitFunctionForPDBFunc(*func, sc); + sc.function = ParseCompileUnitFunctionForPDBFunc(pdb_func, sc); if (!sc.function) return false;