mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
The memcpy intrinsic only takes i8* for %src and %dst, so cast them to that
first. Fixes PR7265. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105206 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -112,10 +112,10 @@ Value *llvm::EmitStrNCpy(Value *Dst, Value *Src, Value *Len,
|
||||
Value *llvm::EmitMemCpy(Value *Dst, Value *Src, Value *Len, unsigned Align,
|
||||
bool isVolatile, IRBuilder<> &B, const TargetData *TD) {
|
||||
Module *M = B.GetInsertBlock()->getParent()->getParent();
|
||||
const Type *ArgTys[3] = { Dst->getType(), Src->getType(), Len->getType() };
|
||||
Value *MemCpy = Intrinsic::getDeclaration(M, Intrinsic::memcpy, ArgTys, 3);
|
||||
Dst = CastToCStr(Dst, B);
|
||||
Src = CastToCStr(Src, B);
|
||||
const Type *ArgTys[3] = { Dst->getType(), Src->getType(), Len->getType() };
|
||||
Value *MemCpy = Intrinsic::getDeclaration(M, Intrinsic::memcpy, ArgTys, 3);
|
||||
return B.CreateCall5(MemCpy, Dst, Src, Len,
|
||||
ConstantInt::get(B.getInt32Ty(), Align),
|
||||
ConstantInt::get(B.getInt1Ty(), isVolatile));
|
||||
|
Reference in New Issue
Block a user