From 5f311a7bce065e8d8cccec2245411ec76e23fdd6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Apr 2003 20:23:16 +0000 Subject: [PATCH] Add memcpy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5887 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index eced4824c1a..f53be1b11b1 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -571,6 +571,12 @@ GenericValue lle_X_memset(FunctionType *M, const vector &Args) { return PTOGV(memset(GVTOP(Args[0]), Args[1].IntVal, Args[2].UIntVal)); } +// void *memcpy(void *Dest, void *src, size_t Size); +GenericValue lle_X_memcpy(FunctionType *M, const vector &Args) { + assert(Args.size() == 3); + return PTOGV(memcpy((char*)GVTOP(Args[0]), (char*)GVTOP(Args[1]), + Args[2].UIntVal)); +} //===----------------------------------------------------------------------===// // IO Functions... @@ -798,6 +804,7 @@ void Interpreter::initializeExternalMethods() { FuncNames["lle_X_strcpy"] = lle_X_strcpy; FuncNames["lle_X_strlen"] = lle_X_strlen; FuncNames["lle_X_memset"] = lle_X_memset; + FuncNames["lle_X_memcpy"] = lle_X_memcpy; FuncNames["lle_X_fopen"] = lle_X_fopen; FuncNames["lle_X_fclose"] = lle_X_fclose;