mirror of
https://github.com/python/cpython.git
synced 2025-10-28 17:13:08 +00:00
gh-87092: expose the compiler's codegen to python for unit tests (GH-99111)
This commit is contained in:
parent
06d4e02c3b
commit
a3ac9232f8
11 changed files with 323 additions and 99 deletions
|
|
@ -40,6 +40,13 @@ extern int _PyAST_Optimize(
|
|||
_PyASTOptimizeState *state);
|
||||
|
||||
/* Access compiler internals for unit testing */
|
||||
|
||||
PyAPI_FUNC(PyObject*) _PyCompile_CodeGen(
|
||||
PyObject *ast,
|
||||
PyObject *filename,
|
||||
PyCompilerFlags *flags,
|
||||
int optimize);
|
||||
|
||||
PyAPI_FUNC(PyObject*) _PyCompile_OptimizeCfg(
|
||||
PyObject *instructions,
|
||||
PyObject *consts);
|
||||
|
|
|
|||
|
|
@ -781,6 +781,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
|
|||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(arguments));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(argv));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(as_integer_ratio));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ast));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(attribute));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(authorizer_callback));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(autocommit));
|
||||
|
|
|
|||
|
|
@ -267,6 +267,7 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_ID(arguments)
|
||||
STRUCT_FOR_ID(argv)
|
||||
STRUCT_FOR_ID(as_integer_ratio)
|
||||
STRUCT_FOR_ID(ast)
|
||||
STRUCT_FOR_ID(attribute)
|
||||
STRUCT_FOR_ID(authorizer_callback)
|
||||
STRUCT_FOR_ID(autocommit)
|
||||
|
|
|
|||
1
Include/internal/pycore_runtime_init_generated.h
generated
1
Include/internal/pycore_runtime_init_generated.h
generated
|
|
@ -773,6 +773,7 @@ extern "C" {
|
|||
INIT_ID(arguments), \
|
||||
INIT_ID(argv), \
|
||||
INIT_ID(as_integer_ratio), \
|
||||
INIT_ID(ast), \
|
||||
INIT_ID(attribute), \
|
||||
INIT_ID(authorizer_callback), \
|
||||
INIT_ID(autocommit), \
|
||||
|
|
|
|||
|
|
@ -440,6 +440,8 @@ _PyUnicode_InitStaticStrings(void) {
|
|||
PyUnicode_InternInPlace(&string);
|
||||
string = &_Py_ID(as_integer_ratio);
|
||||
PyUnicode_InternInPlace(&string);
|
||||
string = &_Py_ID(ast);
|
||||
PyUnicode_InternInPlace(&string);
|
||||
string = &_Py_ID(attribute);
|
||||
PyUnicode_InternInPlace(&string);
|
||||
string = &_Py_ID(authorizer_callback);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue