auto DbgLoc =
cast<CoroSuspendAsyncInst>(VMap[ActiveSuspend])->getDebugLoc();
// Calling i8* (i8*)
- auto *CallerContext = Builder.CreateCall(
- cast<FunctionType>(ProjectionFunc->getType()->getPointerElementType()),
- ProjectionFunc, CalleeContext);
+ auto *CallerContext = Builder.CreateCall(ProjectionFunc->getFunctionType(),
+ ProjectionFunc, CalleeContext);
CallerContext->setCallingConv(ProjectionFunc->getCallingConv());
CallerContext->setDebugLoc(DbgLoc);
// The frame is located after the async_context header.
CallInst *coro::createMustTailCall(DebugLoc Loc, Function *MustTailCallFn,
ArrayRef<Value *> Arguments,
IRBuilder<> &Builder) {
- auto *FnTy =
- cast<FunctionType>(MustTailCallFn->getType()->getPointerElementType());
+ auto *FnTy = MustTailCallFn->getFunctionType();
// Coerce the arguments, llvm optimizations seem to ignore the types in
// vaarg functions and throws away casts in optimized mode.
SmallVector<Value *, 8> CallArgs;