From 15a65e63a471bd12dd92a0451b6b7800e93cd1f1 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 27 Sep 2017 23:57:35 +0000 Subject: jit: implement gcc_jit_function_get_address gcc/jit/ChangeLog: * docs/cp/topics/expressions.rst (Function pointers): New section. * docs/topics/compatibility.rst (LIBGCCJIT_ABI_9): New tag. * docs/topics/expressions.rst (Function pointers): New section. * docs/_build/texinfo/libgccjit.texi: Regenerate. * jit-common.h (class gcc::jit::recording::function_pointer): New forward decl. * jit-playback.c (gcc::jit::playback::function::get_address): New method. * jit-playback.h (gcc::jit::playback::function::get_address): New method decl. * jit-recording.c: Within namespace gcc::jit::recording... (function::function): Initialize new field "m_fn_ptr_type". (function::get_address): New method. (function_pointer::replay_into): New method. (function_pointer::visit_children): New method. (function_pointer::make_debug_string): New method. (function_pointer::write_reproducer): New method. * jit-recording.h: Within namespace gcc::jit::recording... (function::get_address): New method. (function): Add field "m_fn_ptr_type". (class function_pointer): New subclass of rvalue. * libgccjit++.h (gccjit::function::get_address): New method. * libgccjit.c (gcc_jit_function_get_address): New function. * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_function_get_address): New macro. (gcc_jit_function_get_address): New API entrypoint. * libgccjit.map (LIBGCCJIT_ABI_9): New tag. gcc/testsuite/ChangeLog: * jit.dg/all-non-failing-tests.h: Add test-returning-function-ptr.c. * jit.dg/test-returning-function-ptr.c: New test case. From-SVN: r253244 --- gcc/jit/jit-playback.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/jit/jit-playback.h') diff --git a/gcc/jit/jit-playback.h b/gcc/jit/jit-playback.h index 7dc7315..746f5da 100644 --- a/gcc/jit/jit-playback.h +++ b/gcc/jit/jit-playback.h @@ -443,6 +443,9 @@ public: block* new_block (const char *name); + rvalue * + get_address (location *loc); + void build_stmt_list (); -- cgit v1.1