[pypy-svn] r18776 - pypy/dist/pypy/translator/llvm
rxe at codespeak.net
rxe at codespeak.net
Wed Oct 19 20:52:56 CEST 2005
Author: rxe
Date: Wed Oct 19 20:52:53 2005
New Revision: 18776
Modified:
pypy/dist/pypy/translator/llvm/arraynode.py
pypy/dist/pypy/translator/llvm/structnode.py
pypy/dist/pypy/translator/llvm/varsize.py
Log:
Take the rest of fields in to account when mallocing varsize structs (was only
using the array.) ASFAIK (without checking) - this is not actually needed, but
heh, saves it biting us on the a%#e if it does. ;-)
Modified: pypy/dist/pypy/translator/llvm/arraynode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/arraynode.py (original)
+++ pypy/dist/pypy/translator/llvm/arraynode.py Wed Oct 19 20:52:53 2005
@@ -56,7 +56,8 @@
log.writeimpl(self.ref)
varsize.write_constructor(self.db, codewriter, self.ref,
self.constructor_decl,
- self.array)
+ self.array,
+ atomic=self.array._is_atomic())
class VoidArrayTypeNode(LLVMNode):
Modified: pypy/dist/pypy/translator/llvm/structnode.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/structnode.py (original)
+++ pypy/dist/pypy/translator/llvm/structnode.py Wed Oct 19 20:52:53 2005
@@ -77,7 +77,8 @@
self.ref,
self.constructor_decl,
current,
- indices_to_array)
+ indices_to_array,
+ self.struct._is_atomic())
class StructNode(ConstantLLVMNode):
""" A struct constant. Can simply contain
Modified: pypy/dist/pypy/translator/llvm/varsize.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/varsize.py (original)
+++ pypy/dist/pypy/translator/llvm/varsize.py Wed Oct 19 20:52:53 2005
@@ -1,7 +1,7 @@
from pypy.rpython.rstr import STR
def write_constructor(db, codewriter, ref, constructor_decl, ARRAY,
- indices_to_array=()):
+ indices_to_array=(), atomic=False):
#varsized arrays and structs look like this:
#Array: {int length , elemtype*}
@@ -23,7 +23,7 @@
elemindices = list(indices_to_array) + [("uint", 1), (lentype, "%actuallen")]
codewriter.getelementptr("%size", ref + "*", "null", *elemindices)
codewriter.cast("%usize", elemtype + "*", "%size", uword)
- codewriter.malloc("%ptr", "sbyte", "%usize", atomic=ARRAY._is_atomic())
+ codewriter.malloc("%ptr", "sbyte", "%usize", atomic=atomic)
codewriter.cast("%result", "sbyte*", "%ptr", ref + "*")
indices_to_arraylength = tuple(indices_to_array) + (("uint", 0),)
More information about the Pypy-commit
mailing list