Skip to content

Commit 6504f20

Browse files
authored
gh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)
Rename Py_TAIL_CALL_INTERP to _Py_TAIL_CALL_INTERP.
1 parent 2191497 commit 6504f20

File tree

12 files changed

+315
-315
lines changed

12 files changed

+315
-315
lines changed

Lib/test/test_generated_cases.py

Lines changed: 51 additions & 51 deletions
Large diffs are not rendered by default.

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<PreprocessorDefinitions Condition="$(IncludeExternals)">_Py_HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
108108
<PreprocessorDefinitions Condition="'$(UseJIT)' == 'true'">_Py_JIT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
109109
<PreprocessorDefinitions Condition="'$(UseTIER2)' != '' and '$(UseTIER2)' != '0'">_Py_TIER2=$(UseTIER2);%(PreprocessorDefinitions)</PreprocessorDefinitions>
110-
<PreprocessorDefinitions Condition="'$(UseTailCallInterp)' == 'true'">Py_TAIL_CALL_INTERP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110+
<PreprocessorDefinitions Condition="'$(UseTailCallInterp)' == 'true'">_Py_TAIL_CALL_INTERP=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
111111
<PreprocessorDefinitions Condition="'$(WITH_COMPUTED_GOTOS)' != ''">HAVE_COMPUTED_GOTOS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
112112
<PreprocessorDefinitions Condition="'$(DisableRemoteDebug)' != 'true'">Py_REMOTE_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
113113
</ClCompile>

Python/bytecodes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ dummy_func(
12191219
tstate->current_frame = frame->previous;
12201220
assert(!_PyErr_Occurred(tstate));
12211221
PyObject *result = PyStackRef_AsPyObjectSteal(retval);
1222-
#if !Py_TAIL_CALL_INTERP
1222+
#if !_Py_TAIL_CALL_INTERP
12231223
assert(frame == &entry.frame);
12241224
#endif
12251225
#ifdef _Py_TIER2
@@ -1509,7 +1509,7 @@ dummy_func(
15091509

15101510
tier1 inst(CLEANUP_THROW, (sub_iter, last_sent_val, exc_value_st -- none, value)) {
15111511
PyObject *exc_value = PyStackRef_AsPyObjectBorrow(exc_value_st);
1512-
#if !Py_TAIL_CALL_INTERP
1512+
#if !_Py_TAIL_CALL_INTERP
15131513
assert(throwflag);
15141514
#endif
15151515
assert(exc_value && PyExceptionInstance_Check(exc_value));
@@ -5515,7 +5515,7 @@ dummy_func(
55155515
}
55165516
#endif
55175517
RELOAD_STACK();
5518-
#if Py_TAIL_CALL_INTERP
5518+
#if _Py_TAIL_CALL_INTERP
55195519
int opcode;
55205520
#endif
55215521
DISPATCH();
@@ -5533,7 +5533,7 @@ dummy_func(
55335533
if (frame->owner == FRAME_OWNED_BY_INTERPRETER) {
55345534
/* Restore previous frame and exit */
55355535
tstate->current_frame = frame->previous;
5536-
#if !Py_TAIL_CALL_INTERP
5536+
#if !_Py_TAIL_CALL_INTERP
55375537
assert(frame == &entry.frame);
55385538
#endif
55395539
#ifdef _Py_TIER2
@@ -5569,7 +5569,7 @@ dummy_func(
55695569
assert(!_PyErr_Occurred(tstate));
55705570
#endif
55715571
RELOAD_STACK();
5572-
#if Py_TAIL_CALL_INTERP
5572+
#if _Py_TAIL_CALL_INTERP
55735573
int opcode;
55745574
#endif
55755575
DISPATCH();

Python/ceval.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
987987
/* This setting is reversed below following _PyEval_EvalFrameDefault */
988988
#endif
989989

990-
#if Py_TAIL_CALL_INTERP
990+
#if _Py_TAIL_CALL_INTERP
991991
#include "opcode_targets.h"
992992
#include "generated_cases.c.h"
993993
#endif
@@ -1019,15 +1019,15 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10191019
check_invalid_reentrancy();
10201020
CALL_STAT_INC(pyeval_calls);
10211021

1022-
#if USE_COMPUTED_GOTOS && !Py_TAIL_CALL_INTERP
1022+
#if USE_COMPUTED_GOTOS && !_Py_TAIL_CALL_INTERP
10231023
/* Import the static jump table */
10241024
#include "opcode_targets.h"
10251025
#endif
10261026

10271027
#ifdef Py_STATS
10281028
int lastopcode = 0;
10291029
#endif
1030-
#if !Py_TAIL_CALL_INTERP
1030+
#if !_Py_TAIL_CALL_INTERP
10311031
uint8_t opcode; /* Current opcode */
10321032
int oparg; /* Current opcode argument, if any */
10331033
assert(tstate->current_frame == NULL || tstate->current_frame->stackpointer != NULL);
@@ -1099,7 +1099,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10991099
next_instr = frame->instr_ptr;
11001100
monitor_throw(tstate, frame, next_instr);
11011101
stack_pointer = _PyFrame_GetStackPointer(frame);
1102-
#if Py_TAIL_CALL_INTERP
1102+
#if _Py_TAIL_CALL_INTERP
11031103
# if Py_STATS
11041104
return _TAIL_CALL_error(frame, stack_pointer, tstate, next_instr, 0, lastopcode);
11051105
# else
@@ -1110,7 +1110,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
11101110
#endif
11111111
}
11121112

1113-
#if Py_TAIL_CALL_INTERP
1113+
#if _Py_TAIL_CALL_INTERP
11141114
# if Py_STATS
11151115
return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, 0, lastopcode);
11161116
# else

Python/ceval_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
# define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, oparg
7979
#endif
8080

81-
#if Py_TAIL_CALL_INTERP
81+
#if _Py_TAIL_CALL_INTERP
8282
// Note: [[clang::musttail]] works for GCC 15, but not __attribute__((musttail)) at the moment.
8383
# define Py_MUSTTAIL [[clang::musttail]]
8484
# define Py_PRESERVE_NONE_CC __attribute__((preserve_none))

0 commit comments

Comments
 (0)