1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Implement fputc and ungetc to allow burg to run in lli

llvm-svn: 4584
This commit is contained in:
Chris Lattner 2002-11-06 22:59:28 +00:00
parent 1fddd12bae
commit b1a9401c59

View File

@ -549,6 +549,22 @@ GenericValue lle_X_getc(FunctionType *M, const vector<GenericValue> &Args) {
return GV;
}
// int fputc(int C, FILE *stream);
GenericValue lle_X_fputc(FunctionType *M, const vector<GenericValue> &Args) {
assert(Args.size() == 2);
GenericValue GV;
GV.IntVal = fputc(Args[0].IntVal, getFILE(Args[1].PointerVal));
return GV;
}
// int ungetc(int C, FILE *stream);
GenericValue lle_X_ungetc(FunctionType *M, const vector<GenericValue> &Args) {
assert(Args.size() == 2);
GenericValue GV;
GV.IntVal = ungetc(Args[0].IntVal, getFILE(Args[1].PointerVal));
return GV;
}
} // End extern "C"
@ -596,5 +612,8 @@ void Interpreter::initializeExternalMethods() {
FuncNames["lle_X_fwrite"] = lle_X_fwrite;
FuncNames["lle_X_fgets"] = lle_X_fgets;
FuncNames["lle_X_fflush"] = lle_X_fflush;
FuncNames["lle_X_fgetc"] = lle_X_getc;
FuncNames["lle_X_getc"] = lle_X_getc;
FuncNames["lle_X_fputc"] = lle_X_fputc;
FuncNames["lle_X_ungetc"] = lle_X_ungetc;
}