Skip to content

Commit 479d684

Browse files
committed
[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
1 parent 0803dba commit 479d684

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Coroutines/CoroFrame.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,10 @@ static StringRef solveTypeName(Type *Ty) {
808808
return "__floating_type_";
809809
}
810810

811-
if (Ty->isPointerTy()) {
812-
auto *PtrTy = cast<PointerType>(Ty);
813-
Type *PointeeTy = PtrTy->getPointerElementType();
811+
if (auto *PtrTy = dyn_cast<PointerType>(Ty)) {
812+
if (PtrTy->isOpaque())
813+
return "PointerType";
814+
Type *PointeeTy = PtrTy->getNonOpaquePointerElementType();
814815
auto Name = solveTypeName(PointeeTy);
815816
if (Name == "UnknownType")
816817
return "PointerType";

0 commit comments

Comments
 (0)