[SymbolFilePDB] Simplify code with newer methods


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@327927 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
index e26d46d..fc066c2 100644
--- a/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ b/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -438,7 +438,7 @@
     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 @@
     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>(
diff --git a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
index cdd5fa1..160d512 100644
--- a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -742,23 +742,11 @@
                                     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;