mirror of
https://github.com/python/cpython.git
synced 2025-10-29 01:22:59 +00:00
gh-104240: make _PyCompile_CodeGen support different compilation modes (#104241)
This commit is contained in:
parent
1b19bd1a88
commit
2c2dc61e8d
9 changed files with 43 additions and 15 deletions
|
|
@ -97,7 +97,8 @@ PyAPI_FUNC(PyObject*) _PyCompile_CodeGen(
|
|||
PyObject *ast,
|
||||
PyObject *filename,
|
||||
PyCompilerFlags *flags,
|
||||
int optimize);
|
||||
int optimize,
|
||||
int compile_mode);
|
||||
|
||||
PyAPI_FUNC(PyObject*) _PyCompile_OptimizeCfg(
|
||||
PyObject *instructions,
|
||||
|
|
|
|||
|
|
@ -847,6 +847,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
|
|||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(code));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(command));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(comment_factory));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(compile_mode));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(consts));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(context));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(cookie));
|
||||
|
|
|
|||
|
|
@ -335,6 +335,7 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_ID(code)
|
||||
STRUCT_FOR_ID(command)
|
||||
STRUCT_FOR_ID(comment_factory)
|
||||
STRUCT_FOR_ID(compile_mode)
|
||||
STRUCT_FOR_ID(consts)
|
||||
STRUCT_FOR_ID(context)
|
||||
STRUCT_FOR_ID(cookie)
|
||||
|
|
|
|||
1
Include/internal/pycore_runtime_init_generated.h
generated
1
Include/internal/pycore_runtime_init_generated.h
generated
|
|
@ -841,6 +841,7 @@ extern "C" {
|
|||
INIT_ID(code), \
|
||||
INIT_ID(command), \
|
||||
INIT_ID(comment_factory), \
|
||||
INIT_ID(compile_mode), \
|
||||
INIT_ID(consts), \
|
||||
INIT_ID(context), \
|
||||
INIT_ID(cookie), \
|
||||
|
|
|
|||
|
|
@ -858,6 +858,9 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
|
|||
string = &_Py_ID(comment_factory);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(compile_mode);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(consts);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue