]> git.eshelyaron.com Git - emacs.git/commitdiff
native compile return the filename of the compilation unit
authorAndrea Corallo <akrl@sdf.org>
Sat, 2 Nov 2019 11:34:09 +0000 (12:34 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:00 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el
src/comp.c

index 2f6bcf71b1e9b16e9fcfa09f22c0a54b426209d4..4fb9c129a88d4a893ba7883f23c77c33d3c3ba74 100644 (file)
@@ -1702,7 +1702,8 @@ Prepare every function for final compilation and drive the C back-end."
   "Compile INPUT into native code.
 This is the entrypoint for the Emacs Lisp native compiler.
 If INPUT is a symbol, native-compile its function definition.
-If INPUT is a string, use it as the file path to be native compiled."
+If INPUT is a string, use it as the file path to be native compiled.
+Return the compilation unit filename."
   (unless (or (symbolp input)
               (stringp input))
     (error "Trying to native compile something not a symbol function or file"))
@@ -1716,7 +1717,8 @@ If INPUT is a string, use it as the file path to be native compiled."
     (mapc (lambda (pass)
             (comp-log (format "Running pass %s:\n" pass))
             (setq data (funcall pass data)))
-          comp-passes)))
+          comp-passes)
+    data))
 
 (provide 'comp)
 
index 3b124bef23a5b6540adee467e7eb99fe89c9f838..fed599dc511c148241a3aa089175c08493784dbe 100644 (file)
@@ -3061,16 +3061,15 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
     gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c");
 
   AUTO_STRING (dot_so, NATIVE_ELISP_SUFFIX);
-  const char *filename =
-    (const char *) SDATA (CALLN (Fconcat, ctxtname, dot_so));
+  Lisp_Object out_file = CALLN (Fconcat, ctxtname, dot_so);
 
   gcc_jit_context_compile_to_file (comp.ctxt,
                                   GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY,
-                                  filename);
+                                  SSDATA (out_file));
 
   pthread_sigmask (SIG_SETMASK, &oldset, 0);
 
-  return Qt;
+  return out_file;
 }
 
 \f