]> git.eshelyaron.com Git - emacs.git/commitdiff
make some order into debug facilities
authorAndrea Corallo <andrea_corallo@yahoo.it>
Wed, 12 Jun 2019 22:36:01 +0000 (00:36 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:41 +0000 (11:33 +0100)
src/comp.c

index 3c837555d741878f118956d40f726da35c4c1a0a..79aa0bdc03111c0248af8000e69a64dbd38d6616 100644 (file)
@@ -1812,8 +1812,24 @@ init_comp (void)
 {
   comp.ctxt = gcc_jit_context_acquire();
 
+  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_DUMP_EVERYTHING,
+                                      1);
+      gcc_jit_context_set_bool_option (comp.ctxt,
+                                      GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES,
+                                      1);
+    }
   if (COMP_DEBUG > 1)
-    gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c");
+    {
+      gcc_jit_context_dump_reproducer_to_file (comp.ctxt, "comp_reproducer.c");
+      gcc_jit_context_dump_to_file (comp.ctxt, "emacs-gcc-code.c", 0);
+    }
 
   comp.void_type = gcc_jit_context_get_type (comp.ctxt, GCC_JIT_TYPE_VOID);
   comp.void_ptr_type =
@@ -1931,20 +1947,6 @@ init_comp (void)
       NULL);
 
   comp.func_hash = CALLN (Fmake_hash_table, QCtest, Qequal, QCweakness, Qt);
-
-  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_DUMP_EVERYTHING,
-                                    1);
-  }
-
-  gcc_jit_context_set_bool_option (comp.ctxt,
-                                  GCC_JIT_BOOL_OPTION_KEEP_INTERMEDIATES,
-                                  1);
 }
 
 void