@@ -9,6 +9,7 @@ extern "C" {
99#endif
1010
1111#include "pycore_opcode_utils.h"
12+ #include "pycore_compile.h"
1213
1314static const _PyCompilerSrcLocation NO_LOCATION = {-1 , -1 , -1 , -1 };
1415
@@ -33,7 +34,8 @@ typedef struct {
3334typedef struct _PyCfgBasicblock_ {
3435 /* Each basicblock in a compilation unit is linked via b_list in the
3536 reverse order that the block are allocated. b_list points to the next
36- block, not to be confused with b_next, which is next by control flow. */
37+ block in this list, not to be confused with b_next, which is next by
38+ control flow. */
3739 struct _PyCfgBasicblock_ * b_list ;
3840 /* The label of this block if it is a jump target, -1 otherwise */
3941 _PyCfgJumpTargetLabel b_label ;
@@ -91,10 +93,9 @@ void _PyCfgBuilder_Fini(_PyCfgBuilder *g);
9193
9294_PyCfgInstruction * _PyCfg_BasicblockLastInstr (const _PyCfgBasicblock * b );
9395int _PyCfg_OptimizeCodeUnit (_PyCfgBuilder * g , PyObject * consts , PyObject * const_cache ,
94- int code_flags , int nlocals , int nparams );
96+ int code_flags , int nlocals , int nparams , int firstlineno );
9597int _PyCfg_Stackdepth (_PyCfgBasicblock * entryblock , int code_flags );
9698void _PyCfg_ConvertExceptionHandlersToNops (_PyCfgBasicblock * entryblock );
97- int _PyCfg_ResolveLineNumbers (_PyCfgBuilder * g , int firstlineno );
9899int _PyCfg_ResolveJumps (_PyCfgBuilder * g );
99100int _PyCfg_InstrSize (_PyCfgInstruction * instruction );
100101
@@ -110,6 +111,10 @@ basicblock_nofallthrough(const _PyCfgBasicblock *b) {
110111#define BB_NO_FALLTHROUGH (B ) (basicblock_nofallthrough(B))
111112#define BB_HAS_FALLTHROUGH (B ) (!basicblock_nofallthrough(B))
112113
114+ PyCodeObject *
115+ _PyAssemble_MakeCodeObject (_PyCompile_CodeUnitMetadata * u , PyObject * const_cache ,
116+ PyObject * consts , int maxdepth , _PyCfgBasicblock * entryblock ,
117+ int nlocalsplus , int code_flags , PyObject * filename );
113118
114119#ifdef __cplusplus
115120}
0 commit comments