Remove unused python_NN_unmap() functions

This commit is contained in:
Michael Hansen
2023-11-16 11:27:31 -08:00
parent 0c6128a895
commit 4ecdd1f81b
2 changed files with 1 additions and 12 deletions

View File

@@ -9,8 +9,7 @@
#endif
#define DECLARE_PYTHON(maj, min) \
extern int python_##maj##min##_map(int); \
extern int python_##maj##min##_unmap(int);
extern int python_##maj##min##_map(int);
DECLARE_PYTHON(1, 0)
DECLARE_PYTHON(1, 1)

View File

@@ -34,11 +34,9 @@ for mapver in maplist:
outfile = open(os.path.join(sys.argv[2], 'python_%d.cpp' % mapver), 'wt')
idToOpcode = {}
opcodeToId = {}
for ln in infile.readlines():
fileid, code = ln.split()
idToOpcode[int(fileid)] = code
opcodeToId[code] = int(fileid)
outfile.write('/* This file was auto-generated with comp_map.py. DO NOT EDIT! */\n\n')
outfile.write('#include "bytecode.h"\n\n')
@@ -49,14 +47,6 @@ for mapver in maplist:
outfile.write(' case %d: return Pyc::%s;\n' % (i, idToOpcode[i]))
outfile.write(' default: return Pyc::PYC_INVALID_OPCODE;\n')
outfile.write(' }\n')
outfile.write('}\n\n')
outfile.write('int python_%d_unmap(int id)\n' % mapver)
outfile.write('{\n')
outfile.write(' switch (id) {\n')
for i in sorted(opcodeToId):
outfile.write(' case Pyc::%s: return %d;\n' % (i, opcodeToId[i]))
outfile.write(' default: return -1;\n')
outfile.write(' }\n')
outfile.write('}\n')
infile.close()