forked from OSchip/llvm-project
[codeview] Remove redundant TypeTable lookup
As written, the code should assert if this lookup would have ever succeeded. Without looking through composite types, the type graph should be acyclic. llvm-svn: 280168
This commit is contained in:
parent
36865d6abf
commit
dbaa61cbe3
|
@ -1137,13 +1137,6 @@ TypeIndex CodeViewDebug::lowerTypeBasic(const DIBasicType *Ty) {
|
||||||
TypeIndex CodeViewDebug::lowerTypePointer(const DIDerivedType *Ty) {
|
TypeIndex CodeViewDebug::lowerTypePointer(const DIDerivedType *Ty) {
|
||||||
TypeIndex PointeeTI = getTypeIndex(Ty->getBaseType());
|
TypeIndex PointeeTI = getTypeIndex(Ty->getBaseType());
|
||||||
|
|
||||||
// While processing the type being pointed to it is possible we already
|
|
||||||
// created this pointer type. If so, we check here and return the existing
|
|
||||||
// pointer type.
|
|
||||||
auto I = TypeIndices.find({Ty, nullptr});
|
|
||||||
if (I != TypeIndices.end())
|
|
||||||
return I->second;
|
|
||||||
|
|
||||||
// Pointers to simple types can use SimpleTypeMode, rather than having a
|
// Pointers to simple types can use SimpleTypeMode, rather than having a
|
||||||
// dedicated pointer type record.
|
// dedicated pointer type record.
|
||||||
if (PointeeTI.isSimple() &&
|
if (PointeeTI.isSimple() &&
|
||||||
|
@ -1264,16 +1257,7 @@ TypeIndex CodeViewDebug::lowerTypeModifier(const DIDerivedType *Ty) {
|
||||||
BaseTy = cast<DIDerivedType>(BaseTy)->getBaseType().resolve();
|
BaseTy = cast<DIDerivedType>(BaseTy)->getBaseType().resolve();
|
||||||
}
|
}
|
||||||
TypeIndex ModifiedTI = getTypeIndex(BaseTy);
|
TypeIndex ModifiedTI = getTypeIndex(BaseTy);
|
||||||
|
return TypeTable.writeKnownType(ModifierRecord(ModifiedTI, Mods));
|
||||||
// While processing the type being pointed to, it is possible we already
|
|
||||||
// created this modifier type. If so, we check here and return the existing
|
|
||||||
// modifier type.
|
|
||||||
auto I = TypeIndices.find({Ty, nullptr});
|
|
||||||
if (I != TypeIndices.end())
|
|
||||||
return I->second;
|
|
||||||
|
|
||||||
ModifierRecord MR(ModifiedTI, Mods);
|
|
||||||
return TypeTable.writeKnownType(MR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeIndex CodeViewDebug::lowerTypeFunction(const DISubroutineType *Ty) {
|
TypeIndex CodeViewDebug::lowerTypeFunction(const DISubroutineType *Ty) {
|
||||||
|
|
Loading…
Reference in New Issue