Commit 89c9297b authored by Stefan Behnel's avatar Stefan Behnel

move utility code inclusion from Name/AttributeNodes to the latest possible...

move utility code inclusion from Name/AttributeNodes to the latest possible step in the pipeline (after removing it from declaration analysis)
parent faf63c64
...@@ -105,15 +105,19 @@ class UseUtilityCodeDefinitions(CythonTransform): ...@@ -105,15 +105,19 @@ class UseUtilityCodeDefinitions(CythonTransform):
self.scope = node.scope self.scope = node.scope
return super(UseUtilityCodeDefinitions, self).__call__(node) return super(UseUtilityCodeDefinitions, self).__call__(node)
def process_entry(self, entry):
if entry:
for utility_code in (entry.utility_code, entry.utility_code_definition):
if utility_code:
self.scope.use_utility_code(utility_code)
def visit_AttributeNode(self, node): def visit_AttributeNode(self, node):
if node.entry and node.entry.utility_code_definition: self.process_entry(node.entry)
self.scope.use_utility_code(node.entry.utility_code_definition)
return node return node
def visit_NameNode(self, node): def visit_NameNode(self, node):
for e in (node.entry, node.type_entry): self.process_entry(node.entry)
if e and e.utility_code_definition: self.process_entry(node.type_entry)
self.scope.use_utility_code(e.utility_code_definition)
return node return node
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment