public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Function pointer handling
@ 2017-01-01  0:00 Bartosz Szreder
  2017-01-01  0:00 ` David Malcolm
  0 siblings, 1 reply; 5+ messages in thread
From: Bartosz Szreder @ 2017-01-01  0:00 UTC (permalink / raw)
  To: jit

I have some questions regarding pointers to functions in current (7.2)
version of GCC-JIT.

1. The documentation doesn't mention existence of
gcc_jit_context_new_function_ptr_type() as a mechanism of handling
function pointers, yet contains
gcc_jit_context_new_call_through_ptr().

- Is the former function unsupported/buggy in some way and is not
indented for general use, or just lacks proper documentation?

- What is the proper way of obtaining a function pointer to be passed
to gcc_jit_context_new_call_through_ptr()? There doesn't seem to be
any counterpart to gcc_jit_lvalue_get_address() for functions. As the
name suggests, gcc_jit_lvalue_get_address() works on an L-value and
gcc_jit_function type isn't an ancestor of gcc_jit_lvalue in the
internal type system, therefore upcasting is impossible.

2. Is it safe to pass a function pointer as a GCC_JIT_TYPE_VOID_PTR
and use gcc_jit_context_new_call_through_ptr() on such value?

Thanks,
Bartosz Szreder

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-28 17:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-01  0:00 Function pointer handling Bartosz Szreder
2017-01-01  0:00 ` David Malcolm
2017-01-01  0:00   ` [committed] jit: document function pointers David Malcolm
2017-01-01  0:00   ` Function pointer handling Bartosz Szreder
2017-01-01  0:00     ` [committed] jit: implement gcc_jit_function_get_address David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).