Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bf06b20

Browse filesBrowse files
authored
Delete the now unused c_do_not_emit_bytecode field. (#24094)
1 parent df21f50 commit bf06b20
Copy full SHA for bf06b20

File tree

Expand file treeCollapse file tree

1 file changed

+0
-33
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-33
lines changed

‎Python/compile.c

Copy file name to clipboardExpand all lines: Python/compile.c
-33Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,6 @@ struct compiler {
193193
int c_optimize; /* optimization level */
194194
int c_interactive; /* true if in interactive mode */
195195
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-
202196
PyObject *c_const_cache; /* Python dict holding all constants,
203197
including names tuple */
204198
struct compiler_unit *u; /* compiler state for current block */
@@ -379,7 +373,6 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags,
379373
c.c_flags = flags;
380374
c.c_optimize = (optimize == -1) ? _Py_GetConfig()->optimization_level : optimize;
381375
c.c_nestlevel = 0;
382-
c.c_do_not_emit_bytecode = 0;
383376

384377
_PyASTOptimizeState state;
385378
state.optimize = c.c_optimize;
@@ -1181,9 +1174,6 @@ compiler_addop(struct compiler *c, int opcode)
11811174
struct instr *i;
11821175
int off;
11831176
assert(!HAS_ARG(opcode));
1184-
if (c->c_do_not_emit_bytecode) {
1185-
return 1;
1186-
}
11871177
off = compiler_next_instr(c->u->u_curblock);
11881178
if (off < 0)
11891179
return 0;
@@ -1337,10 +1327,6 @@ merge_consts_recursive(struct compiler *c, PyObject *o)
13371327
static Py_ssize_t
13381328
compiler_add_const(struct compiler *c, PyObject *o)
13391329
{
1340-
if (c->c_do_not_emit_bytecode) {
1341-
return 0;
1342-
}
1343-
13441330
PyObject *key = merge_consts_recursive(c, o);
13451331
if (key == NULL) {
13461332
return -1;
@@ -1354,10 +1340,6 @@ compiler_add_const(struct compiler *c, PyObject *o)
13541340
static int
13551341
compiler_addop_load_const(struct compiler *c, PyObject *o)
13561342
{
1357-
if (c->c_do_not_emit_bytecode) {
1358-
return 1;
1359-
}
1360-
13611343
Py_ssize_t arg = compiler_add_const(c, o);
13621344
if (arg < 0)
13631345
return 0;
@@ -1368,10 +1350,6 @@ static int
13681350
compiler_addop_o(struct compiler *c, int opcode, PyObject *dict,
13691351
PyObject *o)
13701352
{
1371-
if (c->c_do_not_emit_bytecode) {
1372-
return 1;
1373-
}
1374-
13751353
Py_ssize_t arg = compiler_add_o(dict, o);
13761354
if (arg < 0)
13771355
return 0;
@@ -1384,10 +1362,6 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
13841362
{
13851363
Py_ssize_t arg;
13861364

1387-
if (c->c_do_not_emit_bytecode) {
1388-
return 1;
1389-
}
1390-
13911365
PyObject *mangled = _Py_Mangle(c->u->u_private, o);
13921366
if (!mangled)
13931367
return 0;
@@ -1408,10 +1382,6 @@ compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg)
14081382
struct instr *i;
14091383
int off;
14101384

1411-
if (c->c_do_not_emit_bytecode) {
1412-
return 1;
1413-
}
1414-
14151385
/* oparg value is unsigned, but a signed C int is usually used to store
14161386
it in the C code (like Python/ceval.c).
14171387
@@ -1452,9 +1422,6 @@ static int add_jump_to_block(basicblock *b, int opcode, int lineno, basicblock *
14521422
static int
14531423
compiler_addop_j(struct compiler *c, int opcode, basicblock *b)
14541424
{
1455-
if (c->c_do_not_emit_bytecode) {
1456-
return 1;
1457-
}
14581425
return add_jump_to_block(c->u->u_curblock, opcode, c->u->u_lineno, b);
14591426
}
14601427

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.