mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 21:30:49 +00:00
autoupgrade memcpy/memmove/memset with signed counts.
CVS: ---------------------------------------------------------------------- git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26654 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ddc877ccae
commit
a758b8250d
@ -84,10 +84,18 @@ static Function *getUpgradedIntrinsic(Function *F) {
|
|||||||
case 'm':
|
case 'm':
|
||||||
if (Name == "llvm.memcpy" || Name == "llvm.memset" ||
|
if (Name == "llvm.memcpy" || Name == "llvm.memset" ||
|
||||||
Name == "llvm.memmove") {
|
Name == "llvm.memmove") {
|
||||||
if (F->getFunctionType()->getParamType(2) == Type::UIntTy)
|
if (F->getFunctionType()->getParamType(2) == Type::UIntTy ||
|
||||||
return M->getOrInsertFunction(Name+".i32", F->getFunctionType());
|
F->getFunctionType()->getParamType(2) == Type::IntTy)
|
||||||
if (F->getFunctionType()->getParamType(2) == Type::ULongTy)
|
return M->getOrInsertFunction(Name+".i32", Type::VoidTy,
|
||||||
return M->getOrInsertFunction(Name+".i64", F->getFunctionType());
|
PointerType::get(Type::SByteTy),
|
||||||
|
F->getFunctionType()->getParamType(1),
|
||||||
|
Type::UIntTy, Type::UIntTy, NULL);
|
||||||
|
if (F->getFunctionType()->getParamType(2) == Type::ULongTy ||
|
||||||
|
F->getFunctionType()->getParamType(2) == Type::LongTy)
|
||||||
|
return M->getOrInsertFunction(Name+".i64", Type::VoidTy,
|
||||||
|
PointerType::get(Type::SByteTy),
|
||||||
|
F->getFunctionType()->getParamType(1),
|
||||||
|
Type::ULongTy, Type::UIntTy, NULL);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
|
Loading…
Reference in New Issue
Block a user