From ccce3b2ac3c9352501278d36b3c79f049234870b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 9 Jan 2015 20:10:11 +0000 Subject: New jit API entrypoint: gcc_jit_context_new_rvalue_from_long gcc/jit/ChangeLog: * docs/cp/topics/expressions.rst (Simple expressions): Use ":c:type:" for C types. Document new overload of gcc::jit::context::new_rvalue. * docs/topics/expressions.rst (Simple expressions): Use ":c:type:" for C types. Document new entrypoint gcc_jit_context_new_rvalue_from_long. * docs/_build/texinfo/libgccjit.texi: Regenerate. * jit-playback.c: Within namespace gcc::jit::playback... (context::new_rvalue_from_int): Eliminate in favor of... (context::new_rvalue_from_const ): ...this. (context::new_rvalue_from_double): Eliminate in favor of... (context::new_rvalue_from_const ): ...this. (context::new_rvalue_from_const ): New. (context::new_rvalue_from_ptr): Eliminate in favor of... (context::new_rvalue_from_const ): ...this. * jit-playback.h: Within namespace gcc::jit::playback... (context::new_rvalue_from_int): Eliminate in favor of... (context::new_rvalue_from_const ): ...this. (context::new_rvalue_from_double): Likewise. (context::new_rvalue_from_ptr): Likewise. * jit-recording.c: Within namespace gcc::jit::recording... (context::new_rvalue_from_int): Eliminate. (context::new_rvalue_from_double): Likewise. (context::new_rvalue_from_ptr): Likewise. (class memento_of_new_rvalue_from_const ): Add explicit specialization. (class memento_of_new_rvalue_from_const ): Likewise. (class memento_of_new_rvalue_from_const ): Likewise. (class memento_of_new_rvalue_from_const ): Likewise. (memento_of_new_rvalue_from_int::replay_into): Generalize into... (memento_of_new_rvalue_from_const ::replay_into): ...this... (memento_of_new_rvalue_from_double::replay_into): ...allowing this... (memento_of_new_rvalue_from_ptr::replay_into): ...and this to be deleted. (memento_of_new_rvalue_from_int::make_debug_string): Convert to... (memento_of_new_rvalue_from_const ::make_debug_string): ...this. (memento_of_new_rvalue_from_double::make_debug_string): Convert to... (memento_of_new_rvalue_from_const ::make_debug_string): ...this. (memento_of_new_rvalue_from_ptr::make_debug_string) Convert to... (memento_of_new_rvalue_from_const ::make_debug_string): ...this. (memento_of_new_rvalue_from_const ::make_debug_string): New function. * jit-recording.h: Within namespace gcc::jit::recording... (context::new_rvalue_from_int): Eliminate. (context::new_rvalue_from_double): Likewise. (context::new_rvalue_from_ptr): Likewise, all in favor of... (context::new_rvalue_from_const ): New family of methods. (class memento_of_new_rvalue_from_int): Eliminate. (class memento_of_new_rvalue_from_double): Likewise. (class memento_of_new_rvalue_from_ptr): Likewise. (class memento_of_new_rvalue_from_const ): New family of rvalue subclasses. * libgccjit++.h (gccjit::context::new_rvalue): New overload, for "long". * libgccjit.c (gcc_jit_context_new_rvalue_from_int): Update for rewriting of recording::context::new_rvalue_from_int to recording::context::new_rvalue_from_const . (gcc_jit_context_new_rvalue_from_long): New API entrypoint. (gcc_jit_context_new_rvalue_from_double): Update for rewriting of recording::context::new_rvalue_from_double to recording::context::new_rvalue_from_const . (gcc_jit_context_new_rvalue_from_ptr): Update for rewriting of recording::context::new_rvalue_from_ptr to recording::context::new_rvalue_from_const . * libgccjit.h (gcc_jit_context_new_rvalue_from_long): New API entrypoint. * libgccjit.map (gcc_jit_context_new_rvalue_from_long): Likewise. gcc/testsuite/ChangeLog: * jit.dg/all-non-failing-tests.h: Add test-constants.c. * jit.dg/test-combination.c (create_code): Likewise. (verify_code): Likewise. * jit.dg/test-constants.c: New test case. * jit.dg/test-threads.c: Add test-constants.c. From-SVN: r219401 --- gcc/testsuite/jit.dg/all-non-failing-tests.h | 7 +++++++ gcc/testsuite/jit.dg/test-combination.c | 2 ++ gcc/testsuite/jit.dg/test-threads.c | 3 +++ 3 files changed, 12 insertions(+) (limited to 'gcc/testsuite/jit.dg') diff --git a/gcc/testsuite/jit.dg/all-non-failing-tests.h b/gcc/testsuite/jit.dg/all-non-failing-tests.h index beb3d13..14211af 100644 --- a/gcc/testsuite/jit.dg/all-non-failing-tests.h +++ b/gcc/testsuite/jit.dg/all-non-failing-tests.h @@ -57,6 +57,13 @@ #undef create_code #undef verify_code +/* test-constants.c */ +#define create_code create_code_constants +#define verify_code verify_code_constants +#include "test-constants.c" +#undef create_code +#undef verify_code + /* test-dot-product.c */ #define create_code create_code_dot_product #define verify_code verify_code_dot_product diff --git a/gcc/testsuite/jit.dg/test-combination.c b/gcc/testsuite/jit.dg/test-combination.c index e99f4d0..5131613 100644 --- a/gcc/testsuite/jit.dg/test-combination.c +++ b/gcc/testsuite/jit.dg/test-combination.c @@ -22,6 +22,7 @@ create_code (gcc_jit_context *ctxt, void * user_data) create_code_arrays (ctxt, user_data); create_code_calling_external_function (ctxt, user_data); create_code_calling_function_ptr (ctxt, user_data); + create_code_constants (ctxt, user_data); create_code_dot_product (ctxt, user_data); create_code_expressions (ctxt, user_data); create_code_factorial (ctxt, user_data); @@ -50,6 +51,7 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result *result) verify_code_arrays (ctxt, result); verify_code_calling_external_function (ctxt, result); verify_code_calling_function_ptr (ctxt, result); + verify_code_constants (ctxt, result); verify_code_dot_product (ctxt, result); verify_code_expressions (ctxt, result); verify_code_factorial (ctxt, result); diff --git a/gcc/testsuite/jit.dg/test-threads.c b/gcc/testsuite/jit.dg/test-threads.c index cd5ef6a..13e414db 100644 --- a/gcc/testsuite/jit.dg/test-threads.c +++ b/gcc/testsuite/jit.dg/test-threads.c @@ -122,6 +122,9 @@ const struct testcase testcases[] = { {"calling_function_ptr", create_code_calling_function_ptr, verify_code_calling_function_ptr}, + {"constants", + create_code_constants, + verify_code_constants}, {"dot_product", create_code_dot_product, verify_code_dot_product}, -- cgit v1.1