| #ifndef Py_INTERNAL_COMPILE_H |
| #define Py_INTERNAL_COMPILE_H |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
|
|
| #ifndef Py_BUILD_CORE |
| # error "this header requires Py_BUILD_CORE define" |
| #endif |
|
|
| #include "pycore_symtable.h" |
| #include "pycore_instruction_sequence.h" |
|
|
| struct _arena; |
| struct _mod; |
|
|
| |
| PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( |
| struct _mod *mod, |
| PyObject *filename, |
| PyCompilerFlags *flags, |
| int optimize, |
| struct _arena *arena); |
|
|
| |
| extern int _PyCompile_AstOptimize( |
| struct _mod *mod, |
| PyObject *filename, |
| PyCompilerFlags *flags, |
| int optimize, |
| struct _arena *arena); |
|
|
| struct _Py_SourceLocation; |
|
|
| extern int _PyAST_Optimize( |
| struct _mod *, |
| struct _arena *arena, |
| int optimize, |
| int ff_features); |
|
|
|
|
| typedef struct { |
| PyObject *u_name; |
| PyObject *u_qualname; |
|
|
| |
| |
| |
| |
| PyObject *u_consts; |
| PyObject *u_names; |
| PyObject *u_varnames; |
| PyObject *u_cellvars; |
| PyObject *u_freevars; |
| PyObject *u_fasthidden; |
| |
| |
|
|
| Py_ssize_t u_argcount; |
| Py_ssize_t u_posonlyargcount; |
| Py_ssize_t u_kwonlyargcount; |
|
|
| int u_firstlineno; |
| } _PyCompile_CodeUnitMetadata; |
|
|
|
|
| |
| int _PyCompile_EnsureArrayLargeEnough( |
| int idx, |
| void **array, |
| int *alloc, |
| int default_alloc, |
| size_t item_size); |
|
|
| int _PyCompile_ConstCacheMergeOne(PyObject *const_cache, PyObject **obj); |
|
|
|
|
| |
| PyAPI_FUNC(int) _PyCompile_OpcodeIsValid(int opcode); |
| PyAPI_FUNC(int) _PyCompile_OpcodeHasArg(int opcode); |
| PyAPI_FUNC(int) _PyCompile_OpcodeHasConst(int opcode); |
| PyAPI_FUNC(int) _PyCompile_OpcodeHasName(int opcode); |
| PyAPI_FUNC(int) _PyCompile_OpcodeHasJump(int opcode); |
| PyAPI_FUNC(int) _PyCompile_OpcodeHasFree(int opcode); |
| PyAPI_FUNC(int) _PyCompile_OpcodeHasLocal(int opcode); |
| PyAPI_FUNC(int) _PyCompile_OpcodeHasExc(int opcode); |
|
|
| PyAPI_FUNC(PyObject*) _PyCompile_GetUnaryIntrinsicName(int index); |
| PyAPI_FUNC(PyObject*) _PyCompile_GetBinaryIntrinsicName(int index); |
|
|
| |
|
|
| |
| PyAPI_FUNC(PyObject*) _PyCompile_CleanDoc(PyObject *doc); |
|
|
| |
| PyAPI_FUNC(PyObject*) _PyCompile_CodeGen( |
| PyObject *ast, |
| PyObject *filename, |
| PyCompilerFlags *flags, |
| int optimize, |
| int compile_mode); |
|
|
| |
| PyAPI_FUNC(PyObject*) _PyCompile_OptimizeCfg( |
| PyObject *instructions, |
| PyObject *consts, |
| int nlocals); |
|
|
| |
| PyAPI_FUNC(PyCodeObject*) |
| _PyCompile_Assemble(_PyCompile_CodeUnitMetadata *umd, PyObject *filename, |
| PyObject *instructions); |
|
|
| #ifdef __cplusplus |
| } |
| #endif |
| #endif |
|
|