[llvm-commits] CVS: llvm/tools/lli/ExternalFunctions.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Nov 7 13:35:00 PST 2002
Changes in directory llvm/tools/lli:
ExternalFunctions.cpp updated: 1.36 -> 1.37
---
Log message:
Implement freopen for burg
---
Diffs of the changes:
Index: llvm/tools/lli/ExternalFunctions.cpp
diff -u llvm/tools/lli/ExternalFunctions.cpp:1.36 llvm/tools/lli/ExternalFunctions.cpp:1.37
--- llvm/tools/lli/ExternalFunctions.cpp:1.36 Wed Nov 6 17:05:03 2002
+++ llvm/tools/lli/ExternalFunctions.cpp Thu Nov 7 13:33:50 2002
@@ -531,11 +531,20 @@
return GV;
}
+// FILE *freopen(const char *path, const char *mode, FILE *stream);
+GenericValue lle_X_freopen(FunctionType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 3);
+ GenericValue GV;
+ GV.PointerVal = (PointerTy)freopen((char*)Args[0].PointerVal,
+ (char*)Args[1].PointerVal,
+ getFILE(Args[2].PointerVal));
+ return GV;
+}
+
// int fflush(FILE *stream);
GenericValue lle_X_fflush(FunctionType *M, const vector<GenericValue> &Args) {
assert(Args.size() == 1);
GenericValue GV;
-
GV.IntVal = fflush(getFILE(Args[0].PointerVal));
return GV;
}
@@ -544,7 +553,6 @@
GenericValue lle_X_getc(FunctionType *M, const vector<GenericValue> &Args) {
assert(Args.size() == 1);
GenericValue GV;
-
GV.IntVal = getc(getFILE(Args[0].PointerVal));
return GV;
}
@@ -632,4 +640,5 @@
FuncNames["lle_X_fputc"] = lle_X_fputc;
FuncNames["lle_X_ungetc"] = lle_X_ungetc;
FuncNames["lle_X_fprintf"] = lle_X_fprintf;
+ FuncNames["lle_X_freopen"] = lle_X_freopen;
}
More information about the llvm-commits
mailing list