@@ -9,6 +9,7 @@ extern "C" {
9
9
#endif
10
10
11
11
#include "pycore_opcode_utils.h"
12
+ #include "pycore_compile.h"
12
13
13
14
static const _PyCompilerSrcLocation NO_LOCATION = {-1 , -1 , -1 , -1 };
14
15
@@ -33,7 +34,8 @@ typedef struct {
33
34
typedef struct _PyCfgBasicblock_ {
34
35
/* Each basicblock in a compilation unit is linked via b_list in the
35
36
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. */
37
39
struct _PyCfgBasicblock_ * b_list ;
38
40
/* The label of this block if it is a jump target, -1 otherwise */
39
41
_PyCfgJumpTargetLabel b_label ;
@@ -91,10 +93,9 @@ void _PyCfgBuilder_Fini(_PyCfgBuilder *g);
91
93
92
94
_PyCfgInstruction * _PyCfg_BasicblockLastInstr (const _PyCfgBasicblock * b );
93
95
int _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 );
95
97
int _PyCfg_Stackdepth (_PyCfgBasicblock * entryblock , int code_flags );
96
98
void _PyCfg_ConvertExceptionHandlersToNops (_PyCfgBasicblock * entryblock );
97
- int _PyCfg_ResolveLineNumbers (_PyCfgBuilder * g , int firstlineno );
98
99
int _PyCfg_ResolveJumps (_PyCfgBuilder * g );
99
100
int _PyCfg_InstrSize (_PyCfgInstruction * instruction );
100
101
@@ -110,6 +111,10 @@ basicblock_nofallthrough(const _PyCfgBasicblock *b) {
110
111
#define BB_NO_FALLTHROUGH (B ) (basicblock_nofallthrough(B))
111
112
#define BB_HAS_FALLTHROUGH (B ) (!basicblock_nofallthrough(B))
112
113
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 );
113
118
114
119
#ifdef __cplusplus
115
120
}
0 commit comments