gh-108113: Make it possible to optimize an AST (#108282)

This commit is contained in:
Irit Katriel 2023-08-23 09:01:17 +01:00 committed by GitHub
parent 79fdacc005
commit 2dfbd4f36d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 77 additions and 48 deletions

View file

@ -19,6 +19,14 @@ PyAPI_FUNC(PyCodeObject*) _PyAST_Compile(
int optimize,
struct _arena *arena);
/* AST optimizations */
PyAPI_FUNC(int) _PyCompile_AstOptimize(
struct _mod *mod,
PyObject *filename,
PyCompilerFlags *flags,
int optimize,
struct _arena *arena);
static const _PyCompilerSrcLocation NO_LOCATION = {-1, -1, -1, -1};
extern int _PyAST_Optimize(