File indexing completed on 2025-11-19 09:50:46
0001 #ifndef Py_INTERNAL_CFG_H
0002 #define Py_INTERNAL_CFG_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006
0007 #ifndef Py_BUILD_CORE
0008 # error "this header requires Py_BUILD_CORE define"
0009 #endif
0010
0011 #include "pycore_compile.h"
0012 #include "pycore_instruction_sequence.h"
0013 #include "pycore_opcode_utils.h"
0014
0015 struct _PyCfgBuilder;
0016
0017 int _PyCfgBuilder_UseLabel(struct _PyCfgBuilder *g, _PyJumpTargetLabel lbl);
0018 int _PyCfgBuilder_Addop(struct _PyCfgBuilder *g, int opcode, int oparg, _Py_SourceLocation loc);
0019
0020 struct _PyCfgBuilder* _PyCfgBuilder_New(void);
0021 void _PyCfgBuilder_Free(struct _PyCfgBuilder *g);
0022 int _PyCfgBuilder_CheckSize(struct _PyCfgBuilder* g);
0023
0024 int _PyCfg_OptimizeCodeUnit(struct _PyCfgBuilder *g, PyObject *consts, PyObject *const_cache,
0025 int nlocals, int nparams, int firstlineno);
0026
0027 int _PyCfg_ToInstructionSequence(struct _PyCfgBuilder *g, _PyInstructionSequence *seq);
0028 int _PyCfg_OptimizedCfgToInstructionSequence(struct _PyCfgBuilder *g, _PyCompile_CodeUnitMetadata *umd,
0029 int code_flags, int *stackdepth, int *nlocalsplus,
0030 _PyInstructionSequence *seq);
0031
0032 PyCodeObject *
0033 _PyAssemble_MakeCodeObject(_PyCompile_CodeUnitMetadata *u, PyObject *const_cache,
0034 PyObject *consts, int maxdepth, _PyInstructionSequence *instrs,
0035 int nlocalsplus, int code_flags, PyObject *filename);
0036
0037 #ifdef __cplusplus
0038 }
0039 #endif
0040 #endif