mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-12 06:49:02 +02:00
fixes #434 :: add llvm 2.8 support
This commit is contained in:
@@ -444,10 +444,12 @@ void DtoMemSet(LLValue* dst, LLValue* val, LLValue* nbytes)
|
||||
dst = DtoBitCast(dst,getVoidPtrType());
|
||||
|
||||
const LLType* intTy = DtoSize_t();
|
||||
const LLType *VoidPtrTy = getVoidPtrType();
|
||||
const LLType *Tys[2] ={VoidPtrTy, intTy};
|
||||
llvm::Function* fn = llvm::Intrinsic::getDeclaration(gIR->module,
|
||||
llvm::Intrinsic::memset, &intTy, 1);
|
||||
|
||||
gIR->ir->CreateCall4(fn, dst, val, nbytes, DtoConstUint(0), "");
|
||||
llvm::Intrinsic::memset, Tys, 2);
|
||||
|
||||
gIR->ir->CreateCall5(fn, dst, val, nbytes, DtoConstUint(1), DtoConstBool(false), "");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -465,10 +467,12 @@ void DtoMemCpy(LLValue* dst, LLValue* src, LLValue* nbytes, unsigned align)
|
||||
src = DtoBitCast(src,getVoidPtrType());
|
||||
|
||||
const LLType* intTy = DtoSize_t();
|
||||
const LLType *VoidPtrTy = getVoidPtrType();
|
||||
const LLType *Tys[3] ={VoidPtrTy, VoidPtrTy, intTy};
|
||||
llvm::Function* fn = llvm::Intrinsic::getDeclaration(gIR->module,
|
||||
llvm::Intrinsic::memcpy, &intTy, 1);
|
||||
|
||||
gIR->ir->CreateCall4(fn, dst, src, nbytes, DtoConstUint(align), "");
|
||||
llvm::Intrinsic::memcpy, Tys, 3);
|
||||
|
||||
gIR->ir->CreateCall5(fn, dst, src, nbytes, DtoConstUint(align), DtoConstBool(false), "");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user