Merge branch 'memcpy'

This commit is contained in:
kai
2013-05-10 13:48:39 +02:00
2 changed files with 4 additions and 1 deletions

View File

@@ -82,7 +82,8 @@ void ReturnStatement::toIR(IRState* p)
DValue* rvar = new DVarValue(f->type->next, f->decl->ir.irFunc->retArg);
DValue* e = exp->toElemDtor(p);
// store return value
DtoAssign(loc, rvar, e);
if (rvar->getLVal() != e->getRVal())
DtoAssign(loc, rvar, e);
// call postblit if necessary
if (!p->func()->type->isref && !(f->decl->nrvo_can && f->decl->nrvo_var))

View File

@@ -545,6 +545,8 @@ void DtoMemSetZero(LLValue* dst, LLValue* nbytes)
void DtoMemCpy(LLValue* dst, LLValue* src, LLValue* nbytes, unsigned align)
{
assert (src != dst && "src and dst of memcpy must be different");
LLType* VoidPtrTy = getVoidPtrType();
dst = DtoBitCast(dst, VoidPtrTy);