Skip to content

Commit 7bc2522

Browse files
committed
Remove peephole.c
1 parent a2915d5 commit 7bc2522

File tree

5 files changed

+12
-21
lines changed

5 files changed

+12
-21
lines changed

Makefile.pre.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ PYTHON_OBJS= \
354354
Python/mysnprintf.o \
355355
Python/mystrtoul.o \
356356
Python/pathconfig.o \
357-
Python/peephole.o \
358357
Python/preconfig.o \
359358
Python/pyarena.o \
360359
Python/pyctype.o \

PCbuild/pythoncore.vcxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@
460460
<ClCompile Include="..\Python\mysnprintf.c" />
461461
<ClCompile Include="..\Python\mystrtoul.c" />
462462
<ClCompile Include="..\Python\pathconfig.c" />
463-
<ClCompile Include="..\Python\peephole.c" />
464463
<ClCompile Include="..\Python\preconfig.c" />
465464
<ClCompile Include="..\Python\pyarena.c" />
466465
<ClCompile Include="..\Python\pyctype.c" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,6 @@
10281028
<ClCompile Include="..\Python\pathconfig.c">
10291029
<Filter>Python</Filter>
10301030
</ClCompile>
1031-
<ClCompile Include="..\Python\peephole.c">
1032-
<Filter>Python</Filter>
1033-
</ClCompile>
10341031
<ClCompile Include="..\Python\preconfig.c">
10351032
<Filter>Python</Filter>
10361033
</ClCompile>
@@ -1184,4 +1181,4 @@
11841181
<Filter>Resource Files</Filter>
11851182
</ResourceCompile>
11861183
</ItemGroup>
1187-
</Project>
1184+
</Project>

Python/compile.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* 3. Generate code for basic blocks. See compiler_mod() in this file.
1010
* 4. Assemble the basic blocks into final code. See assemble() in
1111
* this file.
12-
* 5. Optimize the byte code (peephole optimizations). See peephole.c
12+
* 5. Optimize the byte code (peephole optimizations).
1313
*
1414
* Note that compiler_mod() suggests module, but the module ast type
1515
* (mod_ty) has cases for expressions and interactive statements.
@@ -6360,4 +6360,14 @@ optimize_cfg(struct assembler *a, PyObject *consts)
63606360
return 0;
63616361
}
63626362

6363+
/* Retained for API compatibility.
6364+
* Optimization is now done in optimize_cfg */
6365+
6366+
PyObject *
6367+
PyCode_Optimize(PyObject *code, PyObject* Py_UNUSED(consts),
6368+
PyObject *Py_UNUSED(names), PyObject *Py_UNUSED(lnotab_obj))
6369+
{
6370+
Py_INCREF(code);
6371+
return code;
6372+
}
63636373

Python/peephole.c

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)