emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp e2ff5d9 1/2: * Synthesize as const primitive functio


From: Andrea Corallo
Subject: feature/native-comp e2ff5d9 1/2: * Synthesize as const primitive function pointers and its container struct.
Date: Fri, 27 Nov 2020 17:49:46 -0500 (EST)

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

    * Synthesize as const primitive function pointers and its container struct.
    
        * src/comp.c (declare_imported_func): Make const function pointer
        to primitive funcions.
        (emit_ctxt_code): Make struct 'comp.func_relocs' const.
---
 src/comp.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index 99560cc..12ff985 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -967,12 +967,13 @@ declare_imported_func (Lisp_Object subr_sym, gcc_jit_type 
*ret_type,
           subr_sym, make_string ("R", 1));
 
   gcc_jit_type *f_ptr_type =
-    gcc_jit_context_new_function_ptr_type (comp.ctxt,
-                                          NULL,
-                                          ret_type,
-                                          nargs,
-                                          types,
-                                          0);
+    gcc_jit_type_get_const (
+      gcc_jit_context_new_function_ptr_type (comp.ctxt,
+                                            NULL,
+                                            ret_type,
+                                            nargs,
+                                            types,
+                                            0));
   gcc_jit_field *field =
     gcc_jit_context_new_field (comp.ctxt,
                               NULL,
@@ -2866,7 +2867,9 @@ emit_ctxt_code (void)
       comp.ctxt,
       NULL,
       GCC_JIT_GLOBAL_EXPORTED,
-      gcc_jit_type_get_pointer (gcc_jit_struct_as_type (f_reloc_struct)),
+      gcc_jit_type_get_pointer (
+       gcc_jit_type_get_const (
+         gcc_jit_struct_as_type (f_reloc_struct))),
       FUNC_LINK_TABLE_SYM);
 
   xfree (fields);



reply via email to

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