@@ -534,8 +534,12 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
534
534
auto type_def = llvm::dyn_cast<PDBSymbolTypeTypedef>(&type);
535
535
assert (type_def);
536
536
537
+ SymbolFile *symbol_file = m_ast.GetSymbolFile ();
538
+ if (!symbol_file)
539
+ return nullptr ;
540
+
537
541
lldb_private::Type *target_type =
538
- m_ast. GetSymbolFile () ->ResolveTypeUID (type_def->getTypeId ());
542
+ symbol_file ->ResolveTypeUID (type_def->getTypeId ());
539
543
if (!target_type)
540
544
return nullptr ;
541
545
@@ -609,8 +613,13 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
609
613
auto arg = arg_enum->getChildAtIndex (arg_idx);
610
614
if (!arg)
611
615
break ;
616
+
617
+ SymbolFile *symbol_file = m_ast.GetSymbolFile ();
618
+ if (!symbol_file)
619
+ return nullptr ;
620
+
612
621
lldb_private::Type *arg_type =
613
- m_ast. GetSymbolFile () ->ResolveTypeUID (arg->getSymIndexId ());
622
+ symbol_file ->ResolveTypeUID (arg->getSymIndexId ());
614
623
// If there's some error looking up one of the dependent types of this
615
624
// function signature, bail.
616
625
if (!arg_type)
@@ -621,8 +630,12 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
621
630
lldbassert (arg_list.size () <= num_args);
622
631
623
632
auto pdb_return_type = func_sig->getReturnType ();
633
+ SymbolFile *symbol_file = m_ast.GetSymbolFile ();
634
+ if (!symbol_file)
635
+ return nullptr ;
636
+
624
637
lldb_private::Type *return_type =
625
- m_ast. GetSymbolFile () ->ResolveTypeUID (pdb_return_type->getSymIndexId ());
638
+ symbol_file ->ResolveTypeUID (pdb_return_type->getSymIndexId ());
626
639
// If there's some error looking up one of the dependent types of this
627
640
// function signature, bail.
628
641
if (!return_type)
@@ -654,10 +667,13 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
654
667
if (uint64_t size = array_type->getLength ())
655
668
bytes = size;
656
669
670
+ SymbolFile *symbol_file = m_ast.GetSymbolFile ();
671
+ if (!symbol_file)
672
+ return nullptr ;
673
+
657
674
// If array rank > 0, PDB gives the element type at N=0. So element type
658
675
// will parsed in the order N=0, N=1,..., N=rank sequentially.
659
- lldb_private::Type *element_type =
660
- m_ast.GetSymbolFile ()->ResolveTypeUID (element_uid);
676
+ lldb_private::Type *element_type = symbol_file->ResolveTypeUID (element_uid);
661
677
if (!element_type)
662
678
return nullptr ;
663
679
@@ -711,16 +727,20 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
711
727
case PDB_SymType::PointerType: {
712
728
auto *pointer_type = llvm::dyn_cast<PDBSymbolTypePointer>(&type);
713
729
assert (pointer_type);
714
- Type *pointee_type = m_ast.GetSymbolFile ()->ResolveTypeUID (
730
+
731
+ SymbolFile *symbol_file = m_ast.GetSymbolFile ();
732
+ if (!symbol_file)
733
+ return nullptr ;
734
+
735
+ Type *pointee_type = symbol_file->ResolveTypeUID (
715
736
pointer_type->getPointeeType ()->getSymIndexId ());
716
737
if (!pointee_type)
717
738
return nullptr ;
718
739
719
740
if (pointer_type->isPointerToDataMember () ||
720
741
pointer_type->isPointerToMemberFunction ()) {
721
742
auto class_parent_uid = pointer_type->getRawSymbol ().getClassParentId ();
722
- auto class_parent_type =
723
- m_ast.GetSymbolFile ()->ResolveTypeUID (class_parent_uid);
743
+ auto class_parent_type = symbol_file->ResolveTypeUID (class_parent_uid);
724
744
assert (class_parent_type);
725
745
726
746
CompilerType pointer_ast_type;
0 commit comments