From aee2632be3537cc60ac0b389620456d17a0b3fce Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 31 May 2010 06:16:35 +0000 Subject: The memcpy intrinsic only takes i8* for %src and %dst, so cast them to that first. Fixes PR7265. llvm-svn: 105206 --- llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp index 767fa3a0a6b..059aeab003f 100644 --- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp @@ -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)); -- cgit v1.2.3