mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 23:29:51 +00:00
Added memmove to interpreter external functions list. Patch by Daniel Dunbar.
llvm-svn: 47363
This commit is contained in:
parent
9a2a1ddf6e
commit
a1f7505972
@ -597,6 +597,14 @@ GenericValue lle_X_memcpy(FunctionType *FT, const vector<GenericValue> &Args) {
|
||||
return PTOGV(memcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]), count));
|
||||
}
|
||||
|
||||
// void *memcpy(void *Dest, void *src, size_t Size);
|
||||
GenericValue lle_X_memmove(FunctionType *FT, const vector<GenericValue> &Args) {
|
||||
assert(Args.size() == 3);
|
||||
assert(isa<PointerType>(FT->getReturnType()) && "memmove must return pointer");
|
||||
size_t count = GV_to_size_t (Args[2]);
|
||||
return PTOGV(memmove((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]), count));
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// IO Functions...
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -793,6 +801,7 @@ void Interpreter::initializeExternalFunctions() {
|
||||
FuncNames["lle_X___strdup"] = lle_X___strdup;
|
||||
FuncNames["lle_X_memset"] = lle_X_memset;
|
||||
FuncNames["lle_X_memcpy"] = lle_X_memcpy;
|
||||
FuncNames["lle_X_memmove"] = lle_X_memmove;
|
||||
|
||||
FuncNames["lle_X_fopen"] = lle_X_fopen;
|
||||
FuncNames["lle_X_fclose"] = lle_X_fclose;
|
||||
|
Loading…
Reference in New Issue
Block a user