]> git.eshelyaron.com Git - emacs.git/commitdiff
* Move context output computation in `comp-spill-lap-function'
authorAndrea Corallo <akrl@sdf.org>
Sat, 10 Oct 2020 19:16:40 +0000 (21:16 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 14 Oct 2020 09:04:36 +0000 (11:04 +0200)
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Move
output filename computation here.
(native-compile): From here.

lisp/emacs-lisp/comp.el

index b4a86fc83ec667a518dd201b66576034be5e210c..26654a300a2211ed84d14581edb3dc1cb5ae41af 100644 (file)
@@ -662,6 +662,9 @@ clashes."
 
 (cl-defmethod comp-spill-lap-function ((function-name symbol))
   "Byte-compile FUNCTION-NAME spilling data from the byte compiler."
+  (unless (comp-ctxt-output comp-ctxt)
+    (setf (comp-ctxt-output comp-ctxt)
+          (make-temp-file (symbol-name function-name) nil ".eln")))
   (let* ((f (symbol-function function-name))
          (c-name (comp-c-func-name function-name "F"))
          (func (make-comp-func-l :name function-name
@@ -740,6 +743,11 @@ clashes."
   (byte-compile-file filename)
   (unless byte-to-native-top-level-forms
     (signal 'native-compiler-error-empty-byte filename))
+  (unless (comp-ctxt-output comp-ctxt)
+    (setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
+                                        filename
+                                        (when byte-native-for-bootstrap
+                                          (car (last comp-eln-load-path))))))
   (setf (comp-ctxt-top-level-forms comp-ctxt)
         (cl-loop
          for form in (reverse byte-to-native-top-level-forms)
@@ -2815,18 +2823,8 @@ Return the compile object filename."
          (comp-native-compiling t)
          ;; Have byte compiler signal an error when compilation fails.
          (byte-compile-debug t)
-         (comp-ctxt
-          (make-comp-ctxt
-           :output (or (when output
-                         (expand-file-name output))
-                       (if (symbolp function-or-file)
-                           (make-temp-file (symbol-name function-or-file) nil
-                                           ".eln")
-                         (comp-el-to-eln-filename
-                          function-or-file
-                          (when byte-native-for-bootstrap
-                            (car (last comp-eln-load-path))))))
-           :with-late-load with-late-load)))
+         (comp-ctxt (make-comp-ctxt :output output
+                                    :with-late-load with-late-load)))
     (comp-log "\n\f\n" 1)
     (condition-case err
         (mapc (lambda (pass)