summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/easymenu.el
diff options
context:
space:
mode:
authorMattias Engdegård <mattiase@acm.org>2021-07-30 13:44:07 +0200
committerMattias Engdegård <mattiase@acm.org>2021-09-11 17:17:33 +0200
commit020a408edabcbaa3722af6fc5bb8b5fe6add6af0 (patch)
tree9175f95b1379875b9dd418b0941e79731fb33d8a /lisp/emacs-lisp/easymenu.el
parent376a31b0cdf64f4264904e2a9d49216959a35bd2 (diff)
downloademacs-020a408edabcbaa3722af6fc5bb8b5fe6add6af0.tar.gz
emacs-020a408edabcbaa3722af6fc5bb8b5fe6add6af0.tar.bz2
emacs-020a408edabcbaa3722af6fc5bb8b5fe6add6af0.zip
Propagate aliased lexical variables in byte compiler
Replace uses of a variable aliasing another variable with that aliased variable, to allow for variable removal when possible. This also enables opportunities for other optimisations. Example: (let ((y x)) (f y)) => (f x) The optimisation is only performed if both aliased and aliasing variables are lexically bound. Shadowing bindings are α-renamed when necessary for correctness. Example: (let* ((b a) (a EXPR)) (f a b)) => (let* ((a{new} EXPR)) (f a{new} a)) * lisp/emacs-lisp/byte-opt.el (byte-optimize--aliased-vars): New. (byte-optimize-form-code-walker): Cancel aliasing upon mutation. (byte-optimize--rename-var-body, byte-optimize--rename-var): New. (byte-optimize-let-form): Add the optimisation. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add relevant test cases.
Diffstat (limited to 'lisp/emacs-lisp/easymenu.el')
0 files changed, 0 insertions, 0 deletions