Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r67501:3e9f1cd83031
Date: 2013-10-22 12:14 +0200
http://bitbucket.org/pypy/pypy/changeset/3e9f1cd83031/

Log:    Kill dead code

diff --git a/rpython/translator/c/node.py b/rpython/translator/c/node.py
--- a/rpython/translator/c/node.py
+++ b/rpython/translator/c/node.py
@@ -182,21 +182,6 @@
                                  FIELD_T):
                 yield line
 
-    def debug_offsets(self):
-        # generate number exprs giving the offset of the elements in the struct
-        assert self.varlength is None
-        for name in self.fieldnames:
-            FIELD_T = self.c_struct_field_type(name)
-            if FIELD_T is Void:
-                yield '-1'
-            else:
-                try:
-                    cname = self.c_struct_field_name(name)
-                except ValueError:
-                    yield '-1'
-                else:
-                    yield 'offsetof(%s %s, %s)' % (self.typetag,
-                                                   self.name, cname)
 
 def deflength(varlength):
     if varlength is None:
@@ -318,20 +303,6 @@
             yield '\t}'
             yield '}'
 
-    def debug_offsets(self):
-        # generate three offsets for debugging inspection
-        assert self.varlength is None
-        if not self.ARRAY._hints.get('nolength', False):
-            yield 'offsetof(struct %s, length)' % (self.name,)
-        else:
-            yield '-1'
-        if self.ARRAY.OF is not Void:
-            yield 'offsetof(struct %s, items[0])' % (self.name,)
-            yield 'offsetof(struct %s, items[1])' % (self.name,)
-        else:
-            yield '-1'
-            yield '-1'
-
 
 class BareBoneArrayDefNode(NodeWithDependencies):
     """For 'simple' array types which don't need a length nor GC headers.
@@ -391,12 +362,6 @@
     def visitor_lines(self, prefix, on_item):
         raise Exception("cannot visit C arrays - don't know the length")
 
-    def debug_offsets(self):
-        # generate three offsets for debugging inspection,
-        yield '-1'     # no length
-        yield '0'      # first element is immediately at the start of the array
-        yield 'sizeof(%s)' % (cdecl(self.itemtypename, ''),)
-
 
 class FixedSizeArrayDefNode(NodeWithDependencies):
     gcinfo = None
@@ -469,10 +434,6 @@
             yield '\t}'
             yield '}'
 
-    def debug_offsets(self):
-        # XXX not implemented
-        return []
-
 
 class ExtTypeOpaqueDefNode(NodeWithDependencies):
     """For OpaqueTypes created with the hint render_structure."""
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to