[pypy-svn] r22725 - pypy/dist/pypy/translator/llvm

rxe at codespeak.net rxe at codespeak.net
Fri Jan 27 13:45:01 CET 2006


Author: rxe
Date: Fri Jan 27 13:44:59 2006
New Revision: 22725

Modified:
   pypy/dist/pypy/translator/llvm/arraynode.py
   pypy/dist/pypy/translator/llvm/gc.py
   pypy/dist/pypy/translator/llvm/structnode.py
Log:
Die varsize constructor madness!



Modified: pypy/dist/pypy/translator/llvm/arraynode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/arraynode.py	(original)
+++ pypy/dist/pypy/translator/llvm/arraynode.py	Fri Jan 27 13:44:59 2006
@@ -46,20 +46,6 @@
                             self.db.get_machine_word(),
                             self.db.repr_type(self.arraytype))
 
-    def writedecl(self, codewriter): 
-        return #XXX tmp?
-
-        codewriter.declare(self.constructor_decl)
-
-    def writeimpl(self, codewriter):
-        return  #XXX tmp?
-
-        current, indices_to_array = self.var_malloc_info()
-        log.writeimpl(self.ref)
-        gp = self.db.gcpolicy
-        gp.write_constructor(codewriter, self.ref, self.constructor_decl,
-                             current, atomic=self.array._is_atomic())
-
     def var_malloc_info(self):
         return self.array, ()
     

Modified: pypy/dist/pypy/translator/llvm/gc.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/gc.py	(original)
+++ pypy/dist/pypy/translator/llvm/gc.py	Fri Jan 27 13:44:59 2006
@@ -15,43 +15,7 @@
         return []
     
     def pyrex_code(self):
-        return ''
-    
-    #XXX tmp?
-##     def write_constructor(self, codewriter, ref, constructor_decl, ARRAY, 
-##                           indices_to_array=(), atomic=False):
-        
-##         # the following indices access the last element in the array
-##         elemtype = self.db.repr_type(ARRAY.OF)
-##         word = lentype = self.db.get_machine_word()
-##         uword = self.db.get_machine_uword()
-        
-##         codewriter.openfunc(constructor_decl)    
-
-##         # Need room for NUL terminator
-##         if ARRAY is STR.chars:
-##             codewriter.binaryop("add", "%actuallen", lentype, "%len", 1)
-##         else:
-##             codewriter.cast("%actuallen", lentype, "%len", lentype)
-            
-##         elemindices = list(indices_to_array)
-##         elemindices += [("uint", 1), (lentype, "%actuallen")]
-##         codewriter.getelementptr("%size", ref + "*", "null", elemindices) 
-##         codewriter.cast("%usize", elemtype + "*", "%size", uword)
-        
-##         self._malloc(codewriter, "%ptr", "%usize", atomic=atomic)
-##         codewriter.cast("%result", "sbyte*", "%ptr", ref + "*")
-
-##         indices_to_arraylength = tuple(indices_to_array) + (("uint", 0),)
-
-##         # the following accesses the length field of the array 
-##         codewriter.getelementptr("%arraylength", ref + "*", 
-##                                  "%result", 
-##                                  indices_to_arraylength)
-##         codewriter.store(lentype, "%len", "%arraylength")
-        
-##         codewriter.ret(ref + "*", "%result")
-##         codewriter.closefunc()
+        return ''    
 
     def malloc(self, codewriter, targetvar, type_, size=1, atomic=False):
         raise NotImplementedError, 'GcPolicy should not be used directly'

Modified: pypy/dist/pypy/translator/llvm/structnode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/structnode.py	(original)
+++ pypy/dist/pypy/translator/llvm/structnode.py	Fri Jan 27 13:44:59 2006
@@ -53,25 +53,6 @@
     # ______________________________________________________________________
     # main entry points from genllvm 
 
-    def writedecl(self, codewriter): 
-        # declaration for constructor
-        return #XXX
-
-        codewriter.declare(self.constructor_decl)
-
-    def writeimpl(self, codewriter):
-        return #XXX
-
-        log.writeimpl(self.ref)
-        current, indices_to_array = self.var_malloc_info()
-        gp = self.db.gcpolicy
-        gp.write_constructor(codewriter, 
-                             self.ref,
-                             self.constructor_decl,
-                             current, 
-                             indices_to_array,
-                             self.struct._is_atomic())
-
     def var_malloc_info(self):
         # build up a list of indices to get to the last 
         # var-sized struct (or rather the according array) 



More information about the Pypy-commit mailing list