Add __strdup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5941 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index f53be1b..f8e1288 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -565,6 +565,12 @@
   return Ret;
 }
 
+// char *__strdup(const char *src);
+GenericValue lle_X___strdup(FunctionType *M, const vector<GenericValue> &Args) {
+  assert(Args.size() == 1);
+  return PTOGV(strdup((char*)GVTOP(Args[0])));
+}
+
 // void *memset(void *S, int C, size_t N)
 GenericValue lle_X_memset(FunctionType *M, const vector<GenericValue> &Args) {
   assert(Args.size() == 3);
@@ -803,6 +809,7 @@
   FuncNames["lle_X_strcat"]       = lle_X_strcat;
   FuncNames["lle_X_strcpy"]       = lle_X_strcpy;
   FuncNames["lle_X_strlen"]       = lle_X_strlen;
+  FuncNames["lle_X___strdup"]       = lle_X___strdup;
   FuncNames["lle_X_memset"]       = lle_X_memset;
   FuncNames["lle_X_memcpy"]       = lle_X_memcpy;