]> git.eshelyaron.com Git - emacs.git/commit
Normalise setq during macro-expansion
authorMattias Engdegård <mattiase@acm.org>
Fri, 3 Jun 2022 18:31:10 +0000 (20:31 +0200)
committerMattias Engdegård <mattiase@acm.org>
Tue, 14 Jun 2022 18:19:59 +0000 (20:19 +0200)
commit6825e5686a4bf21f5d5a0ae1af889097cfa2f597
treea296141574d6ac3bc085df708d3feeb817f83204
parent175bc8e5a53740432c844b5aae1981d4f47c96f7
Normalise setq during macro-expansion

Early normalisation of setq during macroexpand-all allows later
stages, cconv, byte-opt and codegen, to be simplified and duplicated
checks to be eliminated.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Normalise all setq forms to a sequence of (setq VAR EXPR).
Emit warnings if necessary.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyze-form):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq):
Simplify.
* test/lisp/emacs-lisp/bytecomp-tests.el: Adapt and add tests.
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-nonvariable.el;
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-odd.el:
New files.
lisp/emacs-lisp/byte-opt.el
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/cconv.el
lisp/emacs-lisp/macroexp.el
test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-nonvariable.el [new file with mode: 0644]
test/lisp/emacs-lisp/bytecomp-resources/warn-variable-setq-odd.el [new file with mode: 0644]
test/lisp/emacs-lisp/bytecomp-tests.el