Skip to content

Commit b69da00

Browse files
authoredMar 20, 2025··
gh-131238: Remove includes from pycore_interp.h (#131495)
Remove also now unused includes in C files.
1 parent 34c1ea3 commit b69da00

27 files changed

+78
-90
lines changed
 

‎Include/internal/pycore_code.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include "pycore_structs.h" // _Py_CODEUNIT
12-
#include "pycore_stackref.h" // _PyStackRef
1311
#include "pycore_backoff.h" // _Py_BackoffCounter
12+
#include "pycore_structs.h" // _Py_CODEUNIT
1413
#include "pycore_tstate.h" // _PyThreadStateImpl
1514

1615

‎Include/internal/pycore_freelist.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ extern "C" {
99
#endif
1010

1111
#include "pycore_freelist_state.h" // struct _Py_freelists
12-
#include "pycore_object.h" // _PyObject_IS_GC
12+
#include "pycore_interp_structs.h" // PyInterpreterState
13+
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_PTR_RELAXED()
1314
#include "pycore_pystate.h" // _PyThreadState_GET
1415
#include "pycore_stats.h" // OBJECT_STAT_INC
1516

‎Include/internal/pycore_interp.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include "pycore_genobject.h" // _PyGen_FetchStopIterationValue
11+
#include "pycore_interp_structs.h" // PyInterpreterState
1212

1313

1414
/* interpreter state */
@@ -27,7 +27,6 @@ extern "C" {
2727

2828
extern void _PyInterpreterState_Clear(PyThreadState *tstate);
2929

30-
3130
static inline PyThreadState*
3231
_PyInterpreterState_GetFinalizing(PyInterpreterState *interp) {
3332
return (PyThreadState*)_Py_atomic_load_ptr_relaxed(&interp->_finalizing);
@@ -53,7 +52,6 @@ _PyInterpreterState_SetFinalizing(PyInterpreterState *interp, PyThreadState *tst
5352
}
5453

5554

56-
5755
// Exports for the _testinternalcapi module.
5856
PyAPI_FUNC(int64_t) _PyInterpreterState_ObjectToID(PyObject *);
5957
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_LookUpID(int64_t);

‎Modules/_interpretersmodule.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@
66
#endif
77

88
#include "Python.h"
9-
#include "pycore_abstract.h" // _PyIndex_Check()
9+
#include "pycore_code.h" // _PyCode_HAS_EXECUTORS()
1010
#include "pycore_crossinterp.h" // _PyXIData_t
1111
#include "pycore_interp.h" // _PyInterpreterState_IDIncref()
12-
#include "pycore_initconfig.h" // _PyErr_SetFromPyStatus()
1312
#include "pycore_modsupport.h" // _PyArg_BadArgument()
1413
#include "pycore_namespace.h" // _PyNamespace_New()
1514
#include "pycore_pybuffer.h" // _PyBuffer_ReleaseInInterpreterAndRawFree()
16-
#include "pycore_pyerrors.h" // _Py_excinfo
1715
#include "pycore_pylifecycle.h" // _PyInterpreterConfig_AsDict()
18-
#include "pycore_pystate.h" // _PyInterpreterState_SetRunningMain()
16+
#include "pycore_pystate.h" // _PyInterpreterState_IsRunningMain()
1917

2018
#include "marshal.h" // PyMarshal_ReadObjectFromString()
2119

‎Modules/_lsprof.c

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "pycore_ceval.h" // _PyEval_SetProfile()
88
#include "pycore_pystate.h" // _PyThreadState_GET()
99
#include "pycore_time.h" // _PyTime_FromLong()
10+
#include "pycore_typeobject.h" // _PyType_GetModuleState()
1011
#include "pycore_unicodeobject.h" // _PyUnicode_EqualToASCIIString()
1112

1213
#include "rotatingtree.h"

‎Modules/_testcapi/watchers.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include "clinic/watchers.c.h"
77

88
#define Py_BUILD_CORE
9-
#include "pycore_function.h" // FUNC_MAX_WATCHERS
10-
#include "pycore_code.h" // CODE_MAX_WATCHERS
11-
#include "pycore_context.h" // CONTEXT_MAX_WATCHERS
9+
#include "pycore_function.h" // FUNC_MAX_WATCHERS
10+
#include "pycore_interp_structs.h" // CODE_MAX_WATCHERS
11+
#include "pycore_context.h" // CONTEXT_MAX_WATCHERS
1212

1313
/*[clinic input]
1414
module _testcapi

‎Modules/_testinternalcapi.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "pycore_code.h" // _PyCode_GetTLBCFast()
1818
#include "pycore_compile.h" // _PyCompile_CodeGen()
1919
#include "pycore_context.h" // _PyContext_NewHamtForTests()
20-
#include "pycore_dict.h" // _PyManagedDictPointer_GetValues()
20+
#include "pycore_dict.h" // PyDictValues
2121
#include "pycore_fileutils.h" // _Py_normpath()
2222
#include "pycore_flowgraph.h" // _PyCompile_OptimizeCfg()
2323
#include "pycore_frame.h" // _PyInterpreterFrame
@@ -26,11 +26,11 @@
2626
#include "pycore_import.h" // _PyImport_ClearExtension()
2727
#include "pycore_initconfig.h" // _Py_GetConfigsAsDict()
2828
#include "pycore_instruction_sequence.h" // _PyInstructionSequence_New()
29+
#include "pycore_interpframe.h" // _PyFrame_GetFunction()
2930
#include "pycore_object.h" // _PyObject_IsFreed()
30-
#include "pycore_optimizer.h" // JitOptSymbol, etc.
3131
#include "pycore_pathconfig.h" // _PyPathConfig_ClearGlobal()
3232
#include "pycore_pyerrors.h" // _PyErr_ChainExceptions1()
33-
#include "pycore_pylifecycle.h" // _PyInterpreterConfig_AsDict()
33+
#include "pycore_pylifecycle.h" // _PyInterpreterConfig_InitFromDict()
3434
#include "pycore_pystate.h" // _PyThreadState_GET()
3535
#include "pycore_unicodeobject.h" // _PyUnicode_TransformDecimalAndSpaceToASCII()
3636

‎Modules/signalmodule.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "pycore_ceval.h" // _PyEval_SignalReceived()
99
#include "pycore_emscripten_signal.h" // _Py_CHECK_EMSCRIPTEN_SIGNALS
1010
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
11-
#include "pycore_frame.h" // _PyInterpreterFrame
11+
#include "pycore_interpframe.h" // _PyThreadState_GetFrame()
1212
#include "pycore_moduleobject.h" // _PyModule_GetState()
1313
#include "pycore_pyerrors.h" // _PyErr_SetString()
1414
#include "pycore_pystate.h" // _PyThreadState_GET()

‎Objects/abstract.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
#include "pycore_call.h" // _PyObject_CallNoArgs()
66
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
77
#include "pycore_crossinterp.h" // _Py_CallInInterpreter()
8+
#include "pycore_genobject.h" // _PyGen_FetchStopIterationValue()
89
#include "pycore_list.h" // _PyList_AppendTakeRef()
9-
#include "pycore_long.h" // _Py_IsNegative
10+
#include "pycore_long.h" // _PyLong_IsNegative()
1011
#include "pycore_object.h" // _Py_CheckSlotResult()
11-
#include "pycore_pybuffer.h"
12+
#include "pycore_pybuffer.h" // _PyBuffer_ReleaseInInterpreterAndRawFree()
1213
#include "pycore_pyerrors.h" // _PyErr_Occurred()
1314
#include "pycore_pystate.h" // _PyThreadState_GET()
1415
#include "pycore_tuple.h" // _PyTuple_FromArraySteal()

‎Objects/codeobject.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
#include "opcode.h"
33

44
#include "pycore_code.h" // _PyCodeConstructor
5-
#include "pycore_frame.h" // FRAME_SPECIALS_SIZE
65
#include "pycore_hashtable.h" // _Py_hashtable_t
7-
#include "pycore_index_pool.h" // _PyIndexPool
6+
#include "pycore_index_pool.h" // _PyIndexPool_Fini()
87
#include "pycore_initconfig.h" // _PyStatus_OK()
98
#include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs
10-
#include "pycore_object.h" // _PyObject_SetDeferredRefcount
11-
#include "pycore_object_stack.h"
12-
#include "pycore_opcode_metadata.h" // _PyOpcode_Deopt, _PyOpcode_Caches
9+
#include "pycore_interpframe.h" // FRAME_SPECIALS_SIZE
10+
#include "pycore_opcode_metadata.h" // _PyOpcode_Caches
1311
#include "pycore_opcode_utils.h" // RESUME_AT_FUNC_START
14-
#include "pycore_pymem.h" // _PyMem_FreeDelayed
12+
#include "pycore_pymem.h" // _PyMem_FreeDelayed()
1513
#include "pycore_pystate.h" // _PyInterpreterState_GET()
1614
#include "pycore_setobject.h" // _PySet_NextEntry()
1715
#include "pycore_tuple.h" // _PyTuple_ITEMS()

‎Objects/iterobject.c

+2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
#include "pycore_abstract.h" // _PyObject_HasLen()
55
#include "pycore_call.h" // _PyObject_CallNoArgs()
66
#include "pycore_ceval.h" // _PyEval_GetBuiltin()
7+
#include "pycore_genobject.h" // _PyCoro_GetAwaitableIter()
78
#include "pycore_object.h" // _PyObject_GC_TRACK()
89

10+
911
typedef struct {
1012
PyObject_HEAD
1113
Py_ssize_t it_index;

‎Objects/object.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,28 @@
66
#include "pycore_call.h" // _PyObject_CallNoArgs()
77
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
88
#include "pycore_context.h" // _PyContextTokenMissing_Type
9-
#include "pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION, Py_END_CRITICAL_SECTION
9+
#include "pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION
1010
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
11-
#include "pycore_dict.h" // _PyObject_MakeDictFromInstanceAttributes()
11+
#include "pycore_dict.h" // _PyObject_MaterializeManagedDict()
1212
#include "pycore_floatobject.h" // _PyFloat_DebugMallocStats()
1313
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
14+
#include "pycore_genobject.h" // _PyAsyncGenAThrow_Type
1415
#include "pycore_hamt.h" // _PyHamtItems_Type
15-
#include "pycore_hashtable.h" // _Py_hashtable_new()
16-
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
16+
#include "pycore_initconfig.h" // _PyStatus_OK()
1717
#include "pycore_instruction_sequence.h" // _PyInstructionSequence_Type
1818
#include "pycore_list.h" // _PyList_DebugMallocStats()
1919
#include "pycore_long.h" // _PyLong_GetZero()
2020
#include "pycore_memoryobject.h" // _PyManagedBuffer_Type
2121
#include "pycore_namespace.h" // _PyNamespace_Type
22-
#include "pycore_object.h" // PyAPI_DATA() _Py_SwappedOp definition
23-
#include "pycore_object_state.h" // struct _reftracer_runtime_state
24-
#include "pycore_optimizer.h" // _PyUOpExecutor_Type, ...
22+
#include "pycore_object.h" // export _Py_SwappedOp
23+
#include "pycore_optimizer.h" // _PyUOpExecutor_Type
2524
#include "pycore_pyerrors.h" // _PyErr_Occurred()
2625
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
2726
#include "pycore_pystate.h" // _PyThreadState_GET()
2827
#include "pycore_symtable.h" // PySTEntry_Type
2928
#include "pycore_tuple.h" // _PyTuple_DebugMallocStats()
3029
#include "pycore_typeobject.h" // _PyBufferWrapper_Type
31-
#include "pycore_typevarobject.h" // _PyTypeAlias_Type, _Py_initialize_generic
30+
#include "pycore_typevarobject.h" // _PyTypeAlias_Type
3231
#include "pycore_unionobject.h" // _PyUnion_Type
3332

3433

‎Objects/tupleobject.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
21
/* Tuple object implementation */
32

43
#include "Python.h"
54
#include "pycore_abstract.h" // _PyIndex_Check()
65
#include "pycore_ceval.h" // _PyEval_GetBuiltin()
7-
#include "pycore_freelist.h" // _Py_FREELIST_PUSH(), _Py_FREELIST_POP()
6+
#include "pycore_freelist.h" // _Py_FREELIST_PUSH()
87
#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED()
9-
#include "pycore_initconfig.h" // _PyStatus_OK()
108
#include "pycore_list.h" // _Py_memory_repeat()
119
#include "pycore_modsupport.h" // _PyArg_NoKwnames()
12-
#include "pycore_object.h" // _PyObject_GC_TRACK(), _Py_FatalRefcountError(), _PyDebugAllocatorStats()
10+
#include "pycore_object.h" // _PyObject_GC_TRACK()
11+
#include "pycore_stackref.h" // PyStackRef_AsPyObjectSteal()
1312
#include "pycore_tuple.h" // _PyTupleIterObject
1413

14+
1515
/*[clinic input]
1616
class tuple "PyTupleObject *" "&PyTuple_Type"
1717
[clinic start generated code]*/

‎Parser/myreadline.c

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
1414
#include "pycore_interp.h" // _PyInterpreterState_GetConfig()
1515
#include "pycore_pystate.h" // _PyThreadState_GET()
16+
#include "pycore_signal.h" // _PyOS_SigintEvent()
1617
#ifdef MS_WINDOWS
1718
# ifndef WIN32_LEAN_AND_MEAN
1819
# define WIN32_LEAN_AND_MEAN

‎Python/_warnings.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#include "Python.h"
2-
#include "pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION_MUT()
32
#include "pycore_frame.h" // PyFrameObject members
3+
#include "pycore_genobject.h" // PyAsyncGenObject
44
#include "pycore_import.h" // _PyImport_GetModules()
55
#include "pycore_interp.h" // PyInterpreterState.warnings
66
#include "pycore_long.h" // _PyLong_GetZero()
7-
#include "pycore_pyerrors.h" // _PyErr_Occurred()
87
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
98
#include "pycore_pystate.h" // _PyThreadState_GET()
109
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttr()

‎Python/ceval.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,37 @@
1010
#include "pycore_cell.h" // PyCell_GetRef()
1111
#include "pycore_ceval.h"
1212
#include "pycore_code.h"
13+
#include "pycore_dict.h"
1314
#include "pycore_emscripten_signal.h" // _Py_CHECK_EMSCRIPTEN_SIGNALS
1415
#include "pycore_floatobject.h" // _PyFloat_ExactDealloc()
16+
#include "pycore_frame.h"
1517
#include "pycore_function.h"
18+
#include "pycore_genobject.h" // _PyCoro_GetAwaitableIter()
1619
#include "pycore_import.h" // _PyImport_IsDefaultImportFunc()
1720
#include "pycore_instruments.h"
21+
#include "pycore_interpframe.h" // _PyFrame_SetStackPointer()
1822
#include "pycore_intrinsics.h"
1923
#include "pycore_jit.h"
2024
#include "pycore_list.h" // _PyList_GetItemRef()
2125
#include "pycore_long.h" // _PyLong_GetZero()
2226
#include "pycore_moduleobject.h" // PyModuleObject
2327
#include "pycore_object.h" // _PyObject_GC_TRACK()
2428
#include "pycore_opcode_metadata.h" // EXTRA_CASES
25-
#include "pycore_optimizer.h" // _PyUOpExecutor_Type
2629
#include "pycore_opcode_utils.h" // MAKE_FUNCTION_*
30+
#include "pycore_optimizer.h" // _PyUOpExecutor_Type
2731
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_*
32+
#include "pycore_pyerrors.h"
2833
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
2934
#include "pycore_pystate.h" // _PyInterpreterState_GET()
3035
#include "pycore_range.h" // _PyRangeIterObject
3136
#include "pycore_setobject.h" // _PySet_Update()
3237
#include "pycore_sliceobject.h" // _PyBuildSlice_ConsumeRefs
38+
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttrString()
3339
#include "pycore_traceback.h" // _PyTraceBack_FromFrame
3440
#include "pycore_tuple.h" // _PyTuple_ITEMS()
3541
#include "pycore_uop_ids.h" // Uops
36-
#include "pycore_pyerrors.h"
37-
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttrString()
3842

39-
#include "pycore_dict.h"
4043
#include "dictobject.h"
41-
#include "pycore_frame.h"
4244
#include "frameobject.h" // _PyInterpreterFrame_GetLine
4345
#include "opcode.h"
4446
#include "pydtrace.h"

‎Python/ceval_gil.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
21
#include "Python.h"
32
#include "pycore_ceval.h" // _PyEval_SignalReceived()
3+
#include "pycore_gc.h" // _Py_RunGC()
44
#include "pycore_initconfig.h" // _PyStatus_OK()
5-
#include "pycore_interp.h" // _Py_RunGC()
65
#include "pycore_optimizer.h" // _Py_Executors_InvalidateCold()
76
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
87
#include "pycore_pylifecycle.h" // _PyErr_Print()
9-
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
10-
#include "pycore_pystate.h" // PyThread_hang_thread()
118
#include "pycore_pystats.h" // _Py_PrintSpecializationStats()
9+
#include "pycore_runtime.h" // _PyRuntime
1210

1311

1412
/*

‎Python/crossinterp.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include "pycore_ceval.h" // _Py_simple_func
66
#include "pycore_crossinterp.h" // _PyXIData_t
77
#include "pycore_initconfig.h" // _PyStatus_OK()
8-
#include "pycore_namespace.h" //_PyNamespace_New()
9-
#include "pycore_pyerrors.h" // _PyErr_Clear()
8+
#include "pycore_namespace.h" // _PyNamespace_New()
9+
#include "pycore_typeobject.h" // _PyStaticType_InitBuiltin()
1010

1111

1212
/**************/

‎Python/gc.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44

55
#include "Python.h"
66
#include "pycore_ceval.h" // _Py_set_eval_breaker_bit()
7-
#include "pycore_context.h"
87
#include "pycore_dict.h" // _PyInlineValuesSize()
9-
#include "pycore_initconfig.h"
8+
#include "pycore_initconfig.h" // _PyStatus_OK()
109
#include "pycore_interp.h" // PyInterpreterState.gc
11-
#include "pycore_object.h"
10+
#include "pycore_interpframe.h" // _PyFrame_GetLocalsArray()
1211
#include "pycore_object_alloc.h" // _PyObject_MallocWithType()
13-
#include "pycore_pyerrors.h"
1412
#include "pycore_pystate.h" // _PyThreadState_GET()
1513
#include "pycore_tuple.h" // _PyTuple_MaybeUntrack()
1614
#include "pycore_weakref.h" // _PyWeakref_ClearRef()
1715

1816
#include "pydtrace.h"
1917

18+
2019
#ifndef Py_GIL_DISABLED
2120

2221
typedef struct _gc_runtime_state GCState;

‎Python/gc_free_threading.c

+2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
#include "pycore_dict.h" // _PyInlineValuesSize()
66
#include "pycore_frame.h" // FRAME_CLEARED
77
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
8+
#include "pycore_genobject.h" // _PyGen_GetGeneratorFromFrame()
89
#include "pycore_initconfig.h" // _PyStatus_NO_MEMORY()
910
#include "pycore_interp.h" // PyInterpreterState.gc
11+
#include "pycore_interpframe.h" // _PyFrame_GetLocalsArray()
1012
#include "pycore_object_alloc.h" // _PyObject_MallocWithType()
1113
#include "pycore_pystate.h" // _PyThreadState_GET()
1214
#include "pycore_tstate.h" // _PyThreadStateImpl

‎Python/instrumentation.c

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
#include "Python.h"
2-
#include "pycore_bitutils.h" // _Py_popcount32
3-
#include "pycore_call.h"
2+
#include "pycore_bitutils.h" // _Py_popcount32()
3+
#include "pycore_call.h" // _PyObject_VectorcallTstate()
44
#include "pycore_ceval.h" // _PY_EVAL_EVENTS_BITS
55
#include "pycore_code.h" // _PyCode_Clear_Executors()
6-
#include "pycore_critical_section.h"
7-
#include "pycore_frame.h"
8-
#include "pycore_interp.h"
9-
#include "pycore_long.h"
6+
#include "pycore_critical_section.h" // _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED()
7+
#include "pycore_frame.h" // PyFrameObject
8+
#include "pycore_interpframe.h" // _PyFrame_GetBytecode()
9+
#include "pycore_long.h" // _PyLong_GetZero()
1010
#include "pycore_modsupport.h" // _PyModule_CreateInitialized()
11-
#include "pycore_namespace.h"
12-
#include "pycore_object.h"
13-
#include "pycore_opcode_metadata.h" // IS_VALID_OPCODE, _PyOpcode_Caches
14-
#include "pycore_opcode_utils.h" // IS_CONDITIONAL_JUMP_OPCODE
11+
#include "pycore_namespace.h" // _PyNamespace_New()
12+
#include "pycore_opcode_metadata.h" // IS_VALID_OPCODE()
13+
#include "pycore_opcode_utils.h" // IS_CONDITIONAL_JUMP_OPCODE()
1514
#include "pycore_optimizer.h" // _PyExecutorObject
16-
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_UINTPTR_RELEASE
17-
#include "pycore_pyerrors.h"
15+
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_UINTPTR_RELEASE()
1816
#include "pycore_pystate.h" // _PyInterpreterState_GET()
19-
#include "pycore_runtime_structs.h" // _PyCoMonitoringData
17+
#include "pycore_runtime_structs.h" // _PyCoMonitoringData
2018
#include "pycore_tuple.h" // _PyTuple_FromArraySteal()
2119

2220
#include "opcode_ids.h"

‎Python/legacy_tracing.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
#include "pycore_audit.h" // _PySys_Audit()
77
#include "pycore_ceval.h" // export _PyEval_SetProfile()
88
#include "pycore_frame.h" // PyFrameObject members
9-
#include "pycore_object.h"
9+
#include "pycore_interpframe.h" // _PyFrame_GetCode()
1010

1111
#include "opcode.h"
1212
#include <stddef.h>
1313

14+
1415
typedef struct _PyLegacyEventHandler {
1516
PyObject_HEAD
1617
vectorcallfunc vectorcall;

‎Python/perf_trampoline.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ any DWARF information available for them).
131131

132132
#include "Python.h"
133133
#include "pycore_ceval.h" // _PyPerf_Callbacks
134-
#include "pycore_frame.h"
135-
#include "pycore_interp.h"
134+
#include "pycore_interpframe.h" // _PyFrame_GetCode()
136135
#include "pycore_runtime.h" // _PyRuntime
137136

138137

‎Python/pylifecycle.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* Python interpreter top-level routines, including init/exit */
22

33
#include "Python.h"
4+
#include "pycore_genobject.h" // included first to break dependency cycle
5+
46
#include "pycore_audit.h" // _PySys_ClearAuditHooks()
57
#include "pycore_call.h" // _PyObject_CallMethod()
68
#include "pycore_ceval.h" // _PyEval_FiniGIL()
@@ -12,10 +14,7 @@
1214
#include "pycore_floatobject.h" // _PyFloat_InitTypes()
1315
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
1416
#include "pycore_global_objects_fini_generated.h" // _PyStaticObjects_CheckRefcnt()
15-
#include "pycore_hamt.h" // _PyHamt_Type
16-
#include "pycore_import.h" // _PyImport_BootstrapImp()
1717
#include "pycore_initconfig.h" // _PyStatus_OK()
18-
#include "pycore_list.h" // _PyList_Fini()
1918
#include "pycore_long.h" // _PyLong_InitTypes()
2019
#include "pycore_object.h" // _PyDebug_PrintTotalRefs()
2120
#include "pycore_obmalloc.h" // _PyMem_init_obmalloc()
@@ -26,9 +25,7 @@
2625
#include "pycore_pystate.h" // _PyThreadState_GET()
2726
#include "pycore_runtime.h" // _Py_ID()
2827
#include "pycore_runtime_init.h" // _PyRuntimeState_INIT
29-
#include "pycore_runtime_structs.h"
3028
#include "pycore_setobject.h" // _PySet_NextEntry()
31-
#include "pycore_sliceobject.h" // _PySlice_Fini()
3229
#include "pycore_sysmodule.h" // _PySys_ClearAttrString()
3330
#include "pycore_traceback.h" // _Py_DumpTracebackThreads()
3431
#include "pycore_typeobject.h" // _PyTypes_InitTypes()

‎Python/pystate.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,32 @@
22
/* Thread and interpreter state structures and their interfaces */
33

44
#include "Python.h"
5-
#include "pycore_runtime_structs.h"
5+
#include "pycore_genobject.h" // included first to break dependency cycle
66

77
#include "pycore_abstract.h" // _PyIndex_Check()
88
#include "pycore_audit.h" // _Py_AuditHookEntry
9-
#include "pycore_ceval.h"
10-
#include "pycore_code.h" // stats
9+
#include "pycore_ceval.h" // _PyEval_AcquireLock()
1110
#include "pycore_codecs.h" // _PyCodec_Fini()
12-
#include "pycore_critical_section.h" // _PyCriticalSection_Resume()
11+
#include "pycore_critical_section.h" // _PyCriticalSection_Resume()
1312
#include "pycore_dtoa.h" // _dtoa_state_INIT()
14-
#include "pycore_emscripten_trampoline.h" // _Py_EmscriptenTrampoline_Init()
15-
#include "pycore_frame.h"
13+
#include "pycore_emscripten_trampoline.h" // _Py_EmscriptenTrampoline_Init()
1614
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
1715
#include "pycore_initconfig.h" // _PyStatus_OK()
16+
#include "pycore_interpframe.h" // _PyThreadState_HasStackSpace()
1817
#include "pycore_object.h" // _PyType_InitCache()
18+
#include "pycore_obmalloc.h" // _PyMem_obmalloc_state_on_heap()
1919
#include "pycore_optimizer.h" // JIT_CLEANUP_THRESHOLD
2020
#include "pycore_parking_lot.h" // _PyParkingLot_AfterFork()
2121
#include "pycore_pyerrors.h" // _PyErr_Clear()
2222
#include "pycore_pylifecycle.h" // _PyAST_Fini()
2323
#include "pycore_pymem.h" // _PyMem_DebugEnabled()
24-
#include "pycore_pystate.h"
2524
#include "pycore_runtime.h" // _PyRuntime
2625
#include "pycore_runtime_init.h" // _PyRuntimeState_INIT
2726
#include "pycore_stackref.h" // Py_STACKREF_DEBUG
2827
#include "pycore_time.h" // _PyTime_Init()
29-
#include "pycore_obmalloc.h" // _PyMem_obmalloc_state_on_heap()
3028
#include "pycore_uniqueid.h" // _PyObject_FinalizePerThreadRefcounts()
3129

30+
3231
/* --------------------------------------------------------------------------
3332
CAUTION
3433

‎Python/sysmodule.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Data members:
1818
#include "pycore_audit.h" // _Py_AuditHookEntry
1919
#include "pycore_call.h" // _PyObject_CallNoArgs()
2020
#include "pycore_ceval.h" // _PyEval_SetAsyncGenFinalizer()
21-
#include "pycore_dict.h" // _PyDict_GetItemWithError()
2221
#include "pycore_frame.h" // _PyInterpreterFrame
2322
#include "pycore_import.h" // _PyImport_SetDLOpenFlags()
2423
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
24+
#include "pycore_interpframe.h" // _PyFrame_GetFirstComplete()
2525
#include "pycore_long.h" // _PY_LONG_MAX_STR_DIGITS_THRESHOLD
2626
#include "pycore_modsupport.h" // _PyModule_CreateInitialized()
2727
#include "pycore_namespace.h" // _PyNamespace_New()
@@ -36,7 +36,6 @@ Data members:
3636
#include "pycore_pystats.h" // _Py_PrintSpecializationStats()
3737
#include "pycore_structseq.h" // _PyStructSequence_InitBuiltinWithFlags()
3838
#include "pycore_sysmodule.h" // export _PySys_GetSizeOf()
39-
#include "pycore_tuple.h" // _PyTuple_FromArray()
4039
#include "pycore_unicodeobject.h" // _PyUnicode_InternImmortal()
4140

4241
#include "pydtrace.h" // PyDTrace_AUDIT()

‎Python/traceback.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
/* Traceback implementation */
33

44
#include "Python.h"
5-
6-
#include "pycore_ast.h" // asdl_seq_GET()
75
#include "pycore_call.h" // _PyObject_CallMethodFormat()
86
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
9-
#include "pycore_frame.h" // _PyFrame_GetCode()
7+
#include "pycore_frame.h" // PyFrameObject
108
#include "pycore_interp.h" // PyInterpreterState.gc
11-
#include "pycore_parser.h" // _PyParser_ASTFromString
12-
#include "pycore_pyarena.h" // _PyArena_Free()
9+
#include "pycore_interpframe.h" // _PyFrame_GetCode()
1310
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
1411
#include "pycore_pystate.h" // _PyThreadState_GET()
1512
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttr()

0 commit comments

Comments
 (0)
Please sign in to comment.