@@ -633,21 +633,26 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
633
633
634
634
void DwarfUnit::updateAcceleratorTables (const DIScope *Context,
635
635
const DIType *Ty, const DIE &TyDIE) {
636
- if (!Ty->getName ().empty () && !Ty->isForwardDecl ()) {
637
- bool IsImplementation = false ;
638
- if (auto *CT = dyn_cast<DICompositeType>(Ty)) {
639
- // A runtime language of 0 actually means C/C++ and that any
640
- // non-negative value is some version of Objective-C/C++.
641
- IsImplementation = CT->getRuntimeLang () == 0 || CT->isObjcClassComplete ();
642
- }
643
- unsigned Flags = IsImplementation ? dwarf::DW_FLAG_type_implementation : 0 ;
644
- DD->addAccelType (*this , CUNode->getNameTableKind (), Ty->getName (), TyDIE,
645
- Flags);
636
+ if (Ty->getName ().empty ())
637
+ return ;
638
+ if (Ty->isForwardDecl ())
639
+ return ;
646
640
647
- if (!Context || isa<DICompileUnit>(Context) || isa<DIFile>(Context) ||
648
- isa<DINamespace>(Context) || isa<DICommonBlock>(Context))
649
- addGlobalType (Ty, TyDIE, Context);
641
+ // add temporary record for this type to be added later
642
+
643
+ bool IsImplementation = false ;
644
+ if (auto *CT = dyn_cast<DICompositeType>(Ty)) {
645
+ // A runtime language of 0 actually means C/C++ and that any
646
+ // non-negative value is some version of Objective-C/C++.
647
+ IsImplementation = CT->getRuntimeLang () == 0 || CT->isObjcClassComplete ();
650
648
}
649
+ unsigned Flags = IsImplementation ? dwarf::DW_FLAG_type_implementation : 0 ;
650
+ DD->addAccelType (*this , CUNode->getNameTableKind (), Ty->getName (), TyDIE,
651
+ Flags);
652
+
653
+ if (!Context || isa<DICompileUnit>(Context) || isa<DIFile>(Context) ||
654
+ isa<DINamespace>(Context) || isa<DICommonBlock>(Context))
655
+ addGlobalType (Ty, TyDIE, Context);
651
656
}
652
657
653
658
void DwarfUnit::addType (DIE &Entity, const DIType *Ty,
0 commit comments