summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix icc warnings: single bit fields should be unsigned, shadowing local ↵Neal Norwitz2006-01-071-16/+16
| | | | variables
* Adjust usage of compiler_use_new_block to its return type.Martin v. Löwis2006-01-021-2/+2
|
* fixed compilation with an ordinary C89 compilerFredrik Lundh2005-12-181-2/+1
|
* Fix Armin's bug 1333982. He found it, he didn't created it :-)Neal Norwitz2005-12-181-9/+1
| | | | | | | | | | This code generated a C assertion: assert 1, ([s for s in x] + [s for s in x]) pass assert was completely broken, it needed to use the proper block. compiler_use_block() is now no longer used, so remove it.
* Handle more error conditions with SystemErrorNeal Norwitz2005-12-181-8/+22
|
* Set MemoryError when alloc failsNeal Norwitz2005-12-181-3/+11
|
* Merge from ast-arena. This reduces the code in Python/ast.c by ~300 lines,Neal Norwitz2005-12-171-11/+14
| | | | simplifies a lot of error handling code, and fixes many memory leaks.
* Simplify logic for handling import *Neal Norwitz2005-12-061-6/+3
|
* Fix a few more ref leaks. Backport candidateNeal Norwitz2005-11-241-0/+2
|
* Fix a few more memory leaksNeal Norwitz2005-11-201-0/+3
| | | | | Document more info about the benefits of configuring without pymalloc when running valgrind
* Last batch of ref leaks in new AST code.Neal Norwitz2005-11-191-25/+50
| | | | | | Also converted a bunch of assert(0) to SystemError's. There are still printfs, etc that need to be cleaned up.
* Correctly handle identifiers for anonymous scopes and align genexpr name ↵Nick Coghlan2005-11-161-11/+17
| | | | with symtable.c
* Fix a lot of memory and ref leaks in error paths.Neal Norwitz2005-11-131-9/+35
| | | | | | (Call symtable_exit_block or compiler_exit_scope as appropriate) Use PyMem_Free on c_future since it was allocated with PyMem_Malloc
* make internal method staticNeal Norwitz2005-11-131-1/+1
|
* Ensure that compiler_exit_scope() is called as necessary to free memoryNeil Schemenauer2005-10-251-10/+18
| | | | | allocated by compiler_enter_scope(). Change return type for compiler_exit_scope() to be void.
* Fix problem handling EXTENDED_ARGs from SF bug # 1333982Neal Norwitz2005-10-231-1/+30
|
* cleanup a bit and reuse instrsize (instruction size). working towards ↵Neal Norwitz2005-10-231-30/+24
| | | | fixing problems with EXTENDED_ARG
* Remove unnecessary local variable.Neil Schemenauer2005-10-231-3/+2
|
* Fix private name mangling. The symtable also must do mangles so thatNeil Schemenauer2005-10-231-4/+16
| | | | the scope of names can be correctly determined.
* Use PyTuple_Pack instead of Py_BuildValue.Neil Schemenauer2005-10-231-2/+1
|
* Fix arigo's funky LOAD_NAME bug: implicit globals inside classes haveNeil Schemenauer2005-10-231-1/+2
| | | | | historically been looked up using LOAD_NAME, not LOAD_GLOBAL. looked up by LOAD_NAME, not
* Don't stop generating code for import statements after the first "import as"Neil Schemenauer2005-10-231-2/+3
| | | | part. Fixes one bug from #1333982.
* Use <lamba> as the function name for lambdas (matches old compiler).Neil Schemenauer2005-10-211-1/+1
|
* ANSI-C-ify the placement of local var declarations.Armin Rigo2005-10-211-1/+2
|
* Merge ast-branch to headJeremy Hylton2005-10-201-5613/+2880
| | | | | | | | | | This change implements a new bytecode compiler, based on a transformation of the parse tree to an abstract syntax defined in Parser/Python.asdl. The compiler implementation is not complete, but it is in stable enough shape to run the entire test suite excepting two disabled tests.
* com_yield_expr(): Squash new compiler wng about unreferenced local.Tim Peters2005-08-031-1/+0
|
* PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby2005-08-021-12/+64
| | | | | method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
* Fix signedness of various char variables to stop causing a warning under gcc 4.Brett Cannon2005-06-251-1/+1
|
* Allow classes to be defined with empty parentheses. This means thatBrett Cannon2005-03-051-2/+3
| | | | ``class C(): pass`` is no longer a syntax error.
* Silence a gcc warning about putting in parentheses around && expressions mixedBrett Cannon2005-03-031-5/+6
| | | | with || expressions. Also clarifies intend of 'if' conditional.
* Preserve sign of -0.0 when result is run through marshal.Raymond Hettinger2005-02-231-2/+4
|
* Document how the pattern recognizer keeps all of its references in bounds.Raymond Hettinger2005-02-211-0/+8
| | | | | | Add a test in case the underlying assumptions ever change (i.e. the compiler starts generating code blocks that are not punctuated by RETURN_VALUE).
* Teach the peepholer to fold unary operations on constants.Raymond Hettinger2005-02-201-0/+62
| | | | | Afterwards, -0.5 loads in a single step and no longer requires a runtime UNARY_NEGATIVE operation.
* Remove the set conversion which didn't work with: [] in (0,)Raymond Hettinger2005-02-101-53/+1
|
* Have set conversion replace existing constant if not used elsewhere.Raymond Hettinger2005-02-091-1/+7
|
* Adopt Skip's idea to optimize lists of constants in the contextRaymond Hettinger2005-02-071-7/+13
| | | | of a "in" or "not in" test.
* Transform "x in (1,2,3)" to "x in frozenset([1,2,3])".Raymond Hettinger2005-02-061-1/+48
| | | | | Inspired by Skip's idea to recognize the throw-away nature of sequences in this context and to transform their type to one with better performance.
* Do not fold a constant if a large sequence will result.Raymond Hettinger2005-01-261-5/+15
| | | | Saves space in the presence of code like: (None,)*10000
* Re-running python with/without the -Qnew flag uses incorrectly optimizedArmin Rigo2005-01-071-6/+3
| | | | | bytecodes from the previously saved .pyc files. Fixed by disabling the static optimization of BINARY_DIVIDE between two constants.
* Teach the peephole optimizer to fold simple constant expressions.Raymond Hettinger2005-01-021-1/+118
|
* SF patch 1025636: Check for NULL returns in compile.c:com_import_stmtJeremy Hylton2004-11-071-4/+14
| | | | There is no test for this change, because there is no way to provoke memory errors on demand. Test suite passes, though.
* Maintain peepholer's cumlc invariant by updating the running totalRaymond Hettinger2004-11-021-0/+4
| | | | | | everytime a LOAD_CONSTANT is encountered, created, or overwritten. Added two tests to cover cases affected by the patch.
* Simplify and future proof NOP counting in the peepholer.Raymond Hettinger2004-11-011-13/+6
| | | | No longer assumes that the input is NOP free.
* Fixed a comment and added another one.Armin Rigo2004-10-301-1/+4
|
* Adopt some peepholer suggestions from Armin Rigo:Raymond Hettinger2004-10-301-15/+20
| | | | | | | | * Use simpler, faster two pass algorithm for markblocks(). * Free the blocks variable if not NULL and exiting without change. * Verify that the rest of the compiler has not set an exception. * Make the test for tuple of constants less restrictive. * Embellish the comment for chained conditional jumps.
* SF bug #1053819: Segfault in tuple_of_constantsRaymond Hettinger2004-10-261-1/+9
| | | | | | | Peepholer could be fooled into misidentifying a tuple_of_constants. Added code to count consecutive occurrences of LOAD_CONST. Use the count to weed out the misidentified cases. Added a unittest.
* SF bug #1048870: call arg of lambda not updatingRaymond Hettinger2004-10-241-0/+2
|
* Improve error message for augmented assignments to genexps or listcomps.Raymond Hettinger2004-09-291-2/+2
| | | | | Rather than introduce new logic, took the approach of making the message itself more general.
* Fix two erroneous error messages.Raymond Hettinger2004-09-291-2/+2
|
* Replaced a test with an assertion.Raymond Hettinger2004-09-281-3/+1
| | | | (Suggested by Michael Hudson.)