Lines Matching refs:Ty

286     if (const auto *Ty = dyn_cast<DICompositeType>(Scope))  in collectParentScopeNames()  local
287 DeferredCompleteTypes.push_back(Ty); in collectParentScopeNames()
332 std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Ty) { in getFullyQualifiedName() argument
333 const DIScope *Scope = Ty->getScope(); in getFullyQualifiedName()
334 return getFullyQualifiedName(Scope, getPrettyScopeName(Ty)); in getFullyQualifiedName()
422 getFunctionOptions(const DISubroutineType *Ty, in getFunctionOptions() argument
427 if (auto TypeArray = Ty->getTypeArray()) { in getFunctionOptions()
1583 void CodeViewDebug::addToUDTs(const DIType *Ty) { in addToUDTs() argument
1585 if (Ty->getName().empty()) in addToUDTs()
1587 if (!shouldEmitUdt(Ty)) in addToUDTs()
1592 collectParentScopeNames(Ty->getScope(), ParentScopeNames); in addToUDTs()
1595 formatNestedName(ParentScopeNames, getPrettyScopeName(Ty)); in addToUDTs()
1598 GlobalUDTs.emplace_back(std::move(FullyQualifiedName), Ty); in addToUDTs()
1600 LocalUDTs.emplace_back(std::move(FullyQualifiedName), Ty); in addToUDTs()
1611 TypeIndex CodeViewDebug::lowerType(const DIType *Ty, const DIType *ClassTy) { in lowerType() argument
1613 switch (Ty->getTag()) { in lowerType()
1615 return lowerTypeArray(cast<DICompositeType>(Ty)); in lowerType()
1617 return lowerTypeAlias(cast<DIDerivedType>(Ty)); in lowerType()
1619 return lowerTypeBasic(cast<DIBasicType>(Ty)); in lowerType()
1621 if (cast<DIDerivedType>(Ty)->getName() == "__vtbl_ptr_type") in lowerType()
1622 return lowerTypeVFTableShape(cast<DIDerivedType>(Ty)); in lowerType()
1626 return lowerTypePointer(cast<DIDerivedType>(Ty)); in lowerType()
1628 return lowerTypeMemberPointer(cast<DIDerivedType>(Ty)); in lowerType()
1633 return lowerTypeModifier(cast<DIDerivedType>(Ty)); in lowerType()
1638 return lowerTypeMemberFunction(cast<DISubroutineType>(Ty), ClassTy, in lowerType()
1642 return lowerTypeFunction(cast<DISubroutineType>(Ty)); in lowerType()
1644 return lowerTypeEnum(cast<DICompositeType>(Ty)); in lowerType()
1647 return lowerTypeClass(cast<DICompositeType>(Ty)); in lowerType()
1649 return lowerTypeUnion(cast<DICompositeType>(Ty)); in lowerType()
1651 return lowerTypeString(cast<DIStringType>(Ty)); in lowerType()
1653 if (Ty->getName() == "decltype(nullptr)") in lowerType()
1662 TypeIndex CodeViewDebug::lowerTypeAlias(const DIDerivedType *Ty) { in lowerTypeAlias() argument
1663 TypeIndex UnderlyingTypeIndex = getTypeIndex(Ty->getBaseType()); in lowerTypeAlias()
1664 StringRef TypeName = Ty->getName(); in lowerTypeAlias()
1666 addToUDTs(Ty); in lowerTypeAlias()
1678 TypeIndex CodeViewDebug::lowerTypeArray(const DICompositeType *Ty) { in lowerTypeArray() argument
1679 const DIType *ElementType = Ty->getBaseType(); in lowerTypeArray()
1689 DINodeArray Elements = Ty->getElements(); in lowerTypeArray()
1724 (i == 0 && ElementSize == 0) ? Ty->getSizeInBits() / 8 : ElementSize; in lowerTypeArray()
1726 StringRef Name = (i == 0) ? Ty->getName() : ""; in lowerTypeArray()
1739 TypeIndex CodeViewDebug::lowerTypeString(const DIStringType *Ty) { in lowerTypeString() argument
1741 uint64_t ArraySize = Ty->getSizeInBits() >> 3; in lowerTypeString()
1742 StringRef Name = Ty->getName(); in lowerTypeString()
1754 TypeIndex CodeViewDebug::lowerTypeBasic(const DIBasicType *Ty) { in lowerTypeBasic() argument
1759 Kind = static_cast<dwarf::TypeKind>(Ty->getEncoding()); in lowerTypeBasic()
1760 ByteSize = Ty->getSizeInBits() / 8; in lowerTypeBasic()
1837 (Ty->getName() == "long int" || Ty->getName() == "long")) in lowerTypeBasic()
1839 if (STK == SimpleTypeKind::UInt32 && (Ty->getName() == "long unsigned int" || in lowerTypeBasic()
1840 Ty->getName() == "unsigned long")) in lowerTypeBasic()
1843 (Ty->getName() == "wchar_t" || Ty->getName() == "__wchar_t")) in lowerTypeBasic()
1847 Ty->getName() == "char") in lowerTypeBasic()
1853 TypeIndex CodeViewDebug::lowerTypePointer(const DIDerivedType *Ty, in lowerTypePointer() argument
1855 TypeIndex PointeeTI = getTypeIndex(Ty->getBaseType()); in lowerTypePointer()
1861 Ty->getTag() == dwarf::DW_TAG_pointer_type) { in lowerTypePointer()
1862 SimpleTypeMode Mode = Ty->getSizeInBits() == 64 in lowerTypePointer()
1869 Ty->getSizeInBits() == 64 ? PointerKind::Near64 : PointerKind::Near32; in lowerTypePointer()
1871 switch (Ty->getTag()) { in lowerTypePointer()
1884 if (Ty->isObjectPointer()) in lowerTypePointer()
1887 PointerRecord PR(PointeeTI, PK, PM, PO, Ty->getSizeInBits() / 8); in lowerTypePointer()
1924 TypeIndex CodeViewDebug::lowerTypeMemberPointer(const DIDerivedType *Ty, in lowerTypeMemberPointer() argument
1926 assert(Ty->getTag() == dwarf::DW_TAG_ptr_to_member_type); in lowerTypeMemberPointer()
1927 bool IsPMF = isa<DISubroutineType>(Ty->getBaseType()); in lowerTypeMemberPointer()
1928 TypeIndex ClassTI = getTypeIndex(Ty->getClassType()); in lowerTypeMemberPointer()
1930 getTypeIndex(Ty->getBaseType(), IsPMF ? Ty->getClassType() : nullptr); in lowerTypeMemberPointer()
1936 assert(Ty->getSizeInBits() / 8 <= 0xff && "pointer size too big"); in lowerTypeMemberPointer()
1937 uint8_t SizeInBytes = Ty->getSizeInBits() / 8; in lowerTypeMemberPointer()
1939 ClassTI, translatePtrToMemberRep(SizeInBytes, IsPMF, Ty->getFlags())); in lowerTypeMemberPointer()
1958 TypeIndex CodeViewDebug::lowerTypeModifier(const DIDerivedType *Ty) { in lowerTypeModifier() argument
1962 const DIType *BaseTy = Ty; in lowerTypeModifier()
2015 TypeIndex CodeViewDebug::lowerTypeFunction(const DISubroutineType *Ty) { in lowerTypeFunction() argument
2017 for (const DIType *ArgType : Ty->getTypeArray()) in lowerTypeFunction()
2036 CallingConvention CC = dwarfCCToCodeView(Ty->getCC()); in lowerTypeFunction()
2038 FunctionOptions FO = getFunctionOptions(Ty); in lowerTypeFunction()
2044 TypeIndex CodeViewDebug::lowerTypeMemberFunction(const DISubroutineType *Ty, in lowerTypeMemberFunction() argument
2052 DITypeRefArray ReturnAndArgs = Ty->getTypeArray(); in lowerTypeMemberFunction()
2069 ThisTypeIndex = getTypeIndexForThisPtr(PtrTy, Ty); in lowerTypeMemberFunction()
2085 CallingConvention CC = dwarfCCToCodeView(Ty->getCC()); in lowerTypeMemberFunction()
2092 TypeIndex CodeViewDebug::lowerTypeVFTableShape(const DIDerivedType *Ty) { in lowerTypeVFTableShape() argument
2094 Ty->getSizeInBits() / (8 * Asm->MAI->getCodePointerSize()); in lowerTypeVFTableShape()
2143 static TypeRecordKind getRecordKind(const DICompositeType *Ty) { in getRecordKind() argument
2144 switch (Ty->getTag()) { in getRecordKind()
2156 static ClassOptions getCommonClassOptions(const DICompositeType *Ty) { in getCommonClassOptions() argument
2162 if (!Ty->getIdentifier().empty()) in getCommonClassOptions()
2168 const DIScope *ImmediateScope = Ty->getScope(); in getCommonClassOptions()
2176 if (Ty->getTag() == dwarf::DW_TAG_enumeration_type) { in getCommonClassOptions()
2192 void CodeViewDebug::addUDTSrcLine(const DIType *Ty, TypeIndex TI) { in addUDTSrcLine() argument
2193 switch (Ty->getTag()) { in addUDTSrcLine()
2203 if (const auto *File = Ty->getFile()) { in addUDTSrcLine()
2207 UdtSourceLineRecord USLR(TI, SIDI, Ty->getLine()); in addUDTSrcLine()
2212 TypeIndex CodeViewDebug::lowerTypeEnum(const DICompositeType *Ty) { in lowerTypeEnum() argument
2213 ClassOptions CO = getCommonClassOptions(Ty); in lowerTypeEnum()
2217 if (Ty->isForwardDecl()) { in lowerTypeEnum()
2222 for (const DINode *Element : Ty->getElements()) { in lowerTypeEnum()
2237 std::string FullName = getFullyQualifiedName(Ty); in lowerTypeEnum()
2239 EnumRecord ER(EnumeratorCount, CO, FTI, FullName, Ty->getIdentifier(), in lowerTypeEnum()
2240 getTypeIndex(Ty->getBaseType())); in lowerTypeEnum()
2243 addUDTSrcLine(Ty, EnumTI); in lowerTypeEnum()
2312 const DIType *Ty = DDTy->getBaseType(); in collectMemberInfo() local
2315 switch (Ty->getTag()) { in collectMemberInfo()
2320 Ty = cast<DIDerivedType>(Ty)->getBaseType(); in collectMemberInfo()
2328 const DICompositeType *DCTy = dyn_cast<DICompositeType>(Ty); in collectMemberInfo()
2338 ClassInfo CodeViewDebug::collectClassInfo(const DICompositeType *Ty) { in collectClassInfo() argument
2341 DINodeArray Elements = Ty->getElements(); in collectClassInfo()
2371 static bool shouldAlwaysEmitCompleteClassType(const DICompositeType *Ty) { in shouldAlwaysEmitCompleteClassType() argument
2374 return Ty->getName().empty() && Ty->getIdentifier().empty() && in shouldAlwaysEmitCompleteClassType()
2375 !Ty->isForwardDecl(); in shouldAlwaysEmitCompleteClassType()
2378 TypeIndex CodeViewDebug::lowerTypeClass(const DICompositeType *Ty) { in lowerTypeClass() argument
2383 if (shouldAlwaysEmitCompleteClassType(Ty)) { in lowerTypeClass()
2387 auto I = CompleteTypeIndices.find(Ty); in lowerTypeClass()
2390 return getCompleteTypeIndex(Ty); in lowerTypeClass()
2395 TypeRecordKind Kind = getRecordKind(Ty); in lowerTypeClass()
2397 ClassOptions::ForwardReference | getCommonClassOptions(Ty); in lowerTypeClass()
2398 std::string FullName = getFullyQualifiedName(Ty); in lowerTypeClass()
2400 FullName, Ty->getIdentifier()); in lowerTypeClass()
2402 if (!Ty->isForwardDecl()) in lowerTypeClass()
2403 DeferredCompleteTypes.push_back(Ty); in lowerTypeClass()
2407 TypeIndex CodeViewDebug::lowerCompleteTypeClass(const DICompositeType *Ty) { in lowerCompleteTypeClass() argument
2409 TypeRecordKind Kind = getRecordKind(Ty); in lowerCompleteTypeClass()
2410 ClassOptions CO = getCommonClassOptions(Ty); in lowerCompleteTypeClass()
2416 lowerRecordFieldList(Ty); in lowerCompleteTypeClass()
2426 if (isNonTrivial(Ty)) in lowerCompleteTypeClass()
2429 std::string FullName = getFullyQualifiedName(Ty); in lowerCompleteTypeClass()
2431 uint64_t SizeInBytes = Ty->getSizeInBits() / 8; in lowerCompleteTypeClass()
2434 SizeInBytes, FullName, Ty->getIdentifier()); in lowerCompleteTypeClass()
2437 addUDTSrcLine(Ty, ClassTI); in lowerCompleteTypeClass()
2439 addToUDTs(Ty); in lowerCompleteTypeClass()
2444 TypeIndex CodeViewDebug::lowerTypeUnion(const DICompositeType *Ty) { in lowerTypeUnion() argument
2446 if (shouldAlwaysEmitCompleteClassType(Ty)) in lowerTypeUnion()
2447 return getCompleteTypeIndex(Ty); in lowerTypeUnion()
2450 ClassOptions::ForwardReference | getCommonClassOptions(Ty); in lowerTypeUnion()
2451 std::string FullName = getFullyQualifiedName(Ty); in lowerTypeUnion()
2452 UnionRecord UR(0, CO, TypeIndex(), 0, FullName, Ty->getIdentifier()); in lowerTypeUnion()
2454 if (!Ty->isForwardDecl()) in lowerTypeUnion()
2455 DeferredCompleteTypes.push_back(Ty); in lowerTypeUnion()
2459 TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) { in lowerCompleteTypeUnion() argument
2460 ClassOptions CO = ClassOptions::Sealed | getCommonClassOptions(Ty); in lowerCompleteTypeUnion()
2465 lowerRecordFieldList(Ty); in lowerCompleteTypeUnion()
2470 uint64_t SizeInBytes = Ty->getSizeInBits() / 8; in lowerCompleteTypeUnion()
2471 std::string FullName = getFullyQualifiedName(Ty); in lowerCompleteTypeUnion()
2474 Ty->getIdentifier()); in lowerCompleteTypeUnion()
2477 addUDTSrcLine(Ty, UnionTI); in lowerCompleteTypeUnion()
2479 addToUDTs(Ty); in lowerCompleteTypeUnion()
2485 CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) { in lowerRecordFieldList() argument
2491 ClassInfo Info = collectClassInfo(Ty); in lowerRecordFieldList()
2506 RecordKind, translateAccessFlags(Ty->getTag(), I->getFlags()), in lowerRecordFieldList()
2515 BaseClassRecord BCR(translateAccessFlags(Ty->getTag(), I->getFlags()), in lowerRecordFieldList()
2529 translateAccessFlags(Ty->getTag(), Member->getFlags()); in lowerRecordFieldList()
2574 TypeIndex MethodType = getMemberFunctionType(SP, Ty); in lowerRecordFieldList()
2582 MethodType, translateAccessFlags(Ty->getTag(), SP->getFlags()), in lowerRecordFieldList()
2630 TypeIndex CodeViewDebug::getTypeIndex(const DIType *Ty, const DIType *ClassTy) { in getTypeIndex() argument
2632 if (!Ty) in getTypeIndex()
2638 auto I = TypeIndices.find({Ty, ClassTy}); in getTypeIndex()
2643 TypeIndex TI = lowerType(Ty, ClassTy); in getTypeIndex()
2644 return recordTypeIndexForDINode(Ty, TI, ClassTy); in getTypeIndex()
2673 TypeIndex CodeViewDebug::getTypeIndexForReferenceTo(const DIType *Ty) { in getTypeIndexForReferenceTo() argument
2674 PointerRecord PR(getTypeIndex(Ty), in getTypeIndexForReferenceTo()
2678 Ty->getSizeInBits() / 8); in getTypeIndexForReferenceTo()
2682 TypeIndex CodeViewDebug::getCompleteTypeIndex(const DIType *Ty) { in getCompleteTypeIndex() argument
2684 if (!Ty) in getCompleteTypeIndex()
2690 if (Ty->getTag() == dwarf::DW_TAG_typedef) in getCompleteTypeIndex()
2691 (void)getTypeIndex(Ty); in getCompleteTypeIndex()
2692 while (Ty->getTag() == dwarf::DW_TAG_typedef) in getCompleteTypeIndex()
2693 Ty = cast<DIDerivedType>(Ty)->getBaseType(); in getCompleteTypeIndex()
2697 switch (Ty->getTag()) { in getCompleteTypeIndex()
2703 return getTypeIndex(Ty); in getCompleteTypeIndex()
2706 const auto *CTy = cast<DICompositeType>(Ty); in getCompleteTypeIndex()
3268 for (auto *Ty : cast<DICompileUnit>(Node)->getRetainedTypes()) { in emitDebugInfoForRetainedTypes() local
3269 if (DIType *RT = dyn_cast<DIType>(Ty)) { in emitDebugInfoForRetainedTypes()
3326 static bool isFloatDIType(const DIType *Ty) { in isFloatDIType() argument
3327 if (isa<DICompositeType>(Ty)) in isFloatDIType()
3330 if (auto *DTy = dyn_cast<DIDerivedType>(Ty)) { in isFloatDIType()
3331 dwarf::Tag T = (dwarf::Tag)Ty->getTag(); in isFloatDIType()
3341 auto *BTy = cast<DIBasicType>(Ty); in isFloatDIType()