mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -98,22 +98,19 @@ void IntrinsicLowering::AddPrototypes(Module &M) {
|
||||
EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(),
|
||||
Type::VoidTy);
|
||||
break;
|
||||
case Intrinsic::memcpy_i32:
|
||||
case Intrinsic::memcpy_i64:
|
||||
case Intrinsic::memcpy:
|
||||
M.getOrInsertFunction("memcpy", PointerType::getUnqual(Type::Int8Ty),
|
||||
PointerType::getUnqual(Type::Int8Ty),
|
||||
PointerType::getUnqual(Type::Int8Ty),
|
||||
TD.getIntPtrType(), (Type *)0);
|
||||
break;
|
||||
case Intrinsic::memmove_i32:
|
||||
case Intrinsic::memmove_i64:
|
||||
case Intrinsic::memmove:
|
||||
M.getOrInsertFunction("memmove", PointerType::getUnqual(Type::Int8Ty),
|
||||
PointerType::getUnqual(Type::Int8Ty),
|
||||
PointerType::getUnqual(Type::Int8Ty),
|
||||
TD.getIntPtrType(), (Type *)0);
|
||||
break;
|
||||
case Intrinsic::memset_i32:
|
||||
case Intrinsic::memset_i64:
|
||||
case Intrinsic::memset:
|
||||
M.getOrInsertFunction("memset", PointerType::getUnqual(Type::Int8Ty),
|
||||
PointerType::getUnqual(Type::Int8Ty),
|
||||
Type::Int32Ty,
|
||||
@@ -784,8 +781,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
case Intrinsic::var_annotation:
|
||||
break; // Strip out annotate intrinsic
|
||||
|
||||
case Intrinsic::memcpy_i32:
|
||||
case Intrinsic::memcpy_i64: {
|
||||
case Intrinsic::memcpy: {
|
||||
static Constant *MemcpyFCache = 0;
|
||||
Value *Size = CI->getOperand(3);
|
||||
const Type *IntPtr = TD.getIntPtrType();
|
||||
@@ -803,8 +799,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
MemcpyFCache);
|
||||
break;
|
||||
}
|
||||
case Intrinsic::memmove_i32:
|
||||
case Intrinsic::memmove_i64: {
|
||||
case Intrinsic::memmove: {
|
||||
static Constant *MemmoveFCache = 0;
|
||||
Value *Size = CI->getOperand(3);
|
||||
const Type *IntPtr = TD.getIntPtrType();
|
||||
@@ -822,8 +817,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
|
||||
MemmoveFCache);
|
||||
break;
|
||||
}
|
||||
case Intrinsic::memset_i32:
|
||||
case Intrinsic::memset_i64: {
|
||||
case Intrinsic::memset: {
|
||||
static Constant *MemsetFCache = 0;
|
||||
Value *Size = CI->getOperand(3);
|
||||
const Type *IntPtr = TD.getIntPtrType();
|
||||
|
||||
Reference in New Issue
Block a user