[Lldb-commits] [lldb] r327927 - [SymbolFilePDB] Simplify code with newer methods

Aaron Smith via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 19 17:34:19 PDT 2018


Author: asmith
Date: Mon Mar 19 17:34:18 2018
New Revision: 327927

URL: http://llvm.org/viewvc/llvm-project?rev=327927&view=rev
Log:
[SymbolFilePDB] Simplify code with newer methods

Modified:
    lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
    lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=327927&r1=327926&r2=327927&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Mon Mar 19 17:34:18 2018
@@ -438,7 +438,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTyp
     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::CreateLLDBTyp
     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<lldb_private::Type>(

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp?rev=327927&r1=327926&r2=327927&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Mon Mar 19 17:34:18 2018
@@ -742,23 +742,11 @@ bool SymbolFilePDB::ResolveFunction(cons
                                     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<PDBSymbolFunc>(symbol_up.get());
-  assert(func);
-  sc.function = ParseCompileUnitFunctionForPDBFunc(*func, sc);
+  sc.function = ParseCompileUnitFunctionForPDBFunc(pdb_func, sc);
   if (!sc.function)
     return false;
 




More information about the lldb-commits mailing list