gh-123881: make compiler add the .generic_base base class without constructing AST nodes (#123883)

This commit is contained in:
Irit Katriel 2024-09-10 17:16:00 +01:00 committed by GitHub
parent 3597642ed5
commit a2d0818c85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 47 deletions

View file

@ -88,7 +88,6 @@ typedef struct _PyCompiler {
including names tuple */
struct compiler_unit *u; /* compiler state for current block */
PyObject *c_stack; /* Python list holding compiler_unit ptrs */
PyArena *c_arena; /* pointer to memory allocation arena */
bool c_save_nested_seqs; /* if true, construct recursive instruction sequences
* (including instructions for nested code objects)
@ -112,7 +111,6 @@ compiler_setup(compiler *c, mod_ty mod, PyObject *filename,
}
c->c_filename = Py_NewRef(filename);
c->c_arena = arena;
if (!_PyFuture_FromAST(mod, filename, &c->c_future)) {
return ERROR;
}
@ -1244,12 +1242,6 @@ _PyCompile_Metadata(compiler *c)
return &c->u->u_metadata;
}
PyArena *
_PyCompile_Arena(compiler *c)
{
return c->c_arena;
}
#ifndef NDEBUG
int
_PyCompile_IsTopLevelAwait(compiler *c)