summaryrefslogtreecommitdiff
path: root/Cython/Compiler/Pipeline.py
Commit message (Collapse)AuthorAgeFilesLines
* Order merged_in utility code (#5282)da-woods2023-03-011-2/+3
| | | | | | Force utility code to come before pxd code which comes before module code. This specifically fixes #5269, (where the "ToPy" functions for cpdef enums weren't availbale when cyfunctions were created). But I think it's a good idea anyway.
* Allow C code assertions in tests by defining regular expressions in module ↵scoder2022-07-301-6/+9
| | | | directives. (GH-4938)
* Minor code simplification.Stefan Behnel2022-01-061-4/+1
|
* Avoid some useless overhead in "inject_utility_code_stage".Stefan Behnel2022-01-061-22/+27
|
* Revert "Avoid some useless overhead in "inject_utility_code_stage"."Stefan Behnel2022-01-061-25/+21
| | | | This reverts commit e9435cd92d3a060c1a204f57b9ee2ebb3a46988c.
* Avoid some useless overhead in "inject_utility_code_stage".Stefan Behnel2022-01-051-21/+25
|
* Simplify some code.Stefan Behnel2022-01-041-5/+3
|
* Avoid unnecessary directives tracking in the WithTransform since it does not ↵Stefan Behnel2022-01-031-1/+1
| | | | need it.
* Print pipeline timings after test runs.Stefan Behnel2022-01-011-16/+45
|
* Use thread-local storage for the global Errors state to allow threaded ↵scoder2021-12-201-2/+2
| | | | | | | | | builds. (GH-4507) Distutils uses threading internally. Also silence some warnings about redefined classes and function signatures when setting up the builtin scope. This is at most a second-best solution since we may not notice legitimate bugs on our side this way. Better make sure we have good test coverage of builtins and related optimisations. Closes https://github.com/cython/cython/issues/4503
* Add directive "cpp_locals" to handle C++ variables using std::optional (GH-4225)da-woods2021-06-291-1/+2
| | | | | This avoids the need for default constructors of stack allocated variables and temps by allowing late initialisation. Closes https://github.com/cython/cython/issues/4160
* Execute AlignFunctionDefinitions before MarkClosureTransform. (GH-4127)Matus Valo2021-05-111-3/+4
| | | | This commit fixes a crash of Cython when generator expressions are used in cdef functions in pure python mode. Closes https://github.com/cython/cython/issues/3477
* Fix some issues with duplicated utilitycode (GH-3743)da-woods2021-03-271-2/+16
| | | | | | | | | * Avoid UtilityCode from cimport_from_pyx files * Unique names for generated cfunc wrappers, avoid pxd pickle code * Set .in_pxd on nodes prior to analyse_declarations Fixes #3716 Fixes #3741 Fixes #3734
* Fix many indentation and whitespace issues throughout the code base (GH-3673)scoder2020-06-101-1/+1
| | | … and enforce them with pycodestyle.
* Ensure utility code keeps the directives that it was compiled with (GH-3615)da-woods2020-05-171-1/+2
| | | When it's merged into the main module, wrap it in a CompilerDirectivesNode.
* Rewrite the C property feature (GH-3571)scoder2020-05-041-2/+1
| | | | | | | | | | | * Rewrite C property support (GH-2640) based on inline C methods. Supersedes GH-2640 and GH-3095. Closes GH-3521. * Test fix for `numpy_parallel.pyx`: avoid depending on whether "nd.shape" requires the GIL or not. * Turn NumPy's "ndarray.data" into a property to avoid direct struct access. * Make "ndarray.size" accessible without the GIL.
* add a new ReplacePropertyNode passmattip2018-11-131-1/+2
|
* Make raise-statements inside of nogil blocks automatically acquire the GIL, ↵Stefan Behnel2018-06-031-1/+2
| | | | instead of requiring an explicit ``with gil`` block around them.
* Make compiler pipeline a bit nicer to profile.Stefan Behnel2017-08-211-3/+17
|
* Simplify TrackNumpyAttributes transform.Stefan Behnel2017-08-211-2/+1
|
* Always report fatal errors.Robert Bradshaw2017-07-081-1/+1
| | | | | | Previously these could be suppressed if error holding was in place. This was noticed in #1746.
* Add a Pythran backend for Numpy operationAdrien Guinet2017-06-171-1/+2
| | | | | | | | | | | | When the user asked for it (thanks to the --np-pythran flag), use Pythran's Numpy implementation as a backend for numpy operation. This flag forces the C++ mode, as the Pythran implementation is written in C++. Distutils integration through the 'np_pythran' flag of the cythonize API is also provided. This commit also adds a Pythran mode for the tests, that can enable the pythran mode for the C++ tests, and allows the reuse of Cython tests to test for the Pythran integration.
* rely on code generation phase to include required utility code instead of ↵Stefan Behnel2016-08-141-25/+0
| | | | always including all of it in a separate pipeline phase
* merge DecoratorTransform and PropertyTransformStefan Behnel2015-11-071-2/+1
|
* Add a pass transforming Python-style properties in cdef class into ↵Emmanuel Gil Peyrot2015-11-051-1/+2
| | | | | | | | | | Cython-style properties. This makes properties work properly in cdef classes, and gives them the exact same AST as the “property something:” blocks, whose syntax should probably be deprecated now. Fixes T264.
* pass correct CythonScope into CythonUtilityScope tree generation (used to be ↵Stefan Behnel2015-10-261-1/+1
| | | | None)
* minor code reformattingStefan Behnel2015-09-171-0/+5
|
* More determanistic utility code ordering.Robert Bradshaw2015-09-051-5/+4
|
* Fix a couple of tests due to utility code changes.Robert Bradshaw2015-09-031-1/+3
|
* Make cpdef enums into first-class types.Robert Bradshaw2015-09-031-0/+25
| | | | | | | | | | | | | | For example cpdef enum Eggs SOFT HARD SCRAMBLED produces three constants with int values that print as strings, and a type Eggs with attributes Eggs.SOFT, etc. and list(Eggs) giving the set of all enum values. Instantiating Eggs with a numeric or string value will return the appropriate constant.
* Merge branch '0.23.x'Stefan Behnel2015-08-091-0/+1
|\
| * fix #855: make "import *" include all necessary "from_py" coercion helper ↵Stefan Behnel2015-08-091-0/+1
| | | | | | | | functions
* | minor code beautificationStefan Behnel2015-08-091-2/+8
|/
* adapt some more syntax to Py2/Py3Stefan Behnel2015-07-251-3/+3
|
* make dict iteration compatible with Py2/Py3Stefan Behnel2015-07-251-2/+2
|
* 2to3: Apply the 'except' fixerPetr Viktorin2015-07-251-3/+3
|
* implement "async with" (PEP 492)Stefan Behnel2015-05-231-1/+1
|
* Undo --embed -> __main__ conversion.Robert Bradshaw2015-04-271-4/+1
|
* Rename module to __main__ in embed mode.Robert Bradshaw2015-04-241-3/+5
| | | | | | This is more consistent with the execution of "python foo.py" and also allows for compilation of files that don't obey the module naming rules.
* change pipeline order to include tree changes made by structural optimisers ↵Stefan Behnel2015-03-191-2/+2
| | | | in OptimizeBuiltinCalls run
* remove unclear comment and add docstring to explain whyStefan Behnel2014-11-151-1/+1
| | | | | --HG-- extra : transplant_source : %C4Y%8Fo%10QD%23%A6%FB%B6%AF%3B%D6%C9%A9%09%C4%0D%A8
* use explicit relative imports everywhere and enable absolute imports by defaultStefan Behnel2014-06-171-38/+38
|
* add a directive to disable SwitchTransformAlok Singhal2014-04-221-1/+1
| | | | | SwitchTransform is unable to detect all cases of duplicate values, which result in errors at compile time in the generated code.
* fix some unnecessary Py2-isms in the code baseStefan Behnel2014-01-171-1/+1
|
* Cimported name mangling.Robert Bradshaw2014-01-071-0/+4
|
* Add support for external C++ template functions.Robert Bradshaw2013-12-261-1/+1
| | | | | | The syntax follows that of template classes, namely cdef T foo[T](T, ...)
* fix crash when looking up closure names in OptimizeBuiltinCalls transform ↵Stefan Behnel2013-12-241-1/+1
| | | | (after running CreateClosureClasses transform)
* move qualname calculation transform a little later in the pipelineStefan Behnel2013-11-161-1/+1
|
* reimplement PEP 3155 __qualname__ calculation in a dedicated transform to ↵Stefan Behnel2013-11-151-0/+2
| | | | base it on the node structure instead of the scopes (which fails for class scopes)
* In cimport_from_pyx mode don't treat "cdef extern from" variables as being ↵Nikita Nemkin2013-04-061-1/+2
| | | | defined, preventing erroneous cross-module cimport.