Commit aefafa9d authored by Stefan Behnel's avatar Stefan Behnel

Remove permanent output scanning code that eats quite a bit of processing time.

parent 5692345b
...@@ -119,8 +119,6 @@ modifier_output_mapper = { ...@@ -119,8 +119,6 @@ modifier_output_mapper = {
'inline': 'CYTHON_INLINE' 'inline': 'CYTHON_INLINE'
}.get }.get
is_self_assignment = re.compile(r" *(\w+) = (\1);\s*$").match
class IncludeCode(object): class IncludeCode(object):
""" """
...@@ -1880,8 +1878,6 @@ class CCodeWriter(object): ...@@ -1880,8 +1878,6 @@ class CCodeWriter(object):
self.put(code) self.put(code)
def put(self, code): def put(self, code):
if is_self_assignment(code):
return
fix_indent = False fix_indent = False
if "{" in code: if "{" in code:
dl = code.count("{") dl = code.count("{")
......
...@@ -2307,7 +2307,7 @@ class NameNode(AtomicExprNode): ...@@ -2307,7 +2307,7 @@ class NameNode(AtomicExprNode):
if is_pythran_expr(self.type): if is_pythran_expr(self.type):
code.putln('new (&%s) decltype(%s){%s};' % (self.result(), self.result(), result)) code.putln('new (&%s) decltype(%s){%s};' % (self.result(), self.result(), result))
else: elif result != self.result():
code.putln('%s = %s;' % (self.result(), result)) code.putln('%s = %s;' % (self.result(), result))
if debug_disposal_code: if debug_disposal_code:
print("NameNode.generate_assignment_code:") print("NameNode.generate_assignment_code:")
...@@ -7729,7 +7729,7 @@ class SequenceNode(ExprNode): ...@@ -7729,7 +7729,7 @@ class SequenceNode(ExprNode):
code.put_decref(target_list, py_object_type) code.put_decref(target_list, py_object_type)
code.putln('%s = %s; %s = NULL;' % (target_list, sublist_temp, sublist_temp)) code.putln('%s = %s; %s = NULL;' % (target_list, sublist_temp, sublist_temp))
code.putln('#else') code.putln('#else')
code.putln('%s = %s;' % (sublist_temp, sublist_temp)) # avoid warning about unused variable code.putln('(void)%s;' % sublist_temp) # avoid warning about unused variable
code.funcstate.release_temp(sublist_temp) code.funcstate.release_temp(sublist_temp)
code.putln('#endif') code.putln('#endif')
......
...@@ -2046,6 +2046,7 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -2046,6 +2046,7 @@ class FuncDefNode(StatNode, BlockNode):
if err_val is None and default_retval: if err_val is None and default_retval:
err_val = default_retval err_val = default_retval
if err_val is not None: if err_val is not None:
if err_val != Naming.retval_cname:
code.putln("%s = %s;" % (Naming.retval_cname, err_val)) code.putln("%s = %s;" % (Naming.retval_cname, err_val))
elif not self.return_type.is_void: elif not self.return_type.is_void:
code.putln("__Pyx_pretend_to_initialize(&%s);" % Naming.retval_cname) code.putln("__Pyx_pretend_to_initialize(&%s);" % Naming.retval_cname)
......
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