[llvm-commits] [llvm] r47363 - /llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
Evan Cheng
evan.cheng at apple.com
Tue Feb 19 23:55:26 PST 2008
Author: evancheng
Date: Wed Feb 20 01:55:26 2008
New Revision: 47363
URL: http://llvm.org/viewvc/llvm-project?rev=47363&view=rev
Log:
Added memmove to interpreter external functions list. Patch by Daniel Dunbar.
Modified:
llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp?rev=47363&r1=47362&r2=47363&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Wed Feb 20 01:55:26 2008
@@ -597,6 +597,14 @@
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 @@
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;
More information about the llvm-commits
mailing list