emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 5b41545: * Better error handling after calling 'gcc_


From: Andrea Corallo
Subject: feature/native-comp 5b41545: * Better error handling after calling 'gcc_jit_context_compile_to_file'
Date: Tue, 15 Sep 2020 03:16:31 -0400 (EDT)

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

    * Better error handling after calling 'gcc_jit_context_compile_to_file'
    
    Tipically errors are catched in 'compile_function' but in case
    libgccjit throw an error only afterwards while compiling the whole
    compilation unit we have to report it correctly.
    
        * src/comp.c (Fcomp__compile_ctxt_to_file): Catch libgccjit
        errors after calling 'gcc_jit_context_compile_to_file'.
---
 src/comp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/comp.c b/src/comp.c
index b3640b5..15d85d3 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4391,6 +4391,13 @@ DEFUN ("comp--compile-ctxt-to-file", 
Fcomp__compile_ctxt_to_file,
                                   GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY,
                                   SSDATA (tmp_file));
 
+  const char *err =  gcc_jit_context_get_first_error (comp.ctxt);
+  if (err)
+    xsignal3 (Qnative_ice,
+             build_string ("failed to compile"),
+             file_name,
+             build_string (err));
+
   CALL1I (comp-clean-up-stale-eln, file_name);
   CALL2I (comp-delete-or-replace-file, file_name, tmp_file);
 



reply via email to

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