From 4ecdd1f81bb77e1facd8e2fd6bddc5cbb1ce685a Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Thu, 16 Nov 2023 11:27:31 -0800 Subject: [PATCH] Remove unused python_NN_unmap() functions --- bytecode.cpp | 3 +-- bytes/comp_map.py | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/bytecode.cpp b/bytecode.cpp index 059a9d8..6edda7e 100644 --- a/bytecode.cpp +++ b/bytecode.cpp @@ -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) diff --git a/bytes/comp_map.py b/bytes/comp_map.py index 1f4c489..408b830 100755 --- a/bytes/comp_map.py +++ b/bytes/comp_map.py @@ -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()