From 8647bcd5de06eb4f8c11cee90333e373460aacb7 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 20 Feb 2008 07:55:26 +0000 Subject: [PATCH] Added memmove to interpreter external functions list. Patch by Daniel Dunbar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47363 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index b5f623d49be..c6dde951499 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -597,6 +597,14 @@ GenericValue lle_X_memcpy(FunctionType *FT, const vector &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 &Args) { + assert(Args.size() == 3); + assert(isa(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; -- 2.34.1