Fix incorrect replacements in Py_ to Ty_ renaming

Fixed several macros and constants that should not have been renamed:
- _Py_CAST, _Py_NULL, _Py_RVALUE (internal utility macros)
- Py_UNUSED (unused parameter macro)
- Py_EQ, Py_NE, Py_LT, Py_LE, Py_GT, Py_GE (comparison constants)
- Py_RETURN_* macros (NONE, TRUE, FALSE, NOTIMPLEMENTED, RICHCOMPARE)
- Py_READONLY, Py_ULL, Py_CONTEXT_SWITCHED
- TyGC_Head in generated clinic files

Build is still in progress with some remaining issues to resolve.

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-29 17:44:05 +00:00
parent b198f511d2
commit 42e2356c88
367 changed files with 3520 additions and 3520 deletions

View File

@@ -96,12 +96,12 @@ typedef _PyCompile_FBlockInfo fblockinfo;
RETURN_IF_ERROR(_PyInstructionSequence_UseLabel(INSTR_SEQUENCE(C), (LBL).id))
static const int compare_masks[] = {
[Ty_LT] = COMPARISON_LESS_THAN,
[Ty_LE] = COMPARISON_LESS_THAN | COMPARISON_EQUALS,
[Ty_EQ] = COMPARISON_EQUALS,
[Ty_NE] = COMPARISON_NOT_EQUALS,
[Ty_GT] = COMPARISON_GREATER_THAN,
[Ty_GE] = COMPARISON_GREATER_THAN | COMPARISON_EQUALS,
[Py_LT] = COMPARISON_LESS_THAN,
[Py_LE] = COMPARISON_LESS_THAN | COMPARISON_EQUALS,
[Py_EQ] = COMPARISON_EQUALS,
[Py_NE] = COMPARISON_NOT_EQUALS,
[Py_GT] = COMPARISON_GREATER_THAN,
[Py_GE] = COMPARISON_GREATER_THAN | COMPARISON_EQUALS,
};
@@ -678,7 +678,7 @@ codegen_setup_annotations_scope(compiler *c, location loc,
_Ty_DECLARE_STR(format, ".format");
ADDOP_I(c, loc, LOAD_FAST, 0);
ADDOP_LOAD_CONST(c, loc, value_with_fake_globals);
ADDOP_I(c, loc, COMPARE_OP, (Ty_GT << 5) | compare_masks[Ty_GT]);
ADDOP_I(c, loc, COMPARE_OP, (Py_GT << 5) | compare_masks[Py_GT]);
NEW_JUMP_TARGET_LABEL(c, body);
ADDOP_JUMP(c, loc, POP_JUMP_IF_FALSE, body);
ADDOP_I(c, loc, LOAD_COMMON_CONSTANT, CONSTANT_NOTIMPLEMENTEDERROR);
@@ -1840,22 +1840,22 @@ codegen_addcompare(compiler *c, location loc, cmpop_ty op)
int cmp;
switch (op) {
case Eq:
cmp = Ty_EQ;
cmp = Py_EQ;
break;
case NotEq:
cmp = Ty_NE;
cmp = Py_NE;
break;
case Lt:
cmp = Ty_LT;
cmp = Py_LT;
break;
case LtE:
cmp = Ty_LE;
cmp = Py_LE;
break;
case Gt:
cmp = Ty_GT;
cmp = Py_GT;
break;
case GtE:
cmp = Ty_GE;
cmp = Py_GE;
break;
case Is:
ADDOP_I(c, loc, IS_OP, 0);