platform/upstream/python-cython.git
10 years agomake intermediate goto-labels more readable by postfixing them with their purpose
Stefan Behnel [Mon, 16 Dec 2013 22:39:29 +0000 (23:39 +0100)]
make intermediate goto-labels more readable by postfixing them with their purpose

10 years agoremove unnecessary code from normal exit case of with-statement
Stefan Behnel [Mon, 16 Dec 2013 22:25:50 +0000 (23:25 +0100)]
remove unnecessary code from normal exit case of with-statement

10 years agostreamline exit code of with-statement
Stefan Behnel [Mon, 16 Dec 2013 22:16:27 +0000 (23:16 +0100)]
streamline exit code of with-statement

10 years agoreduce lifetime of exception tuple in with-statement exception exit case by making...
Stefan Behnel [Mon, 16 Dec 2013 21:38:34 +0000 (22:38 +0100)]
reduce lifetime of exception tuple in with-statement exception exit case by making the WithExitCallNode own it instead of the exception clause

10 years agoreduce code overhead of with-statement a bit by using PyTuple_Pack() for __exit__...
Stefan Behnel [Mon, 16 Dec 2013 21:06:52 +0000 (22:06 +0100)]
reduce code overhead of with-statement a bit by using PyTuple_Pack() for __exit__() arguments

10 years agoimplement Python corner case of passing a tuple as assert message
Stefan Behnel [Mon, 16 Dec 2013 20:54:06 +0000 (21:54 +0100)]
implement Python corner case of passing a tuple as assert message

10 years agoimprove annotation for else-clause in while-loop
Stefan Behnel [Mon, 16 Dec 2013 19:46:36 +0000 (20:46 +0100)]
improve annotation for else-clause in while-loop

10 years agodrop some redundant C labels in if-blocks
Stefan Behnel [Mon, 16 Dec 2013 19:38:34 +0000 (20:38 +0100)]
drop some redundant C labels in if-blocks

--HG--
extra : amend_source : affe6e89d8c2c49654f376fbbda3b1ad29190895

10 years agooptimise list.pop() a little more by splitting it off the generic anyobj.pop() implem...
Stefan Behnel [Mon, 16 Dec 2013 19:16:46 +0000 (20:16 +0100)]
optimise list.pop() a little more by splitting it off the generic anyobj.pop() implementation

10 years agoadd and improve some more may_be_none() methods
Stefan Behnel [Mon, 16 Dec 2013 18:34:39 +0000 (19:34 +0100)]
add and improve some more may_be_none() methods

10 years agofix typo
Stefan Behnel [Mon, 16 Dec 2013 18:09:54 +0000 (19:09 +0100)]
fix typo

10 years agomake CallNode a little smarter about when the return value can be None
Stefan Behnel [Mon, 16 Dec 2013 18:08:53 +0000 (19:08 +0100)]
make CallNode a little smarter about when the return value can be None

10 years agolet SliceNode know it returns a slice instance
Stefan Behnel [Mon, 16 Dec 2013 17:55:54 +0000 (18:55 +0100)]
let SliceNode know it returns a slice instance

10 years agobe a bit smarter about when slicing or item access return None
Stefan Behnel [Mon, 16 Dec 2013 17:39:53 +0000 (18:39 +0100)]
be a bit smarter about when slicing or item access return None

--HG--
extra : amend_source : 51a4e6ec35c70af746630fcada3982c2decde872

10 years agofix compiler crash
Stefan Behnel [Sun, 15 Dec 2013 09:20:58 +0000 (10:20 +0100)]
fix compiler crash

10 years agomake sure the optimised try-finally always generates code for the original finally...
Stefan Behnel [Sat, 14 Dec 2013 20:15:45 +0000 (21:15 +0100)]
make sure the optimised try-finally always generates code for the original finally block subtree (just in case it references something external)

10 years agofix typo
Stefan Behnel [Sat, 14 Dec 2013 19:57:01 +0000 (20:57 +0100)]
fix typo

10 years agodiscard else clause from try-except statements that do not terminate normally
Stefan Behnel [Sat, 14 Dec 2013 19:39:37 +0000 (20:39 +0100)]
discard else clause from try-except statements that do not terminate normally

10 years agofix C compiler warning about unused variable
Stefan Behnel [Sat, 14 Dec 2013 19:25:21 +0000 (20:25 +0100)]
fix C compiler warning about unused variable

10 years agoextend test
Stefan Behnel [Sat, 14 Dec 2013 19:11:46 +0000 (20:11 +0100)]
extend test

