]> git.eshelyaron.com Git - emacs.git/commitdiff
* Synthesize as const primitive function pointers and its container struct.
authorAndrea Corallo <akrl@sdf.org>
Fri, 27 Nov 2020 17:31:53 +0000 (18:31 +0100)
committerAndrea Corallo <akrl@sdf.org>
Fri, 27 Nov 2020 21:59:50 +0000 (22:59 +0100)
* 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

index 99560cc13a18b4fa30c824c95e7893cc4bb8edad..12ff985d2302efba5493aef6846ae2a362719c22 100644 (file)
@@ -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);