emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 3d14a74 3/6: * Fix debug symbol emission


From: Andrea Corallo
Subject: feature/native-comp 3d14a74 3/6: * Fix debug symbol emission
Date: Sat, 14 Nov 2020 16:07:30 -0500 (EST)

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

    * Fix debug symbol emission
    
        * src/comp.c (Fcomp__compile_ctxt_to_file): Now that we do not
        rely anymore on globlal variables move logic in from
        'Fcomp__init_ctxt' so comp.debug is already set correctly.
---
 src/comp.c | 39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index 0d46428..e126fa1 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4215,26 +4215,6 @@ DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, 
Scomp__init_ctxt,
 
   comp.ctxt = gcc_jit_context_acquire ();
 
-  if (comp.debug)
-    {
-      gcc_jit_context_set_bool_option (comp.ctxt,
-                                      GCC_JIT_BOOL_OPTION_DEBUGINFO,
-                                      1);
-    }
-  if (comp.debug > 2)
-    {
-      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,
-                                      1);
-      gcc_jit_context_set_bool_option (comp.ctxt,
-                                      GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING,
-                                      1);
-    }
-
   comp.void_type = gcc_jit_context_get_type (comp.ctxt, GCC_JIT_TYPE_VOID);
   comp.void_ptr_type =
     gcc_jit_context_get_type (comp.ctxt, GCC_JIT_TYPE_VOID_PTR);
@@ -4408,6 +4388,25 @@ DEFUN ("comp--compile-ctxt-to-file", 
Fcomp__compile_ctxt_to_file,
 
   comp.speed = XFIXNUM (CALL1I (comp-ctxt-speed, Vcomp_ctxt));
   comp.debug = XFIXNUM (CALL1I (comp-ctxt-debug, Vcomp_ctxt));
+
+  if (comp.debug)
+      gcc_jit_context_set_bool_option (comp.ctxt,
+                                      GCC_JIT_BOOL_OPTION_DEBUGINFO,
+                                      1);
+  if (comp.debug > 2)
+    {
+      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,
+                                      1);
+      gcc_jit_context_set_bool_option (comp.ctxt,
+                                      GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING,
+                                      1);
+    }
+
   gcc_jit_context_set_int_option (comp.ctxt,
                                  GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
                                  comp.speed < 0 ? 0



reply via email to

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