summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-07-12 10:30:25 (GMT)
committerGitHub <noreply@github.com>2023-07-12 10:30:25 (GMT)
commit2ca008e2b738b8c08b4bf46b2b23f315d6510d92 (patch)
treeca5812fe257be990c39b22c58c6d1249b17cbb6e
parent42bc485a24f0f67751474bd1697e1beb4a783b9a (diff)
downloadcpython-2ca008e2b738b8c08b4bf46b2b23f315d6510d92.zip
cpython-2ca008e2b738b8c08b4bf46b2b23f315d6510d92.tar.gz
cpython-2ca008e2b738b8c08b4bf46b2b23f315d6510d92.tar.bz2
gh-105481: move Python/opcode_metadata.h to Include/internal/pycore_opcode_metadata.h (#106673)
-rw-r--r--.gitattributes2
-rw-r--r--Include/internal/pycore_opcode_metadata.h (renamed from Python/opcode_metadata.h)0
-rw-r--r--Makefile.pre.in12
-rw-r--r--Python/assemble.c8
-rw-r--r--Python/ceval.c2
-rw-r--r--Python/compile.c2
-rw-r--r--Python/flowgraph.c2
-rw-r--r--Python/optimizer.c2
-rw-r--r--Tools/cases_generator/generate_cases.py2
9 files changed, 16 insertions, 16 deletions
diff --git a/.gitattributes b/.gitattributes
index 5e4ce96..2616da7 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -87,7 +87,7 @@ Programs/test_frozenmain.h generated
Python/Python-ast.c generated
Python/executor_cases.c.h generated
Python/generated_cases.c.h generated
-Python/opcode_metadata.h generated
+Include/internal/pycore_opcode_metadata.h generated
Python/opcode_targets.h generated
Python/stdlib_module_names.h generated
Tools/peg_generator/pegen/grammar_parser.py generated
diff --git a/Python/opcode_metadata.h b/Include/internal/pycore_opcode_metadata.h
index 4a41cd8..4a41cd8 100644
--- a/Python/opcode_metadata.h
+++ b/Include/internal/pycore_opcode_metadata.h
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 073b4bc..a1ceedb 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1548,30 +1548,30 @@ regen-cases:
$(srcdir)/Tools/cases_generator/generate_cases.py \
--emit-line-directives \
-o $(srcdir)/Python/generated_cases.c.h.new \
- -m $(srcdir)/Python/opcode_metadata.h.new \
+ -m $(srcdir)/Include/internal/pycore_opcode_metadata.h.new \
-e $(srcdir)/Python/executor_cases.c.h.new \
-p $(srcdir)/Lib/_opcode_metadata.py.new \
$(srcdir)/Python/bytecodes.c
$(UPDATE_FILE) $(srcdir)/Python/generated_cases.c.h $(srcdir)/Python/generated_cases.c.h.new
- $(UPDATE_FILE) $(srcdir)/Python/opcode_metadata.h $(srcdir)/Python/opcode_metadata.h.new
+ $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode_metadata.h $(srcdir)/Include/internal/pycore_opcode_metadata.h.new
$(UPDATE_FILE) $(srcdir)/Python/executor_cases.c.h $(srcdir)/Python/executor_cases.c.h.new
$(UPDATE_FILE) $(srcdir)/Lib/_opcode_metadata.py $(srcdir)/Lib/_opcode_metadata.py.new
-Python/compile.o: $(srcdir)/Python/opcode_metadata.h
+Python/compile.o: $(srcdir)/Include/internal/pycore_opcode_metadata.h
Python/ceval.o: \
$(srcdir)/Python/ceval_macros.h \
$(srcdir)/Python/condvar.h \
$(srcdir)/Python/generated_cases.c.h \
- $(srcdir)/Python/opcode_metadata.h \
+ $(srcdir)/Include/internal/pycore_opcode_metadata.h \
$(srcdir)/Python/opcode_targets.h
Python/flowgraph.o: \
- $(srcdir)/Python/opcode_metadata.h
+ $(srcdir)/Include/internal/pycore_opcode_metadata.h
Python/optimizer.o: \
$(srcdir)/Python/executor_cases.c.h \
- $(srcdir)/Python/opcode_metadata.h
+ $(srcdir)/Include/internal/pycore_opcode_metadata.h
Python/frozen.o: $(FROZEN_FILES_OUT)
diff --git a/Python/assemble.c b/Python/assemble.c
index ff7bca2..b701253 100644
--- a/Python/assemble.c
+++ b/Python/assemble.c
@@ -1,11 +1,11 @@
#include <stdbool.h>
#include "Python.h"
-#include "pycore_code.h" // write_location_entry_start()
+#include "pycore_code.h" // write_location_entry_start()
#include "pycore_compile.h"
-#include "pycore_opcode.h" // _PyOpcode_Caches[] and opcode category macros
-#include "pycore_opcode_utils.h" // IS_BACKWARDS_JUMP_OPCODE
-#include "opcode_metadata.h" // IS_PSEUDO_INSTR
+#include "pycore_opcode.h" // _PyOpcode_Caches[] and opcode category macros
+#include "pycore_opcode_utils.h" // IS_BACKWARDS_JUMP_OPCODE
+#include "pycore_opcode_metadata.h" // IS_PSEUDO_INSTR
#define DEFAULT_CODE_SIZE 128
diff --git a/Python/ceval.c b/Python/ceval.c
index 63150a9..de44085 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -14,6 +14,7 @@
#include "pycore_object.h" // _PyObject_GC_TRACK()
#include "pycore_moduleobject.h" // PyModuleObject
#include "pycore_opcode.h" // EXTRA_CASES
+#include "pycore_opcode_metadata.h"
#include "pycore_opcode_utils.h" // MAKE_FUNCTION_*
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
#include "pycore_pystate.h" // _PyInterpreterState_GET()
@@ -30,7 +31,6 @@
#include "pycore_frame.h"
#include "frameobject.h" // _PyInterpreterFrame_GetLine
#include "opcode.h"
-#include "opcode_metadata.h"
#include "pydtrace.h"
#include "setobject.h"
#include "structmember.h" // struct PyMemberDef, T_OFFSET_EX
diff --git a/Python/compile.c b/Python/compile.c
index 29ea274..d9e38cf 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -36,7 +36,7 @@
#include "pycore_pystate.h" // _Py_GetConfig()
#include "pycore_symtable.h" // PySTEntryObject, _PyFuture_FromAST()
-#include "opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
+#include "pycore_opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
#define COMP_GENEXP 0
#define COMP_LISTCOMP 1
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index e159a43..04f269c 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -8,7 +8,7 @@
#include "pycore_opcode_utils.h"
#define NEED_OPCODE_METADATA
-#include "opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
+#include "pycore_opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
#undef NEED_OPCODE_METADATA
diff --git a/Python/optimizer.c b/Python/optimizer.c
index 7fc40e6..c3fdee6 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -2,7 +2,7 @@
#include "opcode.h"
#include "pycore_interp.h"
#include "pycore_opcode.h"
-#include "opcode_metadata.h"
+#include "pycore_opcode_metadata.h"
#include "pycore_opcode_utils.h"
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_uops.h"
diff --git a/Tools/cases_generator/generate_cases.py b/Tools/cases_generator/generate_cases.py
index 8c77c1f..a20abcd 100644
--- a/Tools/cases_generator/generate_cases.py
+++ b/Tools/cases_generator/generate_cases.py
@@ -24,7 +24,7 @@ THIS = os.path.relpath(__file__, ROOT).replace(os.path.sep, posixpath.sep)
DEFAULT_INPUT = os.path.relpath(os.path.join(ROOT, "Python/bytecodes.c"))
DEFAULT_OUTPUT = os.path.relpath(os.path.join(ROOT, "Python/generated_cases.c.h"))
DEFAULT_METADATA_OUTPUT = os.path.relpath(
- os.path.join(ROOT, "Python/opcode_metadata.h")
+ os.path.join(ROOT, "Include/internal/pycore_opcode_metadata.h")
)
DEFAULT_PYMETADATA_OUTPUT = os.path.relpath(
os.path.join(ROOT, "Lib/_opcode_metadata.py")