1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 00:30:21 +02:00

bitvector-set-all-bits! / bitvector-clear-all-bits! replace bitvector-fill!

* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_set_all_bits_x)
  (scm_c_bitvector_clear_all_bits_x): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bitvector_fill_x): Deprecate.
* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
  bitvector-fill! with bitvector-set-all-bits! /
  bitvector-clear-all-bits!.
* module/system/vm/disassembler.scm (static-opcode-set): Use
  bitvector-set-bit!.
* module/system/vm/frame.scm (available-bindings): Use the new
  interfaces.
* test-suite/tests/bitvectors.test: Update.
This commit is contained in:
Andy Wingo 2020-04-15 22:14:25 +02:00
parent 8110061e64
commit d7fea13453
9 changed files with 121 additions and 63 deletions

View file

@ -1095,7 +1095,8 @@ allocation limit is exceeded, an exception will be thrown to the
bit-invert!
bitvector-clear-bit!
bitvector-clear-bits!
bitvector-fill!
bitvector-set-all-bits!
bitvector-clear-all-bits!
bitvector-set-bit!
bitvector-set-bits!)))

View file

@ -224,7 +224,7 @@
(outv (make-vector len #f))
(tmp (make-bitvector (vector-length defs) #f)))
(define (bitvector-copy! dst src)
(bitvector-fill! dst #f)
(bitvector-clear-all-bits! dst)
(bitvector-set-bits! dst src))
(define (bitvector-meet! accum src)
(bitvector-copy! tmp src)
@ -245,7 +245,9 @@
(kill (vector-ref killv n))
(gen (vector-ref genv n)))
(let ((out-count (or changed? (bitvector-count out))))
(bitvector-fill! in (not (zero? n)))
(if (zero? n)
(bitvector-clear-all-bits! in)
(bitvector-set-all-bits! in))
(let lp ((preds (vector-ref preds n)))
(match preds
(() #t)