/ Check-in [9eefabc9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a problem with the automatic generation of the opcode name table. (CVS 2163)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9eefabc92d3924bcaa2ae0f425fe5635824c64ec
User & Date: drh 2004-12-10 17:17:18
Context
2004-12-10
18:00
Factor the test for zName==NULL out of the loop. Ticket #1032. (CVS 2164) check-in: 7f38f67c user: drh tags: trunk
17:17
Fix a problem with the automatic generation of the opcode name table. (CVS 2163) check-in: 9eefabc9 user: drh tags: trunk
03:08
Back out the USE_TCL_STUBS changes because it breaks the build. I think the strategy needs to be to abandon libtool and use tcl.m4 to figure out how to build our own shared libraries. Ticket #1034. (CVS 2162) check-in: 7f4679b9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to mkopcodec.awk.

13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
  print "/* See the mkopcodec.h script for details. */"
  printf "#if !defined(SQLITE_OMIT_EXPLAIN)"
  printf    " || !defined(NDEBUG)"
  printf    " || defined(VDBE_PROFILE)"
  print     " || defined(SQLITE_DEBUG)"
  print "const char *const sqlite3OpcodeNames[] = { \"?\","
}
/^#define OP_/ {
  sub("OP_","",$2)
  print "  \"" $2 "\","

}
END {
  print "};"
  print "#endif"
}







|

|
>





13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  print "/* See the mkopcodec.h script for details. */"
  printf "#if !defined(SQLITE_OMIT_EXPLAIN)"
  printf    " || !defined(NDEBUG)"
  printf    " || defined(VDBE_PROFILE)"
  print     " || defined(SQLITE_DEBUG)"
  print "const char *const sqlite3OpcodeNames[] = { \"?\","
}
/define OP_/ {
  sub("OP_","",$2)
  i++
  printf " /* %3d */ \"%s\",\n", $3, $2
}
END {
  print "};"
  print "#endif"
}

Changes to mkopcodeh.awk.

42
43
44
45
46
47
48

49
50
51
52
53
54
55
56


57
58






59




    }
  }
}

# Assign numbers to all opcodes and output the result.
END {
  cnt = 0

  print "/* Automatically generated.  Do not edit */"
  print "/* See the mkopcodeh.awk script for details */"
  for(name in op){
    if( op[name]<0 ){
      cnt++
      while( used[cnt] ) cnt++
      op[name] = cnt
    }


    printf "#define %-30s %d\n", name, op[name]
  }






}











>








>
>


>
>
>
>
>
>
|
>
>
>
>
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
    }
  }
}

# Assign numbers to all opcodes and output the result.
END {
  cnt = 0
  max = 0
  print "/* Automatically generated.  Do not edit */"
  print "/* See the mkopcodeh.awk script for details */"
  for(name in op){
    if( op[name]<0 ){
      cnt++
      while( used[cnt] ) cnt++
      op[name] = cnt
    }
    used[op[name]] = 1;
    if( op[name]>max ) max = op[name]
    printf "#define %-30s %d\n", name, op[name]
  }
  seenUnused = 0;
  for(i=1; i<max; i++){
    if( !used[i] ){
      if( !seenUnused ){
        printf "\n/* The following opcode values are never used */\n"
        seenUnused = 1
      }
      printf "/*#define OP_?          %d  -- Not Used */\n", i
    }
  }
}