emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 325c076: Add new customize `comp-libgccjit-reproduce


From: Andrea Corallo
Subject: feature/native-comp 325c076: Add new customize `comp-libgccjit-reproducer'
Date: Sat, 9 Jan 2021 06:07:12 -0500 (EST)

branch: feature/native-comp
commit 325c0765dfa4ef363d4f29650568bdafce0f0971
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Add new customize `comp-libgccjit-reproducer'
    
        * lisp/emacs-lisp/comp.el (comp-libgccjit-reproducer): New customize.
        * src/comp.c (Fcomp__compile_ctxt_to_file): Use
        `comp-libgccjit-reproducer' for dumping repoducer.
        (syms_of_comp): Define 'Qcomp_libgccjit_reproducer'.
---
 lisp/emacs-lisp/comp.el | 6 ++++++
 src/comp.c              | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index d1953b5..79cf942 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -136,6 +136,12 @@ Passing these options is only available in libgccjit 
version 9
 and above."
   :type 'list)
 
+(defcustom comp-libgccjit-reproducer nil
+  "When non-nil produce a libgccjit reproducer.
+The reproducer is a file comp_SRCNAME_repro.c deposed in the .eln
+output directory."
+  :type 'boolean)
+
 (defvar comp-dry-run nil
   "If non-nil, run everything but the C back-end.")
 
diff --git a/src/comp.c b/src/comp.c
index 2670c91..f6445a7 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4428,8 +4428,10 @@ DEFUN ("comp--compile-ctxt-to-file", 
Fcomp__compile_ctxt_to_file,
       gcc_jit_context_dump_to_file (comp.ctxt,
                                    format_string ("%s.c", SSDATA (base_name)),
                                    1);
-  if (comp.debug > 2)
-    gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c");
+  if (!NILP (Fsymbol_value (Qcomp_libgccjit_reproducer)))
+    gcc_jit_context_dump_reproducer_to_file (
+      comp.ctxt,
+      format_string ("comp_%s_repro.c", SSDATA (base_name)));
 
   Lisp_Object tmp_file =
     Fmake_temp_file_internal (base_name, Qnil, build_string (".eln.tmp"), 
Qnil);
@@ -5099,6 +5101,7 @@ compiled one.  */);
   DEFSYM (Qcomp_speed, "comp-speed");
   DEFSYM (Qcomp_debug, "comp-debug");
   DEFSYM (Qcomp_native_driver_options, "comp-native-driver-options");
+  DEFSYM (Qcomp_libgccjit_reproducer, "comp-libgccjit-reproducer");
 
   /* Limple instruction set.  */
   DEFSYM (Qcomment, "comment");



reply via email to

[Prev in Thread] Current Thread [Next in Thread]