From: Robert Bradshaw Date: Fri, 30 Oct 2009 06:23:27 +0000 (-0700) Subject: remove sage-specific and unused incref-local-binop option X-Git-Tag: 0.12.alpha0~8^2~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d0d88e682543af4efc68a4b28f912e0490f69fc8;p=cython.git remove sage-specific and unused incref-local-binop option --- diff --git a/Cython/Compiler/CmdLine.py b/Cython/Compiler/CmdLine.py index 3451e734..0a9e7c68 100644 --- a/Cython/Compiler/CmdLine.py +++ b/Cython/Compiler/CmdLine.py @@ -27,8 +27,6 @@ Options: -z, --pre-import If specified, assume undeclared names in this module. Emulates the behavior of putting "from import *" at the top of the file. - --incref-local-binop Force local an extra incref on local variables before - performing any binary operations. --cleanup Release interned objects on python exit, for memory debugging. Level indicates aggressiveness, default 0 releases nothing. -w, --working Sets the working directory for Cython (the directory modules @@ -108,8 +106,6 @@ def parse_command_line(args): Options.embed_pos_in_docstring = 1 elif option in ("-z", "--pre-import"): Options.pre_import = pop_arg() - elif option == "--incref-local-binop": - Options.incref_local_binop = 1 elif option == "--cleanup": Options.generate_cleanup_code = int(pop_arg()) elif option in ("-D", "--no-docstrings"): diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 9e44753f..90a0671c 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -4488,8 +4488,6 @@ class BinopNode(ExprNode): self.coerce_operands_to_pyobjects(env) self.type = py_object_type self.is_temp = 1 - if Options.incref_local_binop and self.operand1.type.is_pyobject: - self.operand1 = self.operand1.coerce_to_temp(env) else: self.analyse_c_operation(env) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 8b37eb86..b42694a1 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -3092,8 +3092,6 @@ class InPlaceAssignmentNode(AssignmentNode): self.dup = self.create_dup_node(env) # re-assigns lhs to a shallow copy self.rhs.analyse_types(env) self.lhs.analyse_target_types(env) - if Options.incref_local_binop and self.dup.type.is_pyobject: - self.dup = self.dup.coerce_to_temp(env) import ExprNodes if self.lhs.type.is_pyobject: self.rhs = self.rhs.coerce_to_pyobject(env) diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py index c8aeda81..fbf39f33 100644 --- a/Cython/Compiler/Options.py +++ b/Cython/Compiler/Options.py @@ -10,12 +10,6 @@ gcc_branch_hints = 1 pre_import = None docstrings = True -# This is a SAGE-specific option that will -# cause Cython to incref local variables before -# performing a binary operation on them, for -# safe detection of inplace operators. -incref_local_binop = 0 - # Decref global variables in this module on exit for garbage collection. # 0: None, 1+: interned objects, 2+: cdef globals, 3+: types objects # Mostly for reducing noise for Valgrind, only executes at process exit