[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp

Reid Spencer reid at x10sys.com
Wed Oct 27 16:03:55 PDT 2004



Changes in directory llvm/lib/ExecutionEngine/Interpreter:

ExternalFunctions.cpp updated: 1.78 -> 1.79
---
Log message:

Changes to support rand48 tests

---
Diffs of the changes:  (+15 -0)

Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.78 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.79
--- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.78	Wed Sep  1 17:55:35 2004
+++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp	Wed Oct 27 18:03:44 2004
@@ -213,6 +213,8 @@
   return GV;
 }
 
+#ifdef HAVE_RAND48
+
 // double drand48()
 GenericValue lle_X_drand48(FunctionType *M, const vector<GenericValue> &Args) {
   assert(Args.size() == 0);
@@ -236,6 +238,16 @@
   return GenericValue();
 }
 
+#endif
+
+// int rand()
+GenericValue lle_X_rand(FunctionType *M, const vector<GenericValue> &Args) {
+  assert(Args.size() == 0);
+  GenericValue GV;
+  GV.IntVal = rand();
+  return GV;
+}
+
 // void srand(uint)
 GenericValue lle_X_srand(FunctionType *M, const vector<GenericValue> &Args) {
   assert(Args.size() == 1);
@@ -676,9 +688,12 @@
   FuncNames["lle_X_log"]          = lle_X_log;
   FuncNames["lle_X_floor"]        = lle_X_floor;
   FuncNames["lle_X_srand"]        = lle_X_srand;
+  FuncNames["lle_X_rand"]         = lle_X_rand;
+#ifdef HAVE_RAND48
   FuncNames["lle_X_drand48"]      = lle_X_drand48;
   FuncNames["lle_X_srand48"]      = lle_X_srand48;
   FuncNames["lle_X_lrand48"]      = lle_X_lrand48;
+#endif
   FuncNames["lle_X_sqrt"]         = lle_X_sqrt;
   FuncNames["lle_X_puts"]         = lle_X_puts;
   FuncNames["lle_X_printf"]       = lle_X_printf;






More information about the llvm-commits mailing list