summaryrefslogtreecommitdiff
path: root/Cython/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* Make CodeWriter inherit from ExpressionWriter in order to support all kinds ↵full_code_writerStefan Behnel2020-04-181-0/+3
| | | | of expressions without duplicating code.
* Merge branch '0.29.x'Stefan Behnel2020-04-171-0/+1
|\
| * Clear "self.index_temps" after cleanup to avoid keeping dangling temporary ↵Stefan Behnel2020-04-171-0/+1
| | | | | | | | state.
| * Cleanup more generator temps (GH-3522)Stefan Behnel2020-04-171-11/+12
| | | | | | | | | | * Fixed indexing temps for non-python objects. * Moved cleanup into release_temps since the temps survived into the result_code.
| * Release temps used for buffer indexing after use (GH-3517)da-woods2020-04-151-3/+10
| | | | | | Closes https://github.com/cython/cython/issues/3430
| * Prevent calling PyObject_GC_Track() in __Pyx_CyFunction_New() when ↵Stefan Behnel2020-04-131-2/+2
| | | | | | | | | | | | | | | | instantiating a fused function before the object fields of the fused function subtype are fully initialised. See https://bugs.python.org/issue38392 Closes GH-3215. Supersedes GH-3216.
| * Only use PyUnicode_Concat on unicode object operations (GH-3433)da-woods2020-03-211-11/+16
| |
* | Add comment and make sure the type's (empty) list of index temps cannot be ↵Stefan Behnel2020-04-171-1/+2
| | | | | | | | changed by accident.
* | Cleanup more generator temps (GH-3522)da-woods2020-04-171-11/+12
| | | | | | | | | | | | * Fixed indexing temps for non-python objects. * Release another temp in PyMethodCallNode. Was causing warnings in generators_py. * Moved cleanup into release_temps since the temps survived into the result_code.
* | Prevent fused dispatcher optional arguments being overwritten (GH-3519)da-woods2020-04-152-10/+15
| | | | | | | | | | | | | | | | | | * Prevent fused dispatcher optional arguments being overwritten If the 5th argument of the regular functions was optional it'd overwrite the _fused_sigindex default of the dispatcher, causing type errors at runtime. closes https://github.com/cython/cython/issues/3511
* | Release temps used for buffer indexing after use (GH-3517)da-woods2020-04-151-3/+10
| | | | | | Closes https://github.com/cython/cython/issues/3430
* | Drop unused code-paths associated with "if cython.compiled" early (GH-3507)da-woods2020-04-131-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows things to work like: # in pxd file from libc.math cimport sin # in py file if not cython.compiled: from math import sin # previously failed with cython compile # error because it was assigning to a cdef name This seems worthwhile because it makes it easier to write code that re-assigns cdef names and so works in both modes.
* | Fixed all assignments being added to the module in the limited API (GH-3501)da-woods2020-04-121-9/+8
| | | | | | Mainly helps for adding attributes to classes, but undoubtedly fixes other things too.
* | Fix refleak in limited-api case for cross-module shared extension types and ↵Stefan Behnel2020-04-111-2/+2
| | | | | | | | store them correctly as PyTypeObject* instead of a generic (and unusable) PyObject*.
* | Remove incorrect error handling in limited-api case.Stefan Behnel2020-04-111-1/+2
| |
* | Prevent calling PyObject_GC_Track() in __Pyx_CyFunction_New() when ↵Stefan Behnel2020-04-111-2/+2
| | | | | | | | | | | | | | | | instantiating a fused function before the object fields of the fused function subtype are fully initialised. See https://bugs.python.org/issue38392 Closes GH-3215. Supersedes GH-3216.
* | Add __Pyx_IS_TYPE() macro to mimic the new "Py_IS_TYPE()" macro in CPython ↵Stefan Behnel2020-04-111-1/+1
| | | | | | | | 3.9 that replaces the "Py_TYPE() == …" type check pattern.
* | Prepare automatically setting Py_LIMITED_API (once it's ready).Stefan Behnel2020-04-101-0/+2
| |
* | Fix fix unicode normalisation test in Windows. (GH-3194)Stefan Behnel2020-04-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rewrite the test code generation for the unicode normalisation test, making sure that we always write UTF-8 source files. * Fix failures to print the compilation status for modules with non-ascii names (on Windows). * Help with remote debugging environment encoding problems in test runs, by extending the output of the "buildenv" pseudo-test. * Explicitly set I/O encoding for subprocesses in parallel cythonize() runs to make the test runner workers inherit it (instead of defaulting to ASCII in Py2). * Use a Latin-1 Unicode character in the test for Unicode module names to make it more compatible with Windows file system character sets (such as CP-1252). * Properly decode source and module file name from the FS encoding in Py2. Previously, with ASCII module names, UTF-8 decoding always worked, but wasn't correct. * Hack around a distutils 3.[5678] bug on Windows for unicode module names. https://bugs.python.org/issue39432 * Try to fix cython.inline() on Windows with Py3.8+ where the DLL loading requires an explicit registration of the extension output directory. Closes GH-3450.
* | Avoid calling PySequence_List() in some cases if the argument is a new list ↵Stefan Behnel2020-04-082-5/+20
| | | | | | | | already. (GH-3494)
* | Make the fused dispatch function safe w.r.t. user defined ↵da-woods2020-04-081-3/+3
| | | | | | | | | | | | | | wraparound/boundscheck (GH-3493) The directives are currently inherited from user code, which is not correct, but it seemed difficult to reliably change the directives applied to the `__pyx_fused_cpdef` dispatch function, so instead the code was changed to be independent. Fixes https://github.com/cython/cython/issues/3492
* | Avoid creating unused "__defaults__" getter functions for fused dispatch ↵Stefan Behnel2020-04-072-4/+4
| | | | | | | | | | function. (GH-3491) Closes GH-3481.
* | Fix return type assumption about optimised str() call in Py2.Stefan Behnel2020-04-021-1/+1
| |
* | Concatenate strings in place if possible (GH-3451)da-woods2020-04-021-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | Optimized inplace operations for str/unicode so that they're genuinely done in place if no-one else needs the object. This is what CPython tries to do (and string concatenation was a point where it significantly beat Cython at times). This only works if the types are known at compile time, so with unknown types CPython will still be faster in some cases. Note: Uses slightly odd-macro trickery - does modify the input argument too (although only in places where it shouldn't matter).
* | Optimize builtin str() calls (GH-3478)William Ayd2020-04-021-0/+32
| |
* | Fix branch prediction hints for plain (unlikely/exceptional) "raise" ↵Stefan Behnel2020-04-011-5/+9
| | | | | | | | statements in if/else clauses that are not preceded by other statements.
* | Make fused function dispatch O(n) for `cpdef` functions. (GH-3366)will-ca2020-04-011-15/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rewrote signature matching for fused cpdef function dispatch to use a pre-built tree index in a mutable default argument and be O(n). * Added test to ensure proper differentiation between ambiguously compatible and definitely compatible arguments. * Added test to ensure fused cpdef's can be called by the module itself during import. * Added test to ensure consistent handling of ambiguous fused cpdef signatures. * Test for explicitly defined fused cpdef method. * Add .komodoproject to .gitignore. * Add /cython_debug/ to .gitignore. Closes #1385.
* | Specialize fused function local variables specified with pure-python (GH-3463)da-woods2020-03-314-4/+19
| | | | | | | | | | | | | | These were previously getting missed. Added code to specialize them and tests to prove it. Fixes https://github.com/cython/cython/issues/3142 Also fixes https://github.com/cython/cython/issues/3460 - (seems related enough to go in the same PR)
* | Mark missing argument errors in argument parsing code as unlikely (GH-3428)Alex Henrie2020-03-241-2/+2
| |
* | Mark view.* extension types as non-imported so that they can be inherited ↵da-woods2020-03-243-1/+12
| | | | | | | | from. (GH-3413)
* | Make reference counting more type specific by moving it into PyrexTypes ↵da-woods2020-03-248-330/+421
| | | | | | | | | | | | | | (GH-3377) The idea being that struct-types like memoryviews can generate their own reference counting code using a common interface with Python objects.
* | Merge branch 'master' into gh2564_enable_bindingStefan Behnel2020-03-228-141/+243
|\ \
| * | Only use PyUnicode_Concat on unicode object operations (GH-3433)da-woods2020-03-211-11/+16
| | |
| * | Merge branch '0.29.x'Stefan Behnel2020-03-211-0/+3
| |\ \ | | |/
| | * Enable temps for C functions by using function pointers instead.Stefan Behnel2020-03-211-0/+3
| | | | | | | | | | | | Closes GH-3418.
| | * Adapt to Pythran update: __builtin__ -> builtins (GH-3308)serge-sans-paille2020-03-211-4/+13
| | |
| | * FIX: Declare cimported ctuples (GH-1427) (GH-3271)isotherm2020-02-291-6/+8
| | | | | | | | | Closes #1427
| | * Fixing declaration of inner OpenMP privates (GH-3348)Frank Schlimbach2020-02-181-2/+5
| | | | | | | | | * omp declare privates on outer loop, since inner loops are not 'omp parallel for'ified
| | * Fixed a bug with C++ comparison operators (GH-3361)da-woods2020-02-181-1/+2
| | | | | | | | | They'd generate two calls - one exception checked and one not
| | * Avoid clang compiler warning for potentially dead code.Stefan Behnel2020-02-121-1/+1
| | |
| * | Adapt to Pythran update: __builtin__ -> builtins (GH-3308)serge-sans-paille2020-03-211-4/+13
| | |
| * | Fixed initialization of __Pyx_CachedCFunction in the LIMITED_API (GH-3379)da-woods2020-03-071-2/+5
| | | | | | | | | Strings werren't static for the limited API so had to be set at module init rather than compile time.
| * | Support fused arguments specified by annotation or locals (GH-3391)da-woods2020-03-032-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. DefNode.has_fused_arguments was set too early (before locals/annotations) were evalutated, so function was not treated as fused. 2. When re-evaluating the specializations of the fused function it was treated as a redefinition because the locals/annotation was reapplied over the specialized type. 3. Including annotation as string (required changes to StringNode.analyse_as_type), and extra tests for fused type defined as cython.fused_type in the Py file
| * | Cleanup and fix string initialization code for LIMITED_API (GH-3378)da-woods2020-02-271-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cleanup of string initialization code for limited API Now appears in a few large blocks rather than ``` # if CYTHON_LIMITED_API individual string line # endif ``` * Fixed issue with some unicode strings, e.g. ``` # cython: language_level=3str, binding=True def non_ascii_str(): s = 'ø\x20\u0020' assert isinstance(s, str) return s ```
| * | Allow tempita utility code to be @required (GH-3375)da-woods2020-02-261-2/+20
| | | | | | | | | "@subsitute: tempita" tag ensures that they are loaded in tempita utility code class
| * | Fixed a bug with C++ comparison operators (GH-3361)da-woods2020-02-181-1/+2
| | | | | | | | | They'd generate two calls - one exception checked and one not
| * | Expand LIMITED_API support (GH-3311)Eddie Elizondo2020-02-184-36/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add more limited api support * Fix Fused Functions * Fixed profile * Use PyModule_GetDict * Simplify __Pyx_Globals * Address issues in CommonStructures * ifdef guard CyFunction and FusedFunction
| * | Prevent false positives when issuing new "dotted filenames" warning.Stefan Behnel2020-02-171-2/+3
| | | | | | | | | | | | See #2686.
| * | Deprecate dotted filenames for package qualified module names.Stefan Behnel2020-02-161-0/+8
| | | | | | | | | | | | Close #2686.
| * | Fixing declaration of inner OpenMP privates (GH-3348)Frank Schlimbach2020-02-131-2/+5
| | | | | | | | | * omp declare privates on outer loop, since inner loops are not 'omp parallel for'ified