From 5e3b3e95a9e5b9f269f123fc41f43f411d4c19d9 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 26 Jun 2019 22:28:56 +0200 Subject: [PATCH] add uintptr_type --- src/comp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/comp.c b/src/comp.c index 203d476df15..5df67fe55f7 100644 --- a/src/comp.c +++ b/src/comp.c @@ -187,6 +187,7 @@ typedef struct { gcc_jit_type *void_ptr_type; gcc_jit_type *char_ptr_type; gcc_jit_type *ptrdiff_type; + gcc_jit_type *uintptr_type; gcc_jit_type *lisp_obj_type; gcc_jit_type *lisp_obj_ptr_type; gcc_jit_field *lisp_obj_as_ptr; @@ -1649,9 +1650,19 @@ init_comp (int opt_level) ptrdiff_t_gcc = GCC_JIT_TYPE_LONG_LONG; else eassert ("ptrdiff_t size not handled."); - comp.ptrdiff_type = gcc_jit_context_get_type (comp.ctxt, ptrdiff_t_gcc); + enum gcc_jit_types uintptr_t_gcc; + if (sizeof (uintptr_t) == sizeof (unsigned)) + uintptr_t_gcc = GCC_JIT_TYPE_UNSIGNED_INT; + else if (sizeof (uintptr_t) == sizeof (unsigned long)) + uintptr_t_gcc = GCC_JIT_TYPE_UNSIGNED_LONG; + else if (sizeof (uintptr_t) == sizeof (unsigned long long)) + uintptr_t_gcc = GCC_JIT_TYPE_UNSIGNED_LONG_LONG; + else + eassert ("uintptr_t size not handled."); + comp.uintptr_type = gcc_jit_context_get_type (comp.ctxt, uintptr_t_gcc); + comp.func_hash = CALLN (Fmake_hash_table, QCtest, Qequal, QCweakness, Qt); /* Define data structures. */ -- 2.39.5