SQLite

Check-in [1eb56fe030]
Login

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

Overview
Comment:Modify mkopcodeh.tcl so that it can handle "same as" opcodes with values larger than the total number of opcodes.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1eb56fe0305f0841b14865b7560add3da529b211328f5fa171b9628418a6ed49
User & Date: dan 2017-07-14 17:50:11.847
Context
2017-07-14
19:12
Tweak Makefile.in so that testfixture can be built with the --disable-amalgamation configure switch. (check-in: 394c6f4f43 user: dan tags: trunk)
17:50
Modify mkopcodeh.tcl so that it can handle "same as" opcodes with values larger than the total number of opcodes. (check-in: 1eb56fe030 user: dan tags: trunk)
15:57
In the LSM1 virtual table, dequote the filename before opening the file. (check-in: 6ed4ef03ff user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to tool/mkopcodeh.tcl.
188
189
190
191
192
193
194
195

196
197
198
199

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218




219
220
221
222
223
224
225


226
227
228
229
230
231

232
233
234
235
236
237
238
    incr cnt
    while {[info exists used($cnt)]} {incr cnt}
    set op($name) $cnt
    set used($cnt) 1
    set def($cnt) $name
  }
}
set max $cnt

for {set i 0} {$i<$nOp} {incr i} {
  if {![info exists used($i)]} {
    set def($i) "OP_NotUsed_$i"
  }

  set name $def($i)
  puts -nonewline [format {#define %-16s %3d} $name $i]
  set com {}
  if {[info exists sameas($i)]} {
    set com "same as $sameas($i)"
  }
  if {[info exists synopsis($name)]} {
    set x $synopsis($name)
    if {$com==""} {
      set com "synopsis: $x"
    } else {
      append com ", synopsis: $x"
    }
  }
  if {$com!=""} {
    puts -nonewline [format " /* %-42s */" $com]
  }
  puts ""
}





# Generate the bitvectors:
#
set bv(0) 0
for {set i 0} {$i<=$max} {incr i} {
  set name $def($i)
  set x 0


  if {$jump($name)}  {incr x 1}
  if {$in1($name)}   {incr x 2}
  if {$in2($name)}   {incr x 4}
  if {$in3($name)}   {incr x 8}
  if {$out2($name)}  {incr x 16}
  if {$out3($name)}  {incr x 32}

  set bv($i) $x
}
puts ""
puts "/* Properties such as \"out2\" or \"jump\" that are specified in"
puts "** comments following the \"case\" for each opcode in the vdbe.c"
puts "** are encoded into bitvectors as follows:"
puts "*/"







|
>
|



>



















>
>
>
>





<

>
>
|
|
|
|
|
|
>







188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
    incr cnt
    while {[info exists used($cnt)]} {incr cnt}
    set op($name) $cnt
    set used($cnt) 1
    set def($cnt) $name
  }
}

set max [lindex [lsort -decr -integer [array names used]] 0]
for {set i 0} {$i<=$max} {incr i} {
  if {![info exists used($i)]} {
    set def($i) "OP_NotUsed_$i"
  }
  if {$i>$max} {set max $i}
  set name $def($i)
  puts -nonewline [format {#define %-16s %3d} $name $i]
  set com {}
  if {[info exists sameas($i)]} {
    set com "same as $sameas($i)"
  }
  if {[info exists synopsis($name)]} {
    set x $synopsis($name)
    if {$com==""} {
      set com "synopsis: $x"
    } else {
      append com ", synopsis: $x"
    }
  }
  if {$com!=""} {
    puts -nonewline [format " /* %-42s */" $com]
  }
  puts ""
}

if {$max>255} {
  error "More than 255 opcodes - VdbeOp.opcode is of type u8!"
}

# Generate the bitvectors:
#
set bv(0) 0
for {set i 0} {$i<=$max} {incr i} {

  set x 0
  set name $def($i)
  if {[string match OP_NotUsed* $name]==0} {
    if {$jump($name)}  {incr x 1}
    if {$in1($name)}   {incr x 2}
    if {$in2($name)}   {incr x 4}
    if {$in3($name)}   {incr x 8}
    if {$out2($name)}  {incr x 16}
    if {$out3($name)}  {incr x 32}
  }
  set bv($i) $x
}
puts ""
puts "/* Properties such as \"out2\" or \"jump\" that are specified in"
puts "** comments following the \"case\" for each opcode in the vdbe.c"
puts "** are encoded into bitvectors as follows:"
puts "*/"