diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-07-02 21:29:34 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-07-02 22:39:32 +0200 |
commit | b67e156041fb4bb3bc4a2cc60bca4408d092b59b (patch) | |
tree | 58733bfe95ff0e32c3efca05470f97a1427e994b /lisp/emacs-lisp/comp.el | |
parent | 25bdf99713ab21eb240d727591b638cc75ad7cf6 (diff) | |
download | emacs-b67e156041fb4bb3bc4a2cc60bca4408d092b59b.tar.gz emacs-b67e156041fb4bb3bc4a2cc60bca4408d092b59b.tar.bz2 emacs-b67e156041fb4bb3bc4a2cc60bca4408d092b59b.zip |
* Add to possibility to write per pass specific tests
* lisp/emacs-lisp/comp.el (comp-post-pass-hooks): New special
variable.
(native-compile): Run what is registered in
`comp-post-pass-hooks'.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 39b47f079e2..205966f57c6 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -172,6 +172,11 @@ Can be one of: 'd-default', 'd-impure' or 'd-ephemeral'. See `comp-ctxt'.") comp-final) "Passes to be executed in order.") +(defvar comp-post-pass-hooks () + "Alist PASS FUNCTIONS. +Each function in FUNCTIONS is run after PASS. +Useful to hook into pass checkers.") + (defconst comp-known-ret-types '((cons . cons) (1+ . number) (1- . number) @@ -2617,7 +2622,9 @@ Return the compilation unit file name." (comp-log (format "(%s) Running pass %s:\n" function-or-file pass) 2) - (setf data (funcall pass data))) + (setf data (funcall pass data)) + (cl-loop for f in (alist-get pass comp-post-pass-hooks) + do (funcall f data))) comp-passes) (native-compiler-error ;; Add source input. |