@@ -193,12 +193,6 @@ struct compiler {
193
193
int c_optimize ; /* optimization level */
194
194
int c_interactive ; /* true if in interactive mode */
195
195
int c_nestlevel ;
196
- int c_do_not_emit_bytecode ; /* The compiler won't emit any bytecode
197
- if this value is different from zero.
198
- This can be used to temporarily visit
199
- nodes without emitting bytecode to
200
- check only errors. */
201
-
202
196
PyObject * c_const_cache ; /* Python dict holding all constants,
203
197
including names tuple */
204
198
struct compiler_unit * u ; /* compiler state for current block */
@@ -379,7 +373,6 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags,
379
373
c .c_flags = flags ;
380
374
c .c_optimize = (optimize == -1 ) ? _Py_GetConfig ()-> optimization_level : optimize ;
381
375
c .c_nestlevel = 0 ;
382
- c .c_do_not_emit_bytecode = 0 ;
383
376
384
377
_PyASTOptimizeState state ;
385
378
state .optimize = c .c_optimize ;
@@ -1181,9 +1174,6 @@ compiler_addop(struct compiler *c, int opcode)
1181
1174
struct instr * i ;
1182
1175
int off ;
1183
1176
assert (!HAS_ARG (opcode ));
1184
- if (c -> c_do_not_emit_bytecode ) {
1185
- return 1 ;
1186
- }
1187
1177
off = compiler_next_instr (c -> u -> u_curblock );
1188
1178
if (off < 0 )
1189
1179
return 0 ;
@@ -1337,10 +1327,6 @@ merge_consts_recursive(struct compiler *c, PyObject *o)
1337
1327
static Py_ssize_t
1338
1328
compiler_add_const (struct compiler * c , PyObject * o )
1339
1329
{
1340
- if (c -> c_do_not_emit_bytecode ) {
1341
- return 0 ;
1342
- }
1343
-
1344
1330
PyObject * key = merge_consts_recursive (c , o );
1345
1331
if (key == NULL ) {
1346
1332
return -1 ;
@@ -1354,10 +1340,6 @@ compiler_add_const(struct compiler *c, PyObject *o)
1354
1340
static int
1355
1341
compiler_addop_load_const (struct compiler * c , PyObject * o )
1356
1342
{
1357
- if (c -> c_do_not_emit_bytecode ) {
1358
- return 1 ;
1359
- }
1360
-
1361
1343
Py_ssize_t arg = compiler_add_const (c , o );
1362
1344
if (arg < 0 )
1363
1345
return 0 ;
@@ -1368,10 +1350,6 @@ static int
1368
1350
compiler_addop_o (struct compiler * c , int opcode , PyObject * dict ,
1369
1351
PyObject * o )
1370
1352
{
1371
- if (c -> c_do_not_emit_bytecode ) {
1372
- return 1 ;
1373
- }
1374
-
1375
1353
Py_ssize_t arg = compiler_add_o (dict , o );
1376
1354
if (arg < 0 )
1377
1355
return 0 ;
@@ -1384,10 +1362,6 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
1384
1362
{
1385
1363
Py_ssize_t arg ;
1386
1364
1387
- if (c -> c_do_not_emit_bytecode ) {
1388
- return 1 ;
1389
- }
1390
-
1391
1365
PyObject * mangled = _Py_Mangle (c -> u -> u_private , o );
1392
1366
if (!mangled )
1393
1367
return 0 ;
@@ -1408,10 +1382,6 @@ compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg)
1408
1382
struct instr * i ;
1409
1383
int off ;
1410
1384
1411
- if (c -> c_do_not_emit_bytecode ) {
1412
- return 1 ;
1413
- }
1414
-
1415
1385
/* oparg value is unsigned, but a signed C int is usually used to store
1416
1386
it in the C code (like Python/ceval.c).
1417
1387
@@ -1452,9 +1422,6 @@ static int add_jump_to_block(basicblock *b, int opcode, int lineno, basicblock *
1452
1422
static int
1453
1423
compiler_addop_j (struct compiler * c , int opcode , basicblock * b )
1454
1424
{
1455
- if (c -> c_do_not_emit_bytecode ) {
1456
- return 1 ;
1457
- }
1458
1425
return add_jump_to_block (c -> u -> u_curblock , opcode , c -> u -> u_lineno , b );
1459
1426
}
1460
1427
0 commit comments