[pypy-svn] r22443 - in pypy/dist/pypy/translator/llvm: . module

ericvrp at codespeak.net ericvrp at codespeak.net
Thu Jan 19 15:47:38 CET 2006


Author: ericvrp
Date: Thu Jan 19 15:47:32 2006
New Revision: 22443

Modified:
   pypy/dist/pypy/translator/llvm/genllvm.py
   pypy/dist/pypy/translator/llvm/module/support.py
Log:
argh


Modified: pypy/dist/pypy/translator/llvm/genllvm.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/genllvm.py	(original)
+++ pypy/dist/pypy/translator/llvm/genllvm.py	Thu Jan 19 15:47:32 2006
@@ -10,7 +10,7 @@
 from pypy.translator.llvm.codewriter import CodeWriter
 from pypy.translator.llvm import extfuncnode
 from pypy.translator.llvm.module.support import \
-     extdeclarations, extfunctions, write_raise_exc
+     extdeclarations, extfunctions, extfunctions_standalone, write_raise_exc
 from pypy.translator.llvm.node import LLVMNode
 from pypy.translator.llvm.externs2ll import setup_externs, generate_llfile
 from pypy.translator.llvm.gc import GcPolicy
@@ -151,6 +151,8 @@
         codewriter.header_comment('External Function Implementation')
         codewriter.write_lines(self.llexterns_functions)
         codewriter.write_lines(self._set_wordsize(extfunctions))
+        if self.standalone:
+            codewriter.write_lines(self._set_wordsize(extfunctions_standalone))
         self.write_extern_impls(codewriter)
         self.write_setup_impl(codewriter)
         

Modified: pypy/dist/pypy/translator/llvm/module/support.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/module/support.py	(original)
+++ pypy/dist/pypy/translator/llvm/module/support.py	Thu Jan 19 15:47:32 2006
@@ -88,12 +88,6 @@
     ret void
 }
 
-internal fastcc int %pypy_entry_point(%RPyListOfString* %argv) {
-    %result = call long %pypy_entry_point(%RPyListOfString* %argv)
-    %tmp = cast long %result to int
-    ret int %tmp
-}
-
 internal fastcc void %pypy__RPyListOfString_SetItem__listPtr_Signed_rpy_stringPtr(%RPyListOfString* %l_1, int %index_0, %RPyString* %newstring_0) {
     %index_0_long = cast int %index_0 to long
     call void %pypy__RPyListOfString_SetItem__listPtr_Signed_rpy_stringPtr(%RPyListOfString* %l_1, long %index_0_long, %RPyString* %newstring_0)
@@ -102,6 +96,18 @@
 
 """
 
+extfunctions_standalone = """
+"""
+if maxint != 2**31-1:
+    extfunctions_standalone += """
+internal fastcc int %pypy_entry_point(%RPyListOfString* %argv) {
+    %result = call long %pypy_entry_point(%RPyListOfString* %argv)
+    %tmp = cast long %result to int
+    ret int %tmp
+}
+
+"""
+
 def write_raise_exc(c_name, exc_repr, codewriter):
 
     l = """



More information about the Pypy-commit mailing list