]> git.eshelyaron.com Git - emacs.git/commitdiff
rework COMP_DEBUG strategy
authorAndrea Corallo <andrea_corallo@yahoo.it>
Sat, 6 Jul 2019 07:27:45 +0000 (09:27 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:49 +0000 (11:33 +0100)
src/comp.c

index eefe8db2e2c21dd89d9cf75c0132e610593abf14..0fadeaad11cadd135396b3fdd4a85b5a65a69420 100644 (file)
@@ -1931,23 +1931,22 @@ init_comp (int opt_level)
 
   if (COMP_DEBUG)
     {
-      logfile = fopen ("libgccjit.log", "w");
-      gcc_jit_context_set_logfile (comp.ctxt,
-                                  logfile,
-                                  0, 0);
       gcc_jit_context_set_bool_option (comp.ctxt,
-                                      GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES,
+                                      GCC_JIT_BOOL_OPTION_DEBUGINFO,
                                       1);
     }
   if (COMP_DEBUG > 1)
     {
+      logfile = fopen ("libgccjit.log", "w");
+      gcc_jit_context_set_logfile (comp.ctxt,
+                                  logfile,
+                                  0, 0);
       gcc_jit_context_set_bool_option (comp.ctxt,
-                                      GCC_JIT_BOOL_OPTION_DEBUGINFO,
+                                      GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES,
                                       1);
       gcc_jit_context_set_bool_option (comp.ctxt,
-                                      GCC_JIT_BOOL_OPTION_DUMP_INITIAL_GIMPLE,
+                                      GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING,
                                       1);
-
       gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c");
 
     }
@@ -2072,8 +2071,6 @@ init_comp (int opt_level)
 static void
 release_comp (void)
 {
-  if (COMP_DEBUG)
-    gcc_jit_context_dump_to_file (comp.ctxt, "gcc-ctxt-dump.c", 1);
   if (comp.ctxt)
     gcc_jit_context_release(comp.ctxt);
 
@@ -3304,6 +3301,8 @@ compile_f (const char *lisp_f_name, const char *c_f_name,
        }
     }
 
+  if (COMP_DEBUG)
+    gcc_jit_context_dump_to_file (comp.ctxt, "gcc-ctxt-dump.c", 1);
   comp_res.gcc_res = gcc_jit_context_compile(comp.ctxt);
 
   goto exit;
@@ -3363,9 +3362,9 @@ emacs_native_compile (const char *lisp_f_name, const char *c_f_name,
 
   if (dump_asm)
     {
-      gcc_jit_context_compile_to_file(comp.ctxt,
-                                     GCC_JIT_OUTPUT_KIND_ASSEMBLER,
-                                     DISASS_FILE_NAME);
+      gcc_jit_context_compile_to_file (comp.ctxt,
+                                      GCC_JIT_OUTPUT_KIND_ASSEMBLER,
+                                      DISASS_FILE_NAME);
     }
   unblock_atimers (&oldset);
   release_comp ();