Update the generator AWK script for opcodes.h so that it always generates

opcode numbers in the same order and is not dependent on the hash order
of opcode names within AWK.

FossilOrigin-Name: e730195f52429dc1bc4c1559880effd68e3eced9
This commit is contained in:
drh 2009-11-02 18:14:50 +00:00
parent 539a20fa7c
commit b24a2001cc
3 changed files with 19 additions and 22 deletions

View File

@ -1,8 +1,8 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Do\snot\sinsert\sthe\sdate\sand\stime\sof\sgeneration\sinto\sthe\samalgamation.
D 2009-11-02T18:01:50
C Update\sthe\sgenerator\sAWK\sscript\sfor\sopcodes.h\sso\sthat\sit\salways\sgenerates\nopcode\snumbers\sin\sthe\ssame\sorder\sand\sis\snot\sdependent\son\sthe\shash\sorder\nof\sopcode\snames\swithin\sAWK.
D 2009-11-02T18:14:50
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a77dfde96ad86aafd3f71651a4333a104debe86a
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -94,7 +94,7 @@ F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f
F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac
F mkopcodec.awk 3fb9bf077053c968451f4dd03d11661ac373f9d1
F mkopcodeh.awk 513946ce4429bf2723aef0d640eb4d2493deb68e
F mkopcodeh.awk f33c497a3d6436c5db531afce1f07f1b80de7af7
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
F publish.sh c74b6c2b6b63435aa1b4b43b1396dfebfae84095
F publish_osx.sh 2ad2ee7d50632dff99949edc9c162dbb052f7534
@ -764,14 +764,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P f19cb105d929f0a56f9597b6eb33ad96d0f7eddc
R 222ce2b506b5306f772956b2e9bcc307
P 9f6cf13dfbe6f1fe0c05a9c5df557ae20dc08cbd
R 670dbfb3f1638e27958aebe5405b2480
U drh
Z 61d332dffe9fc2dd5214f98fdef8985a
Z 120b7a5204e72c359ceb7fe4b8d0946e
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFK7x6RoxKgR168RlERAlgdAJ9boV/waRTTo1kQPU/vbcOMeGJM0wCfXhJE
aRHwRgWydLcaVQ7lCTUi9pI=
=F8Jd
iD8DBQFK7yGdoxKgR168RlERAqALAJwMgUFh451psMmH/dQjCxEIobwEGwCfSYBc
ggSE79NEZkMsrwnv1Mi1P3c=
=7XS6
-----END PGP SIGNATURE-----

View File

@ -1 +1 @@
9f6cf13dfbe6f1fe0c05a9c5df557ae20dc08cbd
e730195f52429dc1bc4c1559880effd68e3eced9

View File

@ -25,17 +25,11 @@
#
# This script also scans for lines of the form:
#
# case OP_aaaa: /* no-push */
# case OP_aaaa: /* jump, in1, in2, in3, out2-prerelease, out3 */
#
# When the no-push comment is found on an opcode, it means that that
# opcode does not leave a result on the stack. By identifying which
# opcodes leave results on the stack it is possible to determine a
# much smaller upper bound on the size of the stack. This allows
# a smaller stack to be allocated, which is important to embedded
# systems with limited memory space. This script generates a series
# of "NOPUSH_MASK" defines that contain bitmaps of opcodes that leave
# results on the stack. The NOPUSH_MASK defines are used in vdbeaux.c
# to help determine the maximum stack size.
# When such comments are found on an opcode, it means that certain
# properties apply to that opcode. Set corresponding flags using the
# OPFLG_INITIALIZER macro.
#
@ -80,6 +74,7 @@
out3[name] = 1
}
}
order[n_op++] = name;
}
# Assign numbers to all opcodes and output the result.
@ -90,7 +85,8 @@ END {
print "/* See the mkopcodeh.awk script for details */"
op["OP_Noop"] = -1;
op["OP_Explain"] = -1;
for(name in op){
for(i=0; i<n_op; i++){
name = order[i];
if( op[name]<0 ){
cnt++
while( used[cnt] ) cnt++
@ -123,7 +119,8 @@ END {
# bit 2: output to p1. release p1 before opcode runs
#
for(i=0; i<=max; i++) bv[i] = 0;
for(name in op){
for(i=0; i<n_op; i++){
name = order[i];
x = op[name]
a0 = a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0
# a8 = a9 = a10 = a11 = a12 = a13 = a14 = a15 = 0