]> git.eshelyaron.com Git - emacs.git/commitdiff
* Add `comp-disabled-passes'
authorAndrea Corallo <akrl@sdf.org>
Wed, 8 Jul 2020 13:23:09 +0000 (14:23 +0100)
committerAndrea Corallo <akrl@sdf.org>
Thu, 9 Jul 2020 15:23:34 +0000 (16:23 +0100)
* lisp/emacs-lisp/comp.el (comp-disabled-passes): New special
variable.
(native-compile): Make use of `comp-disabled-passes'.

lisp/emacs-lisp/comp.el

index 5ff2e0983718a3a99d42626018c40f4e810a6ce0..caa6613b89372052edd5383db87ab449ec5285b6 100644 (file)
@@ -173,6 +173,10 @@ Can be one of: 'd-default', 'd-impure' or 'd-ephemeral'.  See `comp-ctxt'.")
                         comp-final)
   "Passes to be executed in order.")
 
+(defvar comp-disabled-passes '()
+  "List of disabled passes.
+For internal use only by the testsuite.")
+
 (defvar comp-post-pass-hooks ()
   "Alist PASS FUNCTIONS.
 Each function in FUNCTIONS is run after PASS.
@@ -2684,12 +2688,13 @@ Return the compilation unit file name."
     (comp-log "\n\f\n" 1)
     (condition-case err
         (mapc (lambda (pass)
-                (comp-log (format "(%s) Running pass %s:\n"
-                                  function-or-file pass)
-                          2)
-                (setf data (funcall pass data))
-                (cl-loop for f in (alist-get pass comp-post-pass-hooks)
-                         do (funcall f data)))
+                (unless (memq pass comp-disabled-passes)
+                  (comp-log (format "(%s) Running pass %s:\n"
+                                    function-or-file pass)
+                            2)
+                  (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.