gh-130931: Add pycore_typedefs.h internal header (#131396)

Declare _PyInterpreterFrame and _PyRuntimeState types before
declaring their structure members. Break reference cycles between
header files.
This commit is contained in:
Victor Stinner 2025-03-19 15:23:32 +01:00 committed by GitHub
parent a0478c9f0c
commit b8367e7cf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 57 additions and 28 deletions

View file

@ -8,6 +8,7 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif
#include "pycore_typedefs.h" // _PyInterpreterFrame
#include "pycore_uop_ids.h"
#include <stdbool.h>
@ -117,7 +118,7 @@ PyAPI_FUNC(void) _Py_Executors_InvalidateCold(PyInterpreterState *interp);
#define TRACE_STACK_SIZE 5
int _Py_uop_analyze_and_optimize(struct _PyInterpreterFrame *frame,
int _Py_uop_analyze_and_optimize(_PyInterpreterFrame *frame,
_PyUOpInstruction *trace, int trace_len, int curr_stackentries,
_PyBloomFilter *dependencies);
@ -291,7 +292,7 @@ extern int _Py_uop_frame_pop(JitOptContext *ctx);
PyAPI_FUNC(PyObject *) _Py_uop_symbols_test(PyObject *self, PyObject *ignored);
PyAPI_FUNC(int) _PyOptimizer_Optimize(struct _PyInterpreterFrame *frame, _Py_CODEUNIT *start, _PyExecutorObject **exec_ptr, int chain_depth);
PyAPI_FUNC(int) _PyOptimizer_Optimize(_PyInterpreterFrame *frame, _Py_CODEUNIT *start, _PyExecutorObject **exec_ptr, int chain_depth);
static inline int is_terminator(const _PyUOpInstruction *uop)
{