Add __strdup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5941 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-04-25 18:23:38 +00:00
parent 807b7055b2
commit c8cff9e643

View File

@ -565,6 +565,12 @@ GenericValue lle_X_strlen(FunctionType *M, const vector<GenericValue> &Args) {
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 @@ void Interpreter::initializeExternalMethods() {
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;