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

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 15 16:31:54 PDT 2004



Changes in directory llvm/lib/ExecutionEngine/JIT:

JIT.cpp updated: 1.37 -> 1.38
---
Log message:

Handle zero arg function case


---
Diffs of the changes:  (+5 -1)

Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp
diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.37 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.38
--- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.37	Sun Aug 15 18:29:50 2004
+++ llvm/lib/ExecutionEngine/JIT/JIT.cpp	Sun Aug 15 18:31:43 2004
@@ -62,7 +62,7 @@
   GenericValue rv;
 
   void *FPtr = getPointerToFunction(F);
-  assert(PFtr && "Pointer to fn's code was null after getPointerToFunction");
+  assert(FPtr && "Pointer to fn's code was null after getPointerToFunction");
 
   if (ArgValues.size() == 3) {
     int (*PF)(int, char **, const char **) =
@@ -76,6 +76,10 @@
     int (*PF)(int) = (int(*)(int))FPtr;
     rv.IntVal = PF(ArgValues[0].IntVal);
     return rv;
+  } else if (ArgValues.size() == 0) {
+    int (*PF)() = (int(*)())FPtr;
+    rv.IntVal = PF();
+    return rv;
   }
 
   // FIXME: This code should handle a couple of common cases efficiently, but






More information about the llvm-commits mailing list