From: Stefan Behnel Date: Mon, 1 Apr 2013 09:57:25 +0000 (+0200) Subject: broaden the effect of in-closure def node call inlining X-Git-Tag: 0.19b1~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7538ecd22b969ad624095b2a4b2b2603b0b3037f;p=platform%2Fupstream%2Fpython-cython.git broaden the effect of in-closure def node call inlining --- diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 5660c2f..2e63532 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -1649,15 +1649,16 @@ class InlineDefNodeCalls(Visitor.NodeRefCleanupMixin, Visitor.EnvTransform): visit_Node = Visitor.VisitorTransform.recurse_to_children def get_constant_value_node(self, name_node): - if not name_node.cf_state or not name_node.cf_state.is_single: - # no single assignment in the current scope + if name_node.cf_state is None: + return None + if name_node.cf_state.cf_is_null: return None entry = self.current_env().lookup(name_node.name) if not entry or (not entry.cf_assignments or len(entry.cf_assignments) != 1): # not just a single assignment in all closures return None - return name_node.cf_state.one().rhs + return entry.cf_assignments[0].rhs def visit_SimpleCallNode(self, node): self.visitchildren(node)