diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-20 07:55:26 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-20 07:55:26 +0000 |
commit | ab5729cfe648b7e22c4caf7825f7387e7c359602 (patch) | |
tree | 1ed5cb289b94dd584cc35eabdd7abd88a5239c74 /llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
parent | 406fdbd3adef0e7f18777350d2dcfc0c84f861c1 (diff) | |
download | bcm5719-llvm-ab5729cfe648b7e22c4caf7825f7387e7c359602.tar.gz bcm5719-llvm-ab5729cfe648b7e22c4caf7825f7387e7c359602.zip |
Added memmove to interpreter external functions list. Patch by Daniel Dunbar.
llvm-svn: 47363
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index b5f623d49be..c6dde951499 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -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; |