From: Andrea Corallo Date: Thu, 7 Jan 2021 23:44:55 +0000 (+0100) Subject: Add new customize `comp-libgccjit-reproducer' X-Git-Tag: emacs-28.0.90~2727^2~173 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=325c0765dfa4ef363d4f29650568bdafce0f0971;p=emacs.git 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'. --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index d1953b59f04..79cf942e89d 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 2670c917ed6..f6445a7621d 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");