aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/jit-playback.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-12-01 18:23:37 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2014-12-01 18:23:37 +0000
commiteeafb31957a4382a941e98a79d3e3ff1b5ca97a1 (patch)
tree42a906c1ce5855a27ab1a975ddae3a7e2763a59e /gcc/jit/jit-playback.h
parent23844fd7306763ee07f27acd6883fd47bc858ec3 (diff)
downloadgcc-eeafb31957a4382a941e98a79d3e3ff1b5ca97a1.zip
gcc-eeafb31957a4382a941e98a79d3e3ff1b5ca97a1.tar.gz
gcc-eeafb31957a4382a941e98a79d3e3ff1b5ca97a1.tar.bz2
PR jit/64020: Fixes to handling of builtins
PR jit/64020 * docs/topics/types.rst (Standard types) Add new enum values to the table of enum gcc_jit_types: GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE. Widen the left-hand column so that GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE will fit. * docs/_build/texinfo/libgccjit.texi: Regenerate. * jit-builtins.c: Include stringpool.h and jit-playback.h. Move everything out of the gcc::jit::recording namespace into just gcc::jit. (struct builtin_data): Add fields "fnclass", "attr", and "implicit_p". (DEF_BUILTIN): Update macro so populate the new fields. (builtins_manager::builtins_manager): Update for move out of recording namespace. Initialize the m_attributes array. (builtins_manager::get_builtin_function): Likewise. (builtins_manager::get_builtin_function_by_id): New function. (builtins_manager::make_builtin_function): Update for move out of recording namespace. Add fix for PR jit/64020 by detecting specific builtin ids and having them ensure that builtins for other ids are created as necessary. (builtins_manager::get_type): Update for move out of recording namespace. (builtins_manager::make_type): Likewise. Add some missing #undefs. (builtins_manager::make_primitive_type): Update for move out of recording namespace. Implement the three BT_COMPLEX_ cases and BT_DOUBLE_PTR. (builtins_manager::make_fn_type): Update for move out of recording namespace. (builtins_manager::make_ptr_type): Likewise. (builtins_manager::finish_playback): New function. (builtins_manager::get_class): New function. (builtins_manager::implicit_p): New function. (builtins_manager::get_attrs_tree): Two new functions. (builtins_manager::make_attrs_tree): New function. * jit-builtins.h: Move everything out of the gcc::jit::recording namespace into just gcc::jit. (enum built_in_attribute): New. (builtins_manager::builtins_manager): Update decl for namespace change. (builtins_manager::get_builtin_function): Likewise. (builtins_manager::get_class): New. (builtins_manager::implicit_p): New. (builtins_manager::get_attrs_tree): Two new functions. (builtins_manager::make_attrs_tree): New function. (builtins_manager::finish_playback): New. (builtins_manager::get_builtin_function_by_id): New. (builtins_manager::make_builtin_function): Update decl for namespace change. (builtins_manager::get_type): Likewise. (builtins_manager::make_type): Likewise. (builtins_manager::make_primitive_type): Likewise. (builtins_manager::make_fn_type): Likewise. (builtins_manager::make_ptr_type): Likewise. (builtins_manager): Likewise for fields. Add new field "m_attributes". * jit-common.h (NUM_GCC_JIT_TYPES): Update. (builtins_manager): Update forward decl to reflect namespace change. * jit-playback.c: Include attribs.h and jit-builtins.h. (gcc::jit::playback::context::get_tree_node_for_type): Add cases for the new COMPLEX_ types. (gcc::jit::playback::context::new_function): If creating a builtin, set the DECL_BUILT_IN_CLASS and attributes on the fndecl, and call set_builtin_decl. (gcc::jit::playback::context::replay): If we have a builtins_manager, call its finish_playback method when we're done. * jit-playback.h: (gcc::jit::playback::context::get_builtins_manager): New function. * jit-recording.c (gcc::jit::recording::context::get_builtins_manager): New function. (gcc::jit::recording::get_builtin_function): Use get_builtins_manager, in case we're a child context. (gcc::jit::recording::memento_of_get_type::dereference): Add the COMPLEX_ types. (gcc::jit::recording::memento_of_get_type::is_int): Likewise. (gcc::jit::recording::memento_of_get_type::is_float): Likewise. (gcc::jit::recording::memento_of_get_type::is_bool): Likewise. (get_type_strings): Likewise. * jit-recording.h (gcc::jit::recording::context::get_builtins_manager): New. * libgccjit.h (enum gcc_jit_types): Add GCC_JIT_TYPE_COMPLEX_FLOAT, GCC_JIT_TYPE_COMPLEX_DOUBLE, GCC_JIT_TYPE_COMPLEX_LONG_DOUBLE. From-SVN: r218240
Diffstat (limited to 'gcc/jit/jit-playback.h')
-rw-r--r--gcc/jit/jit-playback.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/jit/jit-playback.h b/gcc/jit/jit-playback.h
index 25a4c28..02f08ba 100644
--- a/gcc/jit/jit-playback.h
+++ b/gcc/jit/jit-playback.h
@@ -175,6 +175,11 @@ public:
return m_recording_ctxt->get_bool_option (opt);
}
+ builtins_manager *get_builtins_manager () const
+ {
+ return m_recording_ctxt->get_builtins_manager ();
+ }
+
result *
compile ();