diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-08 19:10:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-08 19:10:26 +0000 |
commit | 25f6f373b88199d861c1c618d3aa8f7b69d1e2ae (patch) | |
tree | cee0aa83d6b40f5cde9a6fac0a4901394d5392e8 /lib/ExecutionEngine | |
parent | 691cd891e36e5e19d5a039babe5d03a512ad23a7 (diff) | |
download | external_llvm-25f6f373b88199d861c1c618d3aa8f7b69d1e2ae.zip external_llvm-25f6f373b88199d861c1c618d3aa8f7b69d1e2ae.tar.gz external_llvm-25f6f373b88199d861c1c618d3aa8f7b69d1e2ae.tar.bz2 |
Implement feof
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index cb85a23..bc873e2 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -501,6 +501,15 @@ GenericValue lle_X_fclose(FunctionType *M, const vector<GenericValue> &Args) { return GV; } +// int feof(FILE *stream); +GenericValue lle_X_feof(FunctionType *M, const vector<GenericValue> &Args) { + assert(Args.size() == 1); + GenericValue GV; + + GV.IntVal = feof(getFILE(Args[0].PointerVal)); + return GV; +} + // size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream); GenericValue lle_X_fread(FunctionType *M, const vector<GenericValue> &Args) { assert(Args.size() == 4); @@ -631,6 +640,7 @@ void Interpreter::initializeExternalMethods() { FuncNames["lle_i_clock"] = lle_i_clock; FuncNames["lle_X_fopen"] = lle_X_fopen; FuncNames["lle_X_fclose"] = lle_X_fclose; + FuncNames["lle_X_feof"] = lle_X_feof; FuncNames["lle_X_fread"] = lle_X_fread; FuncNames["lle_X_fwrite"] = lle_X_fwrite; FuncNames["lle_X_fgets"] = lle_X_fgets; |