[pypy-svn] r15992 - pypy/dist/pypy/translator/llvm2/module

rxe at codespeak.net rxe at codespeak.net
Fri Aug 12 01:23:57 CEST 2005


Author: rxe
Date: Fri Aug 12 01:23:56 2005
New Revision: 15992

Modified:
   pypy/dist/pypy/translator/llvm2/module/support.py
Log:
rpy_string s are already null terminated (sorry but was causing problems on 64
bit machine and since we dont need it, better to get rid of it than fix it.
Also it's an optimisation. :-)



Modified: pypy/dist/pypy/translator/llvm2/module/support.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/support.py	(original)
+++ pypy/dist/pypy/translator/llvm2/module/support.py	Fri Aug 12 01:23:56 2005
@@ -8,22 +8,9 @@
 
 extfunctions["%cast"] = ((), """
 internal fastcc sbyte* %cast(%structtype.rpy_string* %structstring) {
-    %reallengthptr = getelementptr %structtype.rpy_string* %structstring, int 0, uint 1, uint 0
-    %reallength = load int* %reallengthptr
-    %length = add int %reallength, 1
-    %ulength = cast int %length to uint
-    %dest = call fastcc sbyte* %gc_malloc_atomic(uint %ulength)
-
     %source1ptr = getelementptr %structtype.rpy_string* %structstring, int 0, uint 1, uint 1
     %source1 = cast [0 x sbyte]* %source1ptr to sbyte*
-    %dummy = call ccc sbyte* %strncpy(sbyte* %dest, sbyte* %source1, int %reallength)
-
-    %zeropos1 = cast sbyte* %dest to int
-    %zeropos2 = add int %zeropos1, %reallength
-    %zerodest = cast int %zeropos2 to sbyte*
-    store sbyte 0, sbyte* %zerodest
-
-    ret sbyte* %dest
+    ret sbyte* %source1
 }
 
 """)



More information about the Pypy-commit mailing list