Skip to content

Commit fda779d

Browse files
committed
gh-135755: Make Py_TAIL_CALL_INTERP macro private (#138981)
Rename Py_TAIL_CALL_INTERP to _Py_TAIL_CALL_INTERP. (cherry picked from commit 6504f20)
1 parent 869f1d8 commit fda779d

File tree

12 files changed

+318
-318
lines changed

12 files changed

+318
-318
lines changed

Lib/test/test_generated_cases.py

Lines changed: 52 additions & 52 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
@@ -1169,7 +1169,7 @@ dummy_func(
11691169
tstate->current_frame = frame->previous;
11701170
assert(!_PyErr_Occurred(tstate));
11711171
PyObject *result = PyStackRef_AsPyObjectSteal(retval);
1172-
#if !Py_TAIL_CALL_INTERP
1172+
#if !_Py_TAIL_CALL_INTERP
11731173
assert(frame == &entry.frame);
11741174
#endif
11751175
#ifdef _Py_TIER2
@@ -1458,7 +1458,7 @@ dummy_func(
14581458

14591459
tier1 inst(CLEANUP_THROW, (sub_iter, last_sent_val, exc_value_st -- none, value)) {
14601460
PyObject *exc_value = PyStackRef_AsPyObjectBorrow(exc_value_st);
1461-
#if !Py_TAIL_CALL_INTERP
1461+
#if !_Py_TAIL_CALL_INTERP
14621462
assert(throwflag);
14631463
#endif
14641464
assert(exc_value && PyExceptionInstance_Check(exc_value));
@@ -5472,7 +5472,7 @@ dummy_func(
54725472
}
54735473
#endif
54745474
RELOAD_STACK();
5475-
#if Py_TAIL_CALL_INTERP
5475+
#if _Py_TAIL_CALL_INTERP
54765476
int opcode;
54775477
#endif
54785478
DISPATCH();
@@ -5490,7 +5490,7 @@ dummy_func(
54905490
if (frame->owner == FRAME_OWNED_BY_INTERPRETER) {
54915491
/* Restore previous frame and exit */
54925492
tstate->current_frame = frame->previous;
5493-
#if !Py_TAIL_CALL_INTERP
5493+
#if !_Py_TAIL_CALL_INTERP
54945494
assert(frame == &entry.frame);
54955495
#endif
54965496
#ifdef _Py_TIER2
@@ -5526,7 +5526,7 @@ dummy_func(
55265526
assert(!_PyErr_Occurred(tstate));
55275527
#endif
55285528
RELOAD_STACK();
5529-
#if Py_TAIL_CALL_INTERP
5529+
#if _Py_TAIL_CALL_INTERP
55305530
int opcode;
55315531
#endif
55325532
DISPATCH();

Python/ceval.c

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

974-
#if Py_TAIL_CALL_INTERP
974+
#if _Py_TAIL_CALL_INTERP
975975
#include "opcode_targets.h"
976976
#include "generated_cases.c.h"
977977
#endif
@@ -1002,15 +1002,15 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10021002
_Py_EnsureTstateNotNULL(tstate);
10031003
CALL_STAT_INC(pyeval_calls);
10041004

1005-
#if USE_COMPUTED_GOTOS && !Py_TAIL_CALL_INTERP
1005+
#if USE_COMPUTED_GOTOS && !_Py_TAIL_CALL_INTERP
10061006
/* Import the static jump table */
10071007
#include "opcode_targets.h"
10081008
#endif
10091009

10101010
#ifdef Py_STATS
10111011
int lastopcode = 0;
10121012
#endif
1013-
#if !Py_TAIL_CALL_INTERP
1013+
#if !_Py_TAIL_CALL_INTERP
10141014
uint8_t opcode; /* Current opcode */
10151015
int oparg; /* Current opcode argument, if any */
10161016
assert(tstate->current_frame == NULL || tstate->current_frame->stackpointer != NULL);
@@ -1082,7 +1082,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10821082
next_instr = frame->instr_ptr;
10831083
monitor_throw(tstate, frame, next_instr);
10841084
stack_pointer = _PyFrame_GetStackPointer(frame);
1085-
#if Py_TAIL_CALL_INTERP
1085+
#if _Py_TAIL_CALL_INTERP
10861086
# if Py_STATS
10871087
return _TAIL_CALL_error(frame, stack_pointer, tstate, next_instr, 0, lastopcode);
10881088
# else
@@ -1098,7 +1098,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10981098
_PyExecutorObject *current_executor = NULL;
10991099
const _PyUOpInstruction *next_uop = NULL;
11001100
#endif
1101-
#if Py_TAIL_CALL_INTERP
1101+
#if _Py_TAIL_CALL_INTERP
11021102
# if Py_STATS
11031103
return _TAIL_CALL_start_frame(frame, NULL, tstate, NULL, 0, lastopcode);
11041104
# 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)