Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove peephole.c
  • Loading branch information
markshannon committed Jul 20, 2020
commit 7bc252233d97a104396dd84ca6760a3a4804ce38
1 change: 0 additions & 1 deletion Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ PYTHON_OBJS= \
Python/mysnprintf.o \
Python/mystrtoul.o \
Python/pathconfig.o \
Python/peephole.o \
Python/preconfig.o \
Python/pyarena.o \
Python/pyctype.o \
Expand Down
1 change: 0 additions & 1 deletion PCbuild/pythoncore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@
<ClCompile Include="..\Python\mysnprintf.c" />
<ClCompile Include="..\Python\mystrtoul.c" />
<ClCompile Include="..\Python\pathconfig.c" />
<ClCompile Include="..\Python\peephole.c" />
<ClCompile Include="..\Python\preconfig.c" />
<ClCompile Include="..\Python\pyarena.c" />
<ClCompile Include="..\Python\pyctype.c" />
Expand Down
5 changes: 1 addition & 4 deletions PCbuild/pythoncore.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1028,9 +1028,6 @@
<ClCompile Include="..\Python\pathconfig.c">
<Filter>Python</Filter>
</ClCompile>
<ClCompile Include="..\Python\peephole.c">
<Filter>Python</Filter>
</ClCompile>
<ClCompile Include="..\Python\preconfig.c">
<Filter>Python</Filter>
</ClCompile>
Expand Down Expand Up @@ -1184,4 +1181,4 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>
12 changes: 11 additions & 1 deletion Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* 3. Generate code for basic blocks. See compiler_mod() in this file.
* 4. Assemble the basic blocks into final code. See assemble() in
* this file.
* 5. Optimize the byte code (peephole optimizations). See peephole.c
* 5. Optimize the byte code (peephole optimizations).
*
* Note that compiler_mod() suggests module, but the module ast type
* (mod_ty) has cases for expressions and interactive statements.
Expand Down Expand Up @@ -6360,4 +6360,14 @@ optimize_cfg(struct assembler *a, PyObject *consts)
return 0;
}

/* Retained for API compatibility.
* Optimization is now done in optimize_cfg */

PyObject *
PyCode_Optimize(PyObject *code, PyObject* Py_UNUSED(consts),
PyObject *Py_UNUSED(names), PyObject *Py_UNUSED(lnotab_obj))
{
Py_INCREF(code);
return code;
}

14 changes: 0 additions & 14 deletions Python/peephole.c

This file was deleted.