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:
Nick Lewycky
2010-05-31 06:16:35 +00:00
parent 10e02a017a
commit a9d6680cb1
2 changed files with 22 additions and 2 deletions

View File

@ -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));