if (!OutArgIndexes.count(Arg.getArgNo()))
continue;
- PointerType *ArgType = cast<PointerType>(Arg.getType());
-
Type *EltTy = OutArgIndexes[Arg.getArgNo()];
const auto Align =
DL->getValueOrABITypeAlignment(Arg.getParamAlign(), EltTy);
Value *Val = B.CreateExtractValue(StubCall, RetIdx++);
- Type *PtrTy = Val->getType()->getPointerTo(ArgType->getAddressSpace());
-
- // We can peek through bitcasts, so the type may not match.
- Value *PtrVal = B.CreateBitCast(&Arg, PtrTy);
-
- B.CreateAlignedStore(Val, PtrVal, Align);
+ B.CreateAlignedStore(Val, &Arg, Align);
}
if (!RetTy->isVoidTy()) {