[pypy-svn] r65046 - in pypy/branch/pyjitpl5/pypy/jit/backend/llvm: . test

fijal at codespeak.net fijal at codespeak.net
Tue May 5 08:21:06 CEST 2009


Author: fijal
Date: Tue May  5 08:21:04 2009
New Revision: 65046

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/llvm/demo2.cpp
   pypy/branch/pyjitpl5/pypy/jit/backend/llvm/llvm_rffi.py
   pypy/branch/pyjitpl5/pypy/jit/backend/llvm/runner.py
   pypy/branch/pyjitpl5/pypy/jit/backend/llvm/test/test_runner.py
Log:
enough hackery to really make this tail call. Still segfaults of course :)


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/llvm/demo2.cpp
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/llvm/demo2.cpp	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/llvm/demo2.cpp	Tue May  5 08:21:04 2009
@@ -1,5 +1,7 @@
 /* LLVM includes */
+
 #include <cstdio>
+#include "llvm/LinkAllPasses.h"
 #include "llvm-c/ExecutionEngine.h"
 #include "llvm/ExecutionEngine/GenericValue.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/llvm/llvm_rffi.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/llvm/llvm_rffi.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/llvm/llvm_rffi.py	Tue May  5 08:21:04 2009
@@ -31,10 +31,10 @@
 
     o1name = os.path.join(dirname, 'demo1.o')
     o2name = os.path.join(dirname, 'demo2.o')
-    do("gcc -c '%s' -o '%s'" % (cname, o1name))
+    do("gcc -c '%s' -o '%s' -I/home/fijal/load/llvm/include" % (cname, o1name))
     do("g++ -c '%s' -o '%s' `%s --cppflags`" % (cppname, o2name, llvm_config))
-    do("g++ -shared '%s' '%s' -o '%s'" % (o1name, o2name, libname) +
-       " `%s --cflags --ldflags --libs jit engine`" % llvm_config)
+    do("g++ -shared '%s' '%s' -o '%s' " % (o1name, o2name, libname) +
+       " `%s --cflags --ldflags --libs jit engine` -lLLVMInstrumentation -lLLVMipo -lLLVMipa -lLLVMTransformUtils -lLLVMAnalysis -lLLVMCore" % llvm_config)
 
 compilation_info = ExternalCompilationInfo(
     library_dirs = [dirname],

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/llvm/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/llvm/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/llvm/runner.py	Tue May  5 08:21:04 2009
@@ -26,8 +26,8 @@
     def setup_once(self):
         if not we_are_translated():
             teardown_now()
-        llvm_rffi.LLVM_SetFlags()
         self.module = llvm_rffi.LLVMModuleCreateWithName("pypyjit")
+        llvm_rffi.LLVM_SetFlags()
         if sys.maxint == 2147483647:
             self.ty_int = llvm_rffi.LLVMInt32Type()
         else:

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/llvm/test/test_runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/llvm/test/test_runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/llvm/test/test_runner.py	Tue May  5 08:21:04 2009
@@ -50,7 +50,6 @@
     cpu.set_future_value_int(2, 0)
     cpu.execute_operations(loop)
     assert cpu.get_latest_value_int(0) == 3*(2**11)
-    py.test.skip("fails because tail-recursion is not handled yet")
     cpu.set_future_value_int(0, 2**29)
     cpu.set_future_value_int(1, 3)
     cpu.set_future_value_int(2, 0)



More information about the Pypy-commit mailing list