diff options
| -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'.") | |||
| 172 | comp-final) | 172 | comp-final) |
| 173 | "Passes to be executed in order.") | 173 | "Passes to be executed in order.") |
| 174 | 174 | ||
| 175 | (defvar comp-post-pass-hooks () | ||
| 176 | "Alist PASS FUNCTIONS. | ||
| 177 | Each function in FUNCTIONS is run after PASS. | ||
| 178 | Useful to hook into pass checkers.") | ||
| 179 | |||
| 175 | (defconst comp-known-ret-types '((cons . cons) | 180 | (defconst comp-known-ret-types '((cons . cons) |
| 176 | (1+ . number) | 181 | (1+ . number) |
| 177 | (1- . number) | 182 | (1- . number) |
| @@ -2617,7 +2622,9 @@ Return the compilation unit file name." | |||
| 2617 | (comp-log (format "(%s) Running pass %s:\n" | 2622 | (comp-log (format "(%s) Running pass %s:\n" |
| 2618 | function-or-file pass) | 2623 | function-or-file pass) |
| 2619 | 2) | 2624 | 2) |
| 2620 | (setf data (funcall pass data))) | 2625 | (setf data (funcall pass data)) |
| 2626 | (cl-loop for f in (alist-get pass comp-post-pass-hooks) | ||
| 2627 | do (funcall f data))) | ||
| 2621 | comp-passes) | 2628 | comp-passes) |
| 2622 | (native-compiler-error | 2629 | (native-compiler-error |
| 2623 | ;; Add source input. | 2630 | ;; Add source input. |