Lines Matching defs:Ty
288 if (const auto *Ty = dyn_cast<DICompositeType>(Scope))
289 DeferredCompleteTypes.push_back(Ty);
334 std::string CodeViewDebug::getFullyQualifiedName(const DIScope *Ty) {
335 const DIScope *Scope = Ty->getScope();
336 return getFullyQualifiedName(Scope, getPrettyScopeName(Ty));
424 getFunctionOptions(const DISubroutineType *Ty,
429 if (auto TypeArray = Ty->getTypeArray()) {
1632 void CodeViewDebug::addToUDTs(const DIType *Ty) {
1634 if (Ty->getName().empty())
1636 if (!shouldEmitUdt(Ty))
1641 collectParentScopeNames(Ty->getScope(), ParentScopeNames);
1644 formatNestedName(ParentScopeNames, getPrettyScopeName(Ty));
1647 GlobalUDTs.emplace_back(std::move(FullyQualifiedName), Ty);
1649 LocalUDTs.emplace_back(std::move(FullyQualifiedName), Ty);
1660 TypeIndex CodeViewDebug::lowerType(const DIType *Ty, const DIType *ClassTy) {
1662 switch (Ty->getTag()) {
1664 return lowerTypeArray(cast<DICompositeType>(Ty));
1666 return lowerTypeAlias(cast<DIDerivedType>(Ty));
1668 return lowerTypeBasic(cast<DIBasicType>(Ty));
1670 if (cast<DIDerivedType>(Ty)->getName() == "__vtbl_ptr_type")
1671 return lowerTypeVFTableShape(cast<DIDerivedType>(Ty));
1675 return lowerTypePointer(cast<DIDerivedType>(Ty));
1677 return lowerTypeMemberPointer(cast<DIDerivedType>(Ty));
1682 return lowerTypeModifier(cast<DIDerivedType>(Ty));
1687 return lowerTypeMemberFunction(cast<DISubroutineType>(Ty), ClassTy,
1691 return lowerTypeFunction(cast<DISubroutineType>(Ty));
1693 return lowerTypeEnum(cast<DICompositeType>(Ty));
1696 return lowerTypeClass(cast<DICompositeType>(Ty));
1698 return lowerTypeUnion(cast<DICompositeType>(Ty));
1700 return lowerTypeString(cast<DIStringType>(Ty));
1702 if (Ty->getName() == "decltype(nullptr)")
1711 TypeIndex CodeViewDebug::lowerTypeAlias(const DIDerivedType *Ty) {
1712 TypeIndex UnderlyingTypeIndex = getTypeIndex(Ty->getBaseType());
1713 StringRef TypeName = Ty->getName();
1715 addToUDTs(Ty);
1727 TypeIndex CodeViewDebug::lowerTypeArray(const DICompositeType *Ty) {
1728 const DIType *ElementType = Ty->getBaseType();
1738 DINodeArray Elements = Ty->getElements();
1774 (i == 0 && ElementSize == 0) ? Ty->getSizeInBits() / 8 : ElementSize;
1776 StringRef Name = (i == 0) ? Ty->getName() : "";
1789 TypeIndex CodeViewDebug::lowerTypeString(const DIStringType *Ty) {
1791 uint64_t ArraySize = Ty->getSizeInBits() >> 3;
1792 StringRef Name = Ty->getName();
1804 TypeIndex CodeViewDebug::lowerTypeBasic(const DIBasicType *Ty) {
1809 Kind = static_cast<dwarf::TypeKind>(Ty->getEncoding());
1810 ByteSize = Ty->getSizeInBits() / 8;
1889 (Ty->getName() == "long int" || Ty->getName() == "long"))
1891 if (STK == SimpleTypeKind::UInt32 && (Ty->getName() == "long unsigned int" ||
1892 Ty->getName() == "unsigned long"))
1895 (Ty->getName() == "wchar_t" || Ty->getName() == "__wchar_t"))
1899 Ty->getName() == "char")
1905 TypeIndex CodeViewDebug::lowerTypePointer(const DIDerivedType *Ty,
1907 TypeIndex PointeeTI = getTypeIndex(Ty->getBaseType());
1913 Ty->getTag() == dwarf::DW_TAG_pointer_type) {
1914 SimpleTypeMode Mode = Ty->getSizeInBits() == 64
1921 Ty->getSizeInBits() == 64 ? PointerKind::Near64 : PointerKind::Near32;
1923 switch (Ty->getTag()) {
1936 if (Ty->isObjectPointer())
1939 PointerRecord PR(PointeeTI, PK, PM, PO, Ty->getSizeInBits() / 8);
1976 TypeIndex CodeViewDebug::lowerTypeMemberPointer(const DIDerivedType *Ty,
1978 assert(Ty->getTag() == dwarf::DW_TAG_ptr_to_member_type);
1979 bool IsPMF = isa<DISubroutineType>(Ty->getBaseType());
1980 TypeIndex ClassTI = getTypeIndex(Ty->getClassType());
1982 getTypeIndex(Ty->getBaseType(), IsPMF ? Ty->getClassType() : nullptr);
1988 assert(Ty->getSizeInBits() / 8 <= 0xff && "pointer size too big");
1989 uint8_t SizeInBytes = Ty->getSizeInBits() / 8;
1991 ClassTI, translatePtrToMemberRep(SizeInBytes, IsPMF, Ty->getFlags()));
2010 TypeIndex CodeViewDebug::lowerTypeModifier(const DIDerivedType *Ty) {
2014 const DIType *BaseTy = Ty;
2067 TypeIndex CodeViewDebug::lowerTypeFunction(const DISubroutineType *Ty) {
2069 for (const DIType *ArgType : Ty->getTypeArray())
2088 CallingConvention CC = dwarfCCToCodeView(Ty->getCC());
2090 FunctionOptions FO = getFunctionOptions(Ty);
2096 TypeIndex CodeViewDebug::lowerTypeMemberFunction(const DISubroutineType *Ty,
2104 DITypeRefArray ReturnAndArgs = Ty->getTypeArray();
2121 ThisTypeIndex = getTypeIndexForThisPtr(PtrTy, Ty);
2137 CallingConvention CC = dwarfCCToCodeView(Ty->getCC());
2144 TypeIndex CodeViewDebug::lowerTypeVFTableShape(const DIDerivedType *Ty) {
2146 Ty->getSizeInBits() / (8 * Asm->MAI->getCodePointerSize());
2195 static TypeRecordKind getRecordKind(const DICompositeType *Ty) {
2196 switch (Ty->getTag()) {
2208 static ClassOptions getCommonClassOptions(const DICompositeType *Ty) {
2214 if (!Ty->getIdentifier().empty())
2220 const DIScope *ImmediateScope = Ty->getScope();
2228 if (Ty->getTag() == dwarf::DW_TAG_enumeration_type) {
2244 void CodeViewDebug::addUDTSrcLine(const DIType *Ty, TypeIndex TI) {
2245 switch (Ty->getTag()) {
2255 if (const auto *File = Ty->getFile()) {
2259 UdtSourceLineRecord USLR(TI, SIDI, Ty->getLine());
2264 TypeIndex CodeViewDebug::lowerTypeEnum(const DICompositeType *Ty) {
2265 ClassOptions CO = getCommonClassOptions(Ty);
2269 if (Ty->isForwardDecl()) {
2274 for (const DINode *Element : Ty->getElements()) {
2289 std::string FullName = getFullyQualifiedName(Ty);
2291 EnumRecord ER(EnumeratorCount, CO, FTI, FullName, Ty->getIdentifier(),
2292 getTypeIndex(Ty->getBaseType()));
2295 addUDTSrcLine(Ty, EnumTI);
2364 const DIType *Ty = DDTy->getBaseType();
2367 switch (Ty->getTag()) {
2372 Ty = cast<DIDerivedType>(Ty)->getBaseType();
2380 const DICompositeType *DCTy = dyn_cast<DICompositeType>(Ty);
2390 ClassInfo CodeViewDebug::collectClassInfo(const DICompositeType *Ty) {
2393 DINodeArray Elements = Ty->getElements();
2423 static bool shouldAlwaysEmitCompleteClassType(const DICompositeType *Ty) {
2426 return Ty->getName().empty() && Ty->getIdentifier().empty() &&
2427 !Ty->isForwardDecl();
2430 TypeIndex CodeViewDebug::lowerTypeClass(const DICompositeType *Ty) {
2435 if (shouldAlwaysEmitCompleteClassType(Ty)) {
2439 auto I = CompleteTypeIndices.find(Ty);
2442 return getCompleteTypeIndex(Ty);
2445 // First, construct the forward decl. Don't look into Ty to compute the
2447 TypeRecordKind Kind = getRecordKind(Ty);
2449 ClassOptions::ForwardReference | getCommonClassOptions(Ty);
2450 std::string FullName = getFullyQualifiedName(Ty);
2452 FullName, Ty->getIdentifier());
2454 if (!Ty->isForwardDecl())
2455 DeferredCompleteTypes.push_back(Ty);
2459 TypeIndex CodeViewDebug::lowerCompleteTypeClass(const DICompositeType *Ty) {
2461 TypeRecordKind Kind = getRecordKind(Ty);
2462 ClassOptions CO = getCommonClassOptions(Ty);
2468 lowerRecordFieldList(Ty);
2478 if (isNonTrivial(Ty))
2481 std::string FullName = getFullyQualifiedName(Ty);
2483 uint64_t SizeInBytes = Ty->getSizeInBits() / 8;
2486 SizeInBytes, FullName, Ty->getIdentifier());
2489 addUDTSrcLine(Ty, ClassTI);
2491 addToUDTs(Ty);
2496 TypeIndex CodeViewDebug::lowerTypeUnion(const DICompositeType *Ty) {
2498 if (shouldAlwaysEmitCompleteClassType(Ty))
2499 return getCompleteTypeIndex(Ty);
2502 ClassOptions::ForwardReference | getCommonClassOptions(Ty);
2503 std::string FullName = getFullyQualifiedName(Ty);
2504 UnionRecord UR(0, CO, TypeIndex(), 0, FullName, Ty->getIdentifier());
2506 if (!Ty->isForwardDecl())
2507 DeferredCompleteTypes.push_back(Ty);
2511 TypeIndex CodeViewDebug::lowerCompleteTypeUnion(const DICompositeType *Ty) {
2512 ClassOptions CO = ClassOptions::Sealed | getCommonClassOptions(Ty);
2517 lowerRecordFieldList(Ty);
2522 uint64_t SizeInBytes = Ty->getSizeInBits() / 8;
2523 std::string FullName = getFullyQualifiedName(Ty);
2526 Ty->getIdentifier());
2529 addUDTSrcLine(Ty, UnionTI);
2531 addToUDTs(Ty);
2537 CodeViewDebug::lowerRecordFieldList(const DICompositeType *Ty) {
2543 ClassInfo Info = collectClassInfo(Ty);
2558 RecordKind, translateAccessFlags(Ty->getTag(), I->getFlags()),
2567 BaseClassRecord BCR(translateAccessFlags(Ty->getTag(), I->getFlags()),
2581 translateAccessFlags(Ty->getTag(), Member->getFlags());
2626 TypeIndex MethodType = getMemberFunctionType(SP, Ty);
2634 MethodType, translateAccessFlags(Ty->getTag(), SP->getFlags()),
2682 TypeIndex CodeViewDebug::getTypeIndex(const DIType *Ty, const DIType *ClassTy) {
2684 if (!Ty)
2690 auto I = TypeIndices.find({Ty, ClassTy});
2695 TypeIndex TI = lowerType(Ty, ClassTy);
2696 return recordTypeIndexForDINode(Ty, TI, ClassTy);
2725 TypeIndex CodeViewDebug::getTypeIndexForReferenceTo(const DIType *Ty) {
2726 PointerRecord PR(getTypeIndex(Ty),
2730 Ty->getSizeInBits() / 8);
2734 TypeIndex CodeViewDebug::getCompleteTypeIndex(const DIType *Ty) {
2736 if (!Ty)
2742 if (Ty->getTag() == dwarf::DW_TAG_typedef)
2743 (void)getTypeIndex(Ty);
2744 while (Ty->getTag() == dwarf::DW_TAG_typedef)
2745 Ty = cast<DIDerivedType>(Ty)->getBaseType();
2749 switch (Ty->getTag()) {
2755 return getTypeIndex(Ty);
2758 const auto *CTy = cast<DICompositeType>(Ty);
2837 const DIType *Ty = L.DIVar->getType();
2839 emitConstantSymbolRecord(Ty, Val, std::string(L.DIVar->getName()));
3334 for (auto *Ty : cast<DICompileUnit>(Node)->getRetainedTypes()) {
3335 if (DIType *RT = dyn_cast<DIType>(Ty)) {
3392 static bool isFloatDIType(const DIType *Ty) {
3393 if (isa<DICompositeType>(Ty))
3396 if (auto *DTy = dyn_cast<DIDerivedType>(Ty)) {
3397 dwarf::Tag T = (dwarf::Tag)Ty->getTag();
3407 auto *BTy = cast<DIBasicType>(Ty);