Skip to content

Commit 2715044

Browse files
committed
pythongh-121404: compiler_visit_* --> codegen_visit_*
1 parent dbc1752 commit 2715044

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

Python/compile.c

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ static int compiler_warn(struct compiler *, location loc, const char *, ...);
314314
static int compiler_nameop(struct compiler *, location, identifier, expr_context_ty);
315315

316316
static PyCodeObject *compiler_mod(struct compiler *, mod_ty);
317-
static int compiler_visit_stmt(struct compiler *, stmt_ty);
318-
static int compiler_visit_keyword(struct compiler *, keyword_ty);
319-
static int compiler_visit_expr(struct compiler *, expr_ty);
317+
static int codegen_visit_stmt(struct compiler *, stmt_ty);
318+
static int codegen_visit_keyword(struct compiler *, keyword_ty);
319+
static int codegen_visit_expr(struct compiler *, expr_ty);
320320
static int codegen_augassign(struct compiler *, stmt_ty);
321321
static int codegen_annassign(struct compiler *, stmt_ty);
322322
static int codegen_subscript(struct compiler *, expr_ty);
@@ -1037,17 +1037,17 @@ codegen_addop_j(instr_sequence *seq, location loc,
10371037
*/
10381038

10391039
#define VISIT(C, TYPE, V) \
1040-
RETURN_IF_ERROR(compiler_visit_ ## TYPE((C), (V)));
1040+
RETURN_IF_ERROR(codegen_visit_ ## TYPE((C), (V)));
10411041

10421042
#define VISIT_IN_SCOPE(C, TYPE, V) \
1043-
RETURN_IF_ERROR_IN_SCOPE((C), compiler_visit_ ## TYPE((C), (V)))
1043+
RETURN_IF_ERROR_IN_SCOPE((C), codegen_visit_ ## TYPE((C), (V)))
10441044

10451045
#define VISIT_SEQ(C, TYPE, SEQ) { \
10461046
int _i; \
10471047
asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \
10481048
for (_i = 0; _i < asdl_seq_LEN(seq); _i++) { \
10491049
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, _i); \
1050-
RETURN_IF_ERROR(compiler_visit_ ## TYPE((C), elt)); \
1050+
RETURN_IF_ERROR(codegen_visit_ ## TYPE((C), elt)); \
10511051
} \
10521052
}
10531053

@@ -1056,7 +1056,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
10561056
asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \
10571057
for (_i = 0; _i < asdl_seq_LEN(seq); _i++) { \
10581058
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, _i); \
1059-
if (compiler_visit_ ## TYPE((C), elt) < 0) { \
1059+
if (codegen_visit_ ## TYPE((C), elt) < 0) { \
10601060
compiler_exit_scope(C); \
10611061
return ERROR; \
10621062
} \
@@ -1850,9 +1850,7 @@ codegen_kwonlydefaults(struct compiler *c, location loc,
18501850
goto error;
18511851
}
18521852
ADDOP_LOAD_CONST_NEW(c, loc, mangled);
1853-
if (compiler_visit_expr(c, default_) < 0) {
1854-
goto error;
1855-
}
1853+
RETURN_IF_ERROR(codegen_visit_expr(c, default_));
18561854
}
18571855
}
18581856
if (default_count) {
@@ -1869,7 +1867,7 @@ codegen_kwonlydefaults(struct compiler *c, location loc,
18691867
}
18701868

18711869
static int
1872-
compiler_visit_annexpr(struct compiler *c, expr_ty annotation)
1870+
codegen_visit_annexpr(struct compiler *c, expr_ty annotation)
18731871
{
18741872
location loc = LOC(annotation);
18751873
ADDOP_LOAD_CONST_NEW(c, loc, _PyAST_ExprAsUnicode(annotation));
@@ -3854,7 +3852,7 @@ codegen_stmt_expr(struct compiler *c, location loc, expr_ty value)
38543852
}
38553853

38563854
static int
3857-
compiler_visit_stmt(struct compiler *c, stmt_ty s)
3855+
codegen_visit_stmt(struct compiler *c, stmt_ty s)
38583856
{
38593857

38603858
switch (s->kind) {
@@ -5807,7 +5805,7 @@ codegen_dictcomp(struct compiler *c, expr_ty e)
58075805

58085806

58095807
static int
5810-
compiler_visit_keyword(struct compiler *c, keyword_ty k)
5808+
codegen_visit_keyword(struct compiler *c, keyword_ty k)
58115809
{
58125810
VISIT(c, expr, k->value);
58135811
return SUCCESS;
@@ -6035,7 +6033,7 @@ codegen_with(struct compiler *c, stmt_ty s, int pos)
60356033
}
60366034

60376035
static int
6038-
compiler_visit_expr(struct compiler *c, expr_ty e)
6036+
codegen_visit_expr(struct compiler *c, expr_ty e)
60396037
{
60406038
location loc = LOC(e);
60416039
switch (e->kind) {
@@ -6955,9 +6953,7 @@ codegen_pattern_mapping(struct compiler *c, pattern_ty p,
69556953
compiler_error(c, LOC(p), e);
69566954
goto error;
69576955
}
6958-
if (compiler_visit_expr(c, key) < 0) {
6959-
goto error;
6960-
}
6956+
RETURN_IF_ERROR(codegen_visit_expr(c, key));
69616957
}
69626958

69636959
// all keys have been checked; there are no duplicates

0 commit comments

Comments
 (0)