[Coroutines] Support opaque pointers in solveTypeName()

As far as I can tell, these names are only intended to be
informative, so just use a generic "PointerType" for opaque pointers.

The code in solveDIType() also treats pointers as basic types (and
does not try to encode the pointed-to type further), so I believe
this should be fine.

Differential Revision: https://reviews.llvm.org/D121280
This commit is contained in:
Nikita Popov 2022-03-04 13:25:05 +01:00
parent 0803dba7dd
commit 479d684ba5
1 changed files with 4 additions and 3 deletions

View File

@ -808,9 +808,10 @@ static StringRef solveTypeName(Type *Ty) {
return "__floating_type_";
}
if (Ty->isPointerTy()) {
auto *PtrTy = cast<PointerType>(Ty);
Type *PointeeTy = PtrTy->getPointerElementType();
if (auto *PtrTy = dyn_cast<PointerType>(Ty)) {
if (PtrTy->isOpaque())
return "PointerType";
Type *PointeeTy = PtrTy->getNonOpaquePointerElementType();
auto Name = solveTypeName(PointeeTy);
if (Name == "UnknownType")
return "PointerType";