mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-29469: Move constant folding to AST optimizer (GH-2858)
This commit is contained in:
parent
b5fd9ad05e
commit
7ea143ae79
11 changed files with 4432 additions and 3967 deletions
|
@ -331,6 +331,10 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags,
|
|||
c.c_optimize = (optimize == -1) ? Py_OptimizeFlag : optimize;
|
||||
c.c_nestlevel = 0;
|
||||
|
||||
if (!_PyAST_Optimize(mod, arena)) {
|
||||
goto finally;
|
||||
}
|
||||
|
||||
c.c_st = PySymtable_BuildObject(mod, filename, c.c_future);
|
||||
if (c.c_st == NULL) {
|
||||
if (!PyErr_Occurred())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue