diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp --- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp @@ -808,9 +808,10 @@ return "__floating_type_"; } - if (Ty->isPointerTy()) { - auto *PtrTy = cast(Ty); - Type *PointeeTy = PtrTy->getPointerElementType(); + if (auto *PtrTy = dyn_cast(Ty)) { + if (PtrTy->isOpaque()) + return "PointerType"; + Type *PointeeTy = PtrTy->getNonOpaquePointerElementType(); auto Name = solveTypeName(PointeeTy); if (Name == "UnknownType") return "PointerType";