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'.
This commit is contained in:
Andrea Corallo 2021-01-08 00:44:55 +01:00
parent 400f620f24
commit 325c0765df
2 changed files with 11 additions and 2 deletions

View file

@ -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.")

View file

@ -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");