10 years agochangelog
Stefan Behnel [Sat, 14 Dec 2013 19:11:38 +0000 (20:11 +0100)]
changelog

10 years agogenerate separate C code branches for each exit case of a try-finally statement
Stefan Behnel [Sat, 14 Dec 2013 19:11:02 +0000 (20:11 +0100)]
generate separate C code branches for each exit case of a try-finally statement

10 years agominor code cleanup
Stefan Behnel [Sat, 14 Dec 2013 16:29:37 +0000 (17:29 +0100)]
minor code cleanup

--HG--
extra : amend_source : c948151354a77be026c92d57abc151e51fb271c6

10 years agomark node position in C file when starting to generate the node's code, not that...
Stefan Behnel [Sat, 14 Dec 2013 15:58:10 +0000 (16:58 +0100)]
mark node position in C file when starting to generate the node's code, not that of the subexpressions

--HG--
extra : amend_source : 566ce3ed6bd0efbb075126a6c5823b773c72d2ea

10 years agoset constant_result of empty containers created in ConstantFolding transform
Stefan Behnel [Sat, 14 Dec 2013 13:26:12 +0000 (14:26 +0100)]
set constant_result of empty containers created in ConstantFolding transform

10 years agofix constant folding with false partial result
Stefan Behnel [Sat, 14 Dec 2013 11:05:36 +0000 (12:05 +0100)]
fix constant folding with false partial result

10 years agoundo the Python-optimisationism of assigning bound/unbound methods to local variables...
Stefan Behnel [Sat, 14 Dec 2013 10:59:47 +0000 (11:59 +0100)]
undo the Python-optimisationism of assigning bound/unbound methods to local variables when Cython can call a builtin C function instead

--HG--
extra : amend_source : 121eadd540f25f9e43f6e6b60853eeab18d11620

10 years agoremove redundant code
Stefan Behnel [Fri, 13 Dec 2013 20:37:08 +0000 (21:37 +0100)]
remove redundant code

10 years agosimplify constant folded comparison code a little and extend the test for it
Stefan Behnel [Fri, 13 Dec 2013 20:31:26 +0000 (21:31 +0100)]
simplify constant folded comparison code a little and extend the test for it

10 years agoundo accidental commit
Stefan Behnel [Fri, 13 Dec 2013 19:34:17 +0000 (20:34 +0100)]
undo accidental commit

10 years agofix tracing again
Stefan Behnel [Fri, 13 Dec 2013 19:31:29 +0000 (20:31 +0100)]
fix tracing again

10 years agofix tracing in recent Py3.4
Stefan Behnel [Fri, 13 Dec 2013 13:41:00 +0000 (14:41 +0100)]
fix tracing in recent Py3.4

10 years agolet RemoveUnreachableCode discard any PassStatNodes (e.g. added by analysing declarat...
Stefan Behnel [Thu, 12 Dec 2013 18:38:04 +0000 (19:38 +0100)]
let RemoveUnreachableCode discard any PassStatNodes (e.g. added by analysing declaration-only ExprStatNode)

10 years agofix C compiler warning about unused utility code
Stefan Behnel [Thu, 12 Dec 2013 17:17:33 +0000 (18:17 +0100)]
fix C compiler warning about unused utility code

--HG--
extra : rebase_source : 2e86ee2423754e0cfa6e79b33b9570a25a019c01

10 years agoUse makedirs rather than mkdir for cache location.
Robert Bradshaw [Thu, 12 Dec 2013 05:40:09 +0000 (21:40 -0800)]
Use makedirs rather than mkdir for cache location.

10 years agoUse default location ~/.cycache when cython cache is set to True.
Robert Bradshaw [Thu, 12 Dec 2013 05:33:04 +0000 (21:33 -0800)]
Use default location ~/.cycache when cython cache is set to True.

10 years agominor code cleanup
Stefan Behnel [Wed, 11 Dec 2013 21:39:48 +0000 (22:39 +0100)]
minor code cleanup

10 years agoclean up IntNode() instantiation
Stefan Behnel [Wed, 11 Dec 2013 21:35:24 +0000 (22:35 +0100)]
clean up IntNode() instantiation

10 years agominor portability tweak: mark non-tiny integer literals as C longs with "L" suffix...
Stefan Behnel [Wed, 11 Dec 2013 21:12:55 +0000 (22:12 +0100)]
minor portability tweak: mark non-tiny integer literals as C longs with "L" suffix when passing them into PyInt_FromLong()

10 years agotweak order of constant generation a bit
Stefan Behnel [Wed, 11 Dec 2013 21:00:54 +0000 (22:00 +0100)]
tweak order of constant generation a bit

10 years agoremove some code redundancy
Stefan Behnel [Wed, 11 Dec 2013 20:56:03 +0000 (21:56 +0100)]
remove some code redundancy

10 years agoremove some unused code
Stefan Behnel [Wed, 11 Dec 2013 20:45:11 +0000 (21:45 +0100)]
remove some unused code

10 years agoavoid accidental duplication of cached Python integer constants when using numbers...
Stefan Behnel [Wed, 11 Dec 2013 20:41:10 +0000 (21:41 +0100)]
avoid accidental duplication of cached Python integer constants when using numbers in different notations

10 years agofix syntax copy&pastos
Stefan Behnel [Wed, 11 Dec 2013 18:38:49 +0000 (19:38 +0100)]
fix syntax copy&pastos

10 years agofix C compiler warnings about unused variables in tests
Stefan Behnel [Wed, 11 Dec 2013 18:16:20 +0000 (19:16 +0100)]
fix C compiler warnings about unused variables in tests

10 years agotry fixing test failures in int_literals.pyx by removing dependency on Py2/3 specific...
Stefan Behnel [Wed, 11 Dec 2013 18:02:23 +0000 (19:02 +0100)]
try fixing test failures in int_literals.pyx by removing dependency on Py2/3 specific 'L' postfix of long objects

10 years agoremove unnecessary complication from test
Stefan Behnel [Wed, 11 Dec 2013 07:20:09 +0000 (08:20 +0100)]
remove unnecessary complication from test

10 years agouse normal constant calculation for special case to avoid inconsistencies
Stefan Behnel [Tue, 10 Dec 2013 20:00:10 +0000 (21:00 +0100)]
use normal constant calculation for special case to avoid inconsistencies

10 years agorewrite constant folding for PrimaryCmpNode to properly support (and fix) cascaded...
Stefan Behnel [Tue, 10 Dec 2013 19:52:02 +0000 (20:52 +0100)]
rewrite constant folding for PrimaryCmpNode to properly support (and fix) cascaded comparisons

10 years agoremove outdated comment
Stefan Behnel [Mon, 9 Dec 2013 07:38:53 +0000 (08:38 +0100)]
remove outdated comment

10 years agofix test after making constant folding remove unused constants
Stefan Behnel [Sun, 8 Dec 2013 14:16:49 +0000 (15:16 +0100)]
fix test after making constant folding remove unused constants

10 years agofix compiler crash
Stefan Behnel [Sun, 8 Dec 2013 14:12:55 +0000 (15:12 +0100)]
fix compiler crash

10 years agodiscard lots of useless code and overhead from try-finally statements that don't...
Stefan Behnel [Sun, 8 Dec 2013 13:51:43 +0000 (14:51 +0100)]
discard lots of useless code and overhead from try-finally statements that don't need to handle Python exceptions (including C-only with-blocks)

10 years agoadd test for empty try-finally
Stefan Behnel [Sun, 8 Dec 2013 11:49:46 +0000 (12:49 +0100)]
add test for empty try-finally

10 years agofix Py2.4 C compilation problem
Stefan Behnel [Sun, 8 Dec 2013 11:25:50 +0000 (12:25 +0100)]
fix Py2.4 C compilation problem

10 years agofix problematic constant folding condition in cascaded comparisons (even though it...
Stefan Behnel [Sun, 8 Dec 2013 11:22:44 +0000 (12:22 +0100)]
fix problematic constant folding condition in cascaded comparisons (even though it likely doesn't work anyway)

10 years agoprevent compile time constant folding of non-portable string comparisons (e.g. betwee...
Stefan Behnel [Sun, 8 Dec 2013 11:13:35 +0000 (12:13 +0100)]
prevent compile time constant folding of non-portable string comparisons (e.g. between bytes and str)

10 years agoremove unused code
Stefan Behnel [Sun, 8 Dec 2013 10:17:00 +0000 (11:17 +0100)]
remove unused code

10 years agodiscard ExprStatNodes with constant expressions
Stefan Behnel [Sun, 8 Dec 2013 10:15:59 +0000 (11:15 +0100)]
discard ExprStatNodes with constant expressions

10 years agoadd some safety checks to the shared common types import
Stefan Behnel [Sun, 8 Dec 2013 08:12:44 +0000 (09:12 +0100)]
add some safety checks to the shared common types import

10 years agoavoid risk of stale pointers by looking up Cython types module on each request (shoul...
Stefan Behnel [Sun, 8 Dec 2013 07:56:27 +0000 (08:56 +0100)]
avoid risk of stale pointers by looking up Cython types module on each request (shouldn't hurt much to do it a couple of times during module initialisation)

10 years agosimplify common type sharing code and fix ref-count inconsistency
Stefan Behnel [Sun, 8 Dec 2013 07:34:37 +0000 (08:34 +0100)]
simplify common type sharing code and fix ref-count inconsistency

10 years agodisable docstring check in pylint
Stefan Behnel [Sat, 7 Dec 2013 20:47:57 +0000 (21:47 +0100)]
disable docstring check in pylint

10 years agofix crash during C++ class type inference
Stefan Behnel [Sat, 7 Dec 2013 14:52:10 +0000 (15:52 +0100)]
fix crash during C++ class type inference

10 years agofix bytes.join() in Py<=2.5
Stefan Behnel [Sat, 7 Dec 2013 14:44:15 +0000 (15:44 +0100)]
fix bytes.join() in Py<=2.5

10 years agofix return type of repr(): CPython guarantees to return str
Stefan Behnel [Sat, 7 Dec 2013 13:15:13 +0000 (14:15 +0100)]
fix return type of repr(): CPython guarantees to return str

10 years agoalso optimise basestring.join() since we now infer this type in a couple of places
Stefan Behnel [Sat, 7 Dec 2013 13:08:03 +0000 (14:08 +0100)]
also optimise basestring.join() since we now infer this type in a couple of places

10 years agooptimise str/bytes.join() and infer the result type; improve type inference for calle...
Stefan Behnel [Sat, 7 Dec 2013 12:30:03 +0000 (13:30 +0100)]
optimise str/bytes.join() and infer the result type; improve type inference for called builtins

10 years agorefactor duplicated code
Stefan Behnel [Sat, 7 Dec 2013 09:31:57 +0000 (10:31 +0100)]
refactor duplicated code

10 years agodiscard useless (PyObject*) casts from values of builtin types which are PyObject...
Stefan Behnel [Sat, 7 Dec 2013 07:24:56 +0000 (08:24 +0100)]
discard useless (PyObject*) casts from values of builtin types which are PyObject* internally anyway (saves lots of C code)

10 years agoset another string length field in exception message format
Stefan Behnel [Sat, 7 Dec 2013 07:04:15 +0000 (08:04 +0100)]
set another string length field in exception message format

10 years agoset another string length field in exception message format
Stefan Behnel [Sat, 7 Dec 2013 07:01:35 +0000 (08:01 +0100)]
set another string length field in exception message format

10 years agoavoid useless signedness checks in overflow handling when we know the type is signed
Stefan Behnel [Sat, 7 Dec 2013 06:54:17 +0000 (07:54 +0100)]
avoid useless signedness checks in overflow handling when we know the type is signed

10 years agoundo condition change in struct conversion - was required in case of utility code...
Stefan Behnel [Sat, 7 Dec 2013 06:17:58 +0000 (07:17 +0100)]
undo condition change in struct conversion - was required in case of utility code creation

10 years agoFix compiler crash in isinstance optimization.
Robert Bradshaw [Sat, 7 Dec 2013 05:37:09 +0000 (21:37 -0800)]
Fix compiler crash in isinstance optimization.

10 years agoreformat some code
Stefan Behnel [Fri, 6 Dec 2013 22:44:08 +0000 (23:44 +0100)]
reformat some code

10 years agofix condition to make struct conversion generate struct field conversion helpers...
Stefan Behnel [Fri, 6 Dec 2013 22:35:05 +0000 (23:35 +0100)]
fix condition to make struct conversion generate struct field conversion helpers at need

--HG--
extra : amend_source : 240f49031159777036e1e6a139b6d736f59de337

10 years agoclean up lots of places where exceptions are being raised to reduce the message build...
Stefan Behnel [Fri, 6 Dec 2013 22:15:59 +0000 (23:15 +0100)]
clean up lots of places where exceptions are being raised to reduce the message building overhead

10 years agofix C compiler warning when checking int overflow for division by enum values on...
Stefan Behnel [Fri, 6 Dec 2013 21:25:19 +0000 (22:25 +0100)]
fix C compiler warning when checking int overflow for division by enum values on 32 bit systems (in case anyone cares...)

10 years agominor improvements in __Pyx_ArgTypeTest() and prevent it from raising C compiler...
Stefan Behnel [Fri, 6 Dec 2013 20:57:32 +0000 (21:57 +0100)]
minor improvements in __Pyx_ArgTypeTest() and prevent it from raising C compiler warnings by inlining it

10 years agofix for-in loop variable inference after enabling list/tuple item type inference
Stefan Behnel [Fri, 6 Dec 2013 18:07:18 +0000 (19:07 +0100)]
fix for-in loop variable inference after enabling list/tuple item type inference

10 years agoextend test
Stefan Behnel [Fri, 6 Dec 2013 17:58:01 +0000 (18:58 +0100)]
extend test

10 years agoinfer type of items in tuple/list constants on indexing (especially where all items...
Stefan Behnel [Fri, 6 Dec 2013 17:18:37 +0000 (18:18 +0100)]
infer type of items in tuple/list constants on indexing (especially where all items have the same type)

--HG--
extra : amend_source : 1e8bf2d512c244f48654f43e37283d800e5d961a

10 years agoimprove type inference for string %/+/* operations and use more direct C-API calls...
Stefan Behnel [Fri, 6 Dec 2013 14:22:52 +0000 (15:22 +0100)]
improve type inference for string %/+/* operations and use more direct C-API calls for these unicode operations

10 years agominor fix
Stefan Behnel [Thu, 5 Dec 2013 18:46:52 +0000 (19:46 +0100)]
minor fix

10 years agoconstant fold in-tests against empty containers
Stefan Behnel [Sun, 1 Dec 2013 19:02:47 +0000 (20:02 +0100)]
constant fold in-tests against empty containers

--HG--
extra : amend_source : 6fe9294d38a26b208899453b4a12739dcc496c16

10 years agominor code cleanups
Stefan Behnel [Sun, 1 Dec 2013 18:43:44 +0000 (19:43 +0100)]
minor code cleanups

10 years agoallow visitor dispatch methods in pylint
Stefan Behnel [Sun, 1 Dec 2013 17:09:04 +0000 (18:09 +0100)]
allow visitor dispatch methods in pylint

10 years agosimplify some code
Stefan Behnel [Sun, 1 Dec 2013 17:04:46 +0000 (18:04 +0100)]
simplify some code

10 years agostrip multiplication factor when recursively folding empty sequences
Stefan Behnel [Sun, 1 Dec 2013 16:58:58 +0000 (17:58 +0100)]
strip multiplication factor when recursively folding empty sequences

10 years agofix glitch in constant folding of slices
Stefan Behnel [Sun, 1 Dec 2013 16:51:48 +0000 (17:51 +0100)]
fix glitch in constant folding of slices

10 years agoconstant fold some more special cases for list/tuple multiplication
Stefan Behnel [Sun, 1 Dec 2013 15:31:55 +0000 (16:31 +0100)]
constant fold some more special cases for list/tuple multiplication

10 years agostrip mult-factor from empty list literals
Stefan Behnel [Sun, 1 Dec 2013 15:10:01 +0000 (16:10 +0100)]
strip mult-factor from empty list literals

10 years agopre-calculate constant loop length when iterating over literal tuples/lists
Stefan Behnel [Sun, 1 Dec 2013 15:02:57 +0000 (16:02 +0100)]
pre-calculate constant loop length when iterating over literal tuples/lists

10 years agodiscard constant True condition in while loops
Stefan Behnel [Sun, 1 Dec 2013 14:37:05 +0000 (15:37 +0100)]
discard constant True condition in while loops

10 years agoget rid of 'yellow last line' problem by assigning the function exit error handling...
Stefan Behnel [Sun, 1 Dec 2013 08:19:03 +0000 (09:19 +0100)]
get rid of 'yellow last line' problem by assigning the function exit error handling and default value return code to the signature line instead of the last code line

10 years agofix annotation for generated Python function wrapper
Stefan Behnel [Sun, 1 Dec 2013 07:59:47 +0000 (08:59 +0100)]
fix annotation for generated Python function wrapper

10 years agofix annotation score calculation
Stefan Behnel [Sun, 1 Dec 2013 07:56:06 +0000 (08:56 +0100)]
fix annotation score calculation

10 years agofix copy&past bug
Stefan Behnel [Sat, 30 Nov 2013 20:07:38 +0000 (21:07 +0100)]
fix copy&past bug

10 years agoclean up some code
Stefan Behnel [Sat, 30 Nov 2013 19:58:35 +0000 (20:58 +0100)]
clean up some code