Visitar URL original
gh-126835: Rename AST optimization related stuff after moving const folding to the peephole optimizier by WolframAlph · Pull Request #131830 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address review
  • Loading branch information
WolframAlph committed May 4, 2025
commit e2a3cbc84e37ae935d7dc2e004eb21c0cc2e2cd6
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Move constant folding to the peephole optimizer. Rename AST optimization
Comment thread
AA-Turner marked this conversation as resolved.
related files/structs/functions.
related files (ast_opt.c -> ast_process.c), structs (_PyASTOptimizeState -> _PyASTProcessState)
and functions (_PyAST_Optimize -> _PyAST_Process, _PyCompile_AstOptimize -> _PyCompile_AstProcess).
2 changes: 1 addition & 1 deletion Python/ast_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ astfold_type_param(type_param_ty node_, PyArena *ctx_, _PyASTProcessState *state

int
_PyAST_Process(mod_ty mod, PyArena *arena, PyObject *filename, int optimize,
int ff_features, int syntax_check_only)
int ff_features, int syntax_check_only)
{
_PyASTProcessState state;
memset(&state, 0, sizeof(_PyASTProcessState));
Expand Down
2 changes: 1 addition & 1 deletion Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ _PyAST_Compile(mod_ty mod, PyObject *filename, PyCompilerFlags *pflags,

int
_PyCompile_AstProcess(mod_ty mod, PyObject *filename, PyCompilerFlags *cf,
int optimize, PyArena *arena, int no_const_folding)
int optimize, PyArena *arena, int no_const_folding)
{
_PyFutureFeatures future;
if (!_PyFuture_FromAST(mod, filename, &future)) {
Expand Down