Pruning cdef variable declarations after analysis
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 19 Jul 2008 20:45:34 +0000 (22:45 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 19 Jul 2008 20:45:34 +0000 (22:45 +0200)
Cython/Compiler/ParseTreeTransforms.py

index 4cf5e356ba0b5fd6c49198dbbff4d7504af9c4d0..57828983284b33e8e56e783c5b4a0f354c26e0fd 100644 (file)
@@ -272,6 +272,13 @@ class AnalyseDeclarationsTransform(CythonTransform):
         self.env_stack.pop()
         return node
         
+    # Some nodes are no longer needed after declaration
+    # analysis and can be dropped. The analysis was performed
+    # on these nodes in a seperate recursive process from the
+    # enclosing function or module, so we can simply drop them.
+    def visit_CVarDefNode(self, node):
+        return None
+
 class AnalyseExpressionsTransform(CythonTransform):
     def visit_ModuleNode(self, node):
         node.body.analyse_expressions(node.scope)