Skip to content

Commit 2ca008e

Browse files
authored
gh-105481: move Python/opcode_metadata.h to Include/internal/pycore_opcode_metadata.h (#106673)
1 parent 42bc485 commit 2ca008e

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Programs/test_frozenmain.h generated
8787
Python/Python-ast.c generated
8888
Python/executor_cases.c.h generated
8989
Python/generated_cases.c.h generated
90-
Python/opcode_metadata.h generated
90+
Include/internal/pycore_opcode_metadata.h generated
9191
Python/opcode_targets.h generated
9292
Python/stdlib_module_names.h generated
9393
Tools/peg_generator/pegen/grammar_parser.py generated
File renamed without changes.

Makefile.pre.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,30 +1548,30 @@ regen-cases:
15481548
$(srcdir)/Tools/cases_generator/generate_cases.py \
15491549
--emit-line-directives \
15501550
-o $(srcdir)/Python/generated_cases.c.h.new \
1551-
-m $(srcdir)/Python/opcode_metadata.h.new \
1551+
-m $(srcdir)/Include/internal/pycore_opcode_metadata.h.new \
15521552
-e $(srcdir)/Python/executor_cases.c.h.new \
15531553
-p $(srcdir)/Lib/_opcode_metadata.py.new \
15541554
$(srcdir)/Python/bytecodes.c
15551555
$(UPDATE_FILE) $(srcdir)/Python/generated_cases.c.h $(srcdir)/Python/generated_cases.c.h.new
1556-
$(UPDATE_FILE) $(srcdir)/Python/opcode_metadata.h $(srcdir)/Python/opcode_metadata.h.new
1556+
$(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode_metadata.h $(srcdir)/Include/internal/pycore_opcode_metadata.h.new
15571557
$(UPDATE_FILE) $(srcdir)/Python/executor_cases.c.h $(srcdir)/Python/executor_cases.c.h.new
15581558
$(UPDATE_FILE) $(srcdir)/Lib/_opcode_metadata.py $(srcdir)/Lib/_opcode_metadata.py.new
15591559

1560-
Python/compile.o: $(srcdir)/Python/opcode_metadata.h
1560+
Python/compile.o: $(srcdir)/Include/internal/pycore_opcode_metadata.h
15611561

15621562
Python/ceval.o: \
15631563
$(srcdir)/Python/ceval_macros.h \
15641564
$(srcdir)/Python/condvar.h \
15651565
$(srcdir)/Python/generated_cases.c.h \
1566-
$(srcdir)/Python/opcode_metadata.h \
1566+
$(srcdir)/Include/internal/pycore_opcode_metadata.h \
15671567
$(srcdir)/Python/opcode_targets.h
15681568

15691569
Python/flowgraph.o: \
1570-
$(srcdir)/Python/opcode_metadata.h
1570+
$(srcdir)/Include/internal/pycore_opcode_metadata.h
15711571

15721572
Python/optimizer.o: \
15731573
$(srcdir)/Python/executor_cases.c.h \
1574-
$(srcdir)/Python/opcode_metadata.h
1574+
$(srcdir)/Include/internal/pycore_opcode_metadata.h
15751575

15761576
Python/frozen.o: $(FROZEN_FILES_OUT)
15771577

Python/assemble.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <stdbool.h>
22

33
#include "Python.h"
4-
#include "pycore_code.h" // write_location_entry_start()
4+
#include "pycore_code.h" // write_location_entry_start()
55
#include "pycore_compile.h"
6-
#include "pycore_opcode.h" // _PyOpcode_Caches[] and opcode category macros
7-
#include "pycore_opcode_utils.h" // IS_BACKWARDS_JUMP_OPCODE
8-
#include "opcode_metadata.h" // IS_PSEUDO_INSTR
6+
#include "pycore_opcode.h" // _PyOpcode_Caches[] and opcode category macros
7+
#include "pycore_opcode_utils.h" // IS_BACKWARDS_JUMP_OPCODE
8+
#include "pycore_opcode_metadata.h" // IS_PSEUDO_INSTR
99

1010

1111
#define DEFAULT_CODE_SIZE 128

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "pycore_object.h" // _PyObject_GC_TRACK()
1515
#include "pycore_moduleobject.h" // PyModuleObject
1616
#include "pycore_opcode.h" // EXTRA_CASES
17+
#include "pycore_opcode_metadata.h"
1718
#include "pycore_opcode_utils.h" // MAKE_FUNCTION_*
1819
#include "pycore_pyerrors.h" // _PyErr_GetRaisedException()
1920
#include "pycore_pystate.h" // _PyInterpreterState_GET()
@@ -30,7 +31,6 @@
3031
#include "pycore_frame.h"
3132
#include "frameobject.h" // _PyInterpreterFrame_GetLine
3233
#include "opcode.h"
33-
#include "opcode_metadata.h"
3434
#include "pydtrace.h"
3535
#include "setobject.h"
3636
#include "structmember.h" // struct PyMemberDef, T_OFFSET_EX

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "pycore_pystate.h" // _Py_GetConfig()
3737
#include "pycore_symtable.h" // PySTEntryObject, _PyFuture_FromAST()
3838

39-
#include "opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
39+
#include "pycore_opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
4040

4141
#define COMP_GENEXP 0
4242
#define COMP_LISTCOMP 1

Python/flowgraph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "pycore_opcode_utils.h"
1010
#define NEED_OPCODE_METADATA
11-
#include "opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
11+
#include "pycore_opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed
1212
#undef NEED_OPCODE_METADATA
1313

1414

Python/optimizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "opcode.h"
33
#include "pycore_interp.h"
44
#include "pycore_opcode.h"
5-
#include "opcode_metadata.h"
5+
#include "pycore_opcode_metadata.h"
66
#include "pycore_opcode_utils.h"
77
#include "pycore_pystate.h" // _PyInterpreterState_GET()
88
#include "pycore_uops.h"

Tools/cases_generator/generate_cases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
DEFAULT_INPUT = os.path.relpath(os.path.join(ROOT, "Python/bytecodes.c"))
2525
DEFAULT_OUTPUT = os.path.relpath(os.path.join(ROOT, "Python/generated_cases.c.h"))
2626
DEFAULT_METADATA_OUTPUT = os.path.relpath(
27-
os.path.join(ROOT, "Python/opcode_metadata.h")
27+
os.path.join(ROOT, "Include/internal/pycore_opcode_metadata.h")
2828
)
2929
DEFAULT_PYMETADATA_OUTPUT = os.path.relpath(
3030
os.path.join(ROOT, "Lib/_opcode_metadata.py")

0 commit comments

Comments
 (0)