gh-131238: Remove includes from pycore_interp.h (#131495)

Remove also now unused includes in C files.
This commit is contained in:
Victor Stinner 2025-03-20 12:35:23 +01:00 committed by GitHub
parent 34c1ea3109
commit b69da006a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 78 additions and 90 deletions

View file

@ -1,10 +1,9 @@
#include "Python.h"
#include "pycore_critical_section.h" // Py_BEGIN_CRITICAL_SECTION_MUT()
#include "pycore_frame.h" // PyFrameObject members
#include "pycore_genobject.h" // PyAsyncGenObject
#include "pycore_import.h" // _PyImport_GetModules()
#include "pycore_interp.h" // PyInterpreterState.warnings
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_pyerrors.h" // _PyErr_Occurred()
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttr()

View file

@ -10,11 +10,15 @@
#include "pycore_cell.h" // PyCell_GetRef()
#include "pycore_ceval.h"
#include "pycore_code.h"
#include "pycore_dict.h"
#include "pycore_emscripten_signal.h" // _Py_CHECK_EMSCRIPTEN_SIGNALS
#include "pycore_floatobject.h" // _PyFloat_ExactDealloc()
#include "pycore_frame.h"
#include "pycore_function.h"
#include "pycore_genobject.h" // _PyCoro_GetAwaitableIter()
#include "pycore_import.h" // _PyImport_IsDefaultImportFunc()
#include "pycore_instruments.h"
#include "pycore_interpframe.h" // _PyFrame_SetStackPointer()
#include "pycore_intrinsics.h"
#include "pycore_jit.h"
#include "pycore_list.h" // _PyList_GetItemRef()
@ -22,23 +26,21 @@
#include "pycore_moduleobject.h" // PyModuleObject
#include "pycore_object.h" // _PyObject_GC_TRACK()
#include "pycore_opcode_metadata.h" // EXTRA_CASES
#include "pycore_optimizer.h" // _PyUOpExecutor_Type
#include "pycore_opcode_utils.h" // MAKE_FUNCTION_*
#include "pycore_optimizer.h" // _PyUOpExecutor_Type
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_*
#include "pycore_pyerrors.h"
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_range.h" // _PyRangeIterObject
#include "pycore_setobject.h" // _PySet_Update()
#include "pycore_sliceobject.h" // _PyBuildSlice_ConsumeRefs
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttrString()
#include "pycore_traceback.h" // _PyTraceBack_FromFrame
#include "pycore_tuple.h" // _PyTuple_ITEMS()
#include "pycore_uop_ids.h" // Uops
#include "pycore_pyerrors.h"
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttrString()
#include "pycore_dict.h"
#include "dictobject.h"
#include "pycore_frame.h"
#include "frameobject.h" // _PyInterpreterFrame_GetLine
#include "opcode.h"
#include "pydtrace.h"

View file

@ -1,14 +1,12 @@
#include "Python.h"
#include "pycore_ceval.h" // _PyEval_SignalReceived()
#include "pycore_gc.h" // _Py_RunGC()
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_interp.h" // _Py_RunGC()
#include "pycore_optimizer.h" // _Py_Executors_InvalidateCold()
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
#include "pycore_pylifecycle.h" // _PyErr_Print()
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
#include "pycore_pystate.h" // PyThread_hang_thread()
#include "pycore_pystats.h" // _Py_PrintSpecializationStats()
#include "pycore_runtime.h" // _PyRuntime
/*

View file

@ -5,8 +5,8 @@
#include "pycore_ceval.h" // _Py_simple_func
#include "pycore_crossinterp.h" // _PyXIData_t
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_namespace.h" //_PyNamespace_New()
#include "pycore_pyerrors.h" // _PyErr_Clear()
#include "pycore_namespace.h" // _PyNamespace_New()
#include "pycore_typeobject.h" // _PyStaticType_InitBuiltin()
/**************/

View file

@ -4,19 +4,18 @@
#include "Python.h"
#include "pycore_ceval.h" // _Py_set_eval_breaker_bit()
#include "pycore_context.h"
#include "pycore_dict.h" // _PyInlineValuesSize()
#include "pycore_initconfig.h"
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_interp.h" // PyInterpreterState.gc
#include "pycore_object.h"
#include "pycore_interpframe.h" // _PyFrame_GetLocalsArray()
#include "pycore_object_alloc.h" // _PyObject_MallocWithType()
#include "pycore_pyerrors.h"
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_tuple.h" // _PyTuple_MaybeUntrack()
#include "pycore_weakref.h" // _PyWeakref_ClearRef()
#include "pydtrace.h"
#ifndef Py_GIL_DISABLED
typedef struct _gc_runtime_state GCState;

View file

@ -5,8 +5,10 @@
#include "pycore_dict.h" // _PyInlineValuesSize()
#include "pycore_frame.h" // FRAME_CLEARED
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
#include "pycore_genobject.h" // _PyGen_GetGeneratorFromFrame()
#include "pycore_initconfig.h" // _PyStatus_NO_MEMORY()
#include "pycore_interp.h" // PyInterpreterState.gc
#include "pycore_interpframe.h" // _PyFrame_GetLocalsArray()
#include "pycore_object_alloc.h" // _PyObject_MallocWithType()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_tstate.h" // _PyThreadStateImpl

View file

@ -1,22 +1,20 @@
#include "Python.h"
#include "pycore_bitutils.h" // _Py_popcount32
#include "pycore_call.h"
#include "pycore_bitutils.h" // _Py_popcount32()
#include "pycore_call.h" // _PyObject_VectorcallTstate()
#include "pycore_ceval.h" // _PY_EVAL_EVENTS_BITS
#include "pycore_code.h" // _PyCode_Clear_Executors()
#include "pycore_critical_section.h"
#include "pycore_frame.h"
#include "pycore_interp.h"
#include "pycore_long.h"
#include "pycore_critical_section.h" // _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED()
#include "pycore_frame.h" // PyFrameObject
#include "pycore_interpframe.h" // _PyFrame_GetBytecode()
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_modsupport.h" // _PyModule_CreateInitialized()
#include "pycore_namespace.h"
#include "pycore_object.h"
#include "pycore_opcode_metadata.h" // IS_VALID_OPCODE, _PyOpcode_Caches
#include "pycore_opcode_utils.h" // IS_CONDITIONAL_JUMP_OPCODE
#include "pycore_namespace.h" // _PyNamespace_New()
#include "pycore_opcode_metadata.h" // IS_VALID_OPCODE()
#include "pycore_opcode_utils.h" // IS_CONDITIONAL_JUMP_OPCODE()
#include "pycore_optimizer.h" // _PyExecutorObject
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_UINTPTR_RELEASE
#include "pycore_pyerrors.h"
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_UINTPTR_RELEASE()
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_runtime_structs.h" // _PyCoMonitoringData
#include "pycore_runtime_structs.h" // _PyCoMonitoringData
#include "pycore_tuple.h" // _PyTuple_FromArraySteal()
#include "opcode_ids.h"

View file

@ -6,11 +6,12 @@
#include "pycore_audit.h" // _PySys_Audit()
#include "pycore_ceval.h" // export _PyEval_SetProfile()
#include "pycore_frame.h" // PyFrameObject members
#include "pycore_object.h"
#include "pycore_interpframe.h" // _PyFrame_GetCode()
#include "opcode.h"
#include <stddef.h>
typedef struct _PyLegacyEventHandler {
PyObject_HEAD
vectorcallfunc vectorcall;

View file

@ -131,8 +131,7 @@ any DWARF information available for them).
#include "Python.h"
#include "pycore_ceval.h" // _PyPerf_Callbacks
#include "pycore_frame.h"
#include "pycore_interp.h"
#include "pycore_interpframe.h" // _PyFrame_GetCode()
#include "pycore_runtime.h" // _PyRuntime

View file

@ -1,6 +1,8 @@
/* Python interpreter top-level routines, including init/exit */
#include "Python.h"
#include "pycore_genobject.h" // included first to break dependency cycle
#include "pycore_audit.h" // _PySys_ClearAuditHooks()
#include "pycore_call.h" // _PyObject_CallMethod()
#include "pycore_ceval.h" // _PyEval_FiniGIL()
@ -12,10 +14,7 @@
#include "pycore_floatobject.h" // _PyFloat_InitTypes()
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
#include "pycore_global_objects_fini_generated.h" // _PyStaticObjects_CheckRefcnt()
#include "pycore_hamt.h" // _PyHamt_Type
#include "pycore_import.h" // _PyImport_BootstrapImp()
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_list.h" // _PyList_Fini()
#include "pycore_long.h" // _PyLong_InitTypes()
#include "pycore_object.h" // _PyDebug_PrintTotalRefs()
#include "pycore_obmalloc.h" // _PyMem_init_obmalloc()
@ -26,9 +25,7 @@
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_runtime.h" // _Py_ID()
#include "pycore_runtime_init.h" // _PyRuntimeState_INIT
#include "pycore_runtime_structs.h"
#include "pycore_setobject.h" // _PySet_NextEntry()
#include "pycore_sliceobject.h" // _PySlice_Fini()
#include "pycore_sysmodule.h" // _PySys_ClearAttrString()
#include "pycore_traceback.h" // _Py_DumpTracebackThreads()
#include "pycore_typeobject.h" // _PyTypes_InitTypes()

View file

@ -2,33 +2,32 @@
/* Thread and interpreter state structures and their interfaces */
#include "Python.h"
#include "pycore_runtime_structs.h"
#include "pycore_genobject.h" // included first to break dependency cycle
#include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_audit.h" // _Py_AuditHookEntry
#include "pycore_ceval.h"
#include "pycore_code.h" // stats
#include "pycore_ceval.h" // _PyEval_AcquireLock()
#include "pycore_codecs.h" // _PyCodec_Fini()
#include "pycore_critical_section.h" // _PyCriticalSection_Resume()
#include "pycore_critical_section.h" // _PyCriticalSection_Resume()
#include "pycore_dtoa.h" // _dtoa_state_INIT()
#include "pycore_emscripten_trampoline.h" // _Py_EmscriptenTrampoline_Init()
#include "pycore_frame.h"
#include "pycore_emscripten_trampoline.h" // _Py_EmscriptenTrampoline_Init()
#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_interpframe.h" // _PyThreadState_HasStackSpace()
#include "pycore_object.h" // _PyType_InitCache()
#include "pycore_obmalloc.h" // _PyMem_obmalloc_state_on_heap()
#include "pycore_optimizer.h" // JIT_CLEANUP_THRESHOLD
#include "pycore_parking_lot.h" // _PyParkingLot_AfterFork()
#include "pycore_pyerrors.h" // _PyErr_Clear()
#include "pycore_pylifecycle.h" // _PyAST_Fini()
#include "pycore_pymem.h" // _PyMem_DebugEnabled()
#include "pycore_pystate.h"
#include "pycore_runtime.h" // _PyRuntime
#include "pycore_runtime_init.h" // _PyRuntimeState_INIT
#include "pycore_stackref.h" // Py_STACKREF_DEBUG
#include "pycore_time.h" // _PyTime_Init()
#include "pycore_obmalloc.h" // _PyMem_obmalloc_state_on_heap()
#include "pycore_uniqueid.h" // _PyObject_FinalizePerThreadRefcounts()
/* --------------------------------------------------------------------------
CAUTION

View file

@ -18,10 +18,10 @@ Data members:
#include "pycore_audit.h" // _Py_AuditHookEntry
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _PyEval_SetAsyncGenFinalizer()
#include "pycore_dict.h" // _PyDict_GetItemWithError()
#include "pycore_frame.h" // _PyInterpreterFrame
#include "pycore_import.h" // _PyImport_SetDLOpenFlags()
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
#include "pycore_interpframe.h" // _PyFrame_GetFirstComplete()
#include "pycore_long.h" // _PY_LONG_MAX_STR_DIGITS_THRESHOLD
#include "pycore_modsupport.h" // _PyModule_CreateInitialized()
#include "pycore_namespace.h" // _PyNamespace_New()
@ -36,7 +36,6 @@ Data members:
#include "pycore_pystats.h" // _Py_PrintSpecializationStats()
#include "pycore_structseq.h" // _PyStructSequence_InitBuiltinWithFlags()
#include "pycore_sysmodule.h" // export _PySys_GetSizeOf()
#include "pycore_tuple.h" // _PyTuple_FromArray()
#include "pycore_unicodeobject.h" // _PyUnicode_InternImmortal()
#include "pydtrace.h" // PyDTrace_AUDIT()

View file

@ -2,14 +2,11 @@
/* Traceback implementation */
#include "Python.h"
#include "pycore_ast.h" // asdl_seq_GET()
#include "pycore_call.h" // _PyObject_CallMethodFormat()
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
#include "pycore_frame.h" // _PyFrame_GetCode()
#include "pycore_frame.h" // PyFrameObject
#include "pycore_interp.h" // PyInterpreterState.gc
#include "pycore_parser.h" // _PyParser_ASTFromString
#include "pycore_pyarena.h" // _PyArena_Free()
#include "pycore_interpframe.h" // _PyFrame_GetCode()
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttr()