]> git.eshelyaron.com Git - emacs.git/commit
Compile any subsequence of `cond' clauses to switch (bug#36139)
authorMattias Engdegård <mattiase@acm.org>
Fri, 7 Jun 2019 15:04:10 +0000 (17:04 +0200)
committerMattias Engdegård <mattiase@acm.org>
Wed, 19 Jun 2019 09:22:21 +0000 (11:22 +0200)
commitd3a7f3e6cd0124e62ed2b5ffc87eee57fee39a9a
tree865b52b1a0a33438b35a766de7198cea8aea3488
parent14a81524c27ab54850e0fda736e4ee0c92e447b5
Compile any subsequence of `cond' clauses to switch (bug#36139)

A single `cond' form can how be compiled to any number of switch ops,
optionally interspersed with non-switch conditions.
Previously, switch ops would only be used for whole `cond' forms
containing no other tests.

* lisp/emacs-lisp/bytecomp.el (byte-compile--cond-vars):
Rename from `byte-compile-cond-vars'.
(byte-compile--default-val): Remove.
(byte-compile--cond-switch-prefix):
Replace `byte-compile-cond-jump-table-info'; now also returns
trailing non-switch clauses.
(byte-compile-cond-jump-table): New arguments; no longer compiles
the default case.
(byte-compile-cond): Look for and compile switches at any place in the
list of clauses.
* test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data):
Add test expression.
lisp/emacs-lisp/bytecomp.el
test/lisp/emacs-lisp/bytecomp-tests.el