aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/jit-playback.h
diff options
context:
space:
mode:
authorAndrea Corallo <andrea.corallo@arm.com>2020-05-30 10:33:08 +0100
committerAndrea Corallo <andrea.corallo@arm.com>2020-09-11 12:18:59 +0200
commit4ecc0061c400102859dd630cce84d1cc5be0fbf7 (patch)
tree7d5e9b91b960800e48074ba848e723990048acaf /gcc/jit/jit-playback.h
parent15545563128f0240192c263522d4a36b7f86250f (diff)
downloadgcc-4ecc0061c400102859dd630cce84d1cc5be0fbf7.zip
gcc-4ecc0061c400102859dd630cce84d1cc5be0fbf7.tar.gz
gcc-4ecc0061c400102859dd630cce84d1cc5be0fbf7.tar.bz2
libgccjit: Add new gcc_jit_global_set_initializer entry point
gcc/jit/ChangeLog 2020-08-01 Andrea Corallo <andrea.corallo@arm.com> * docs/topics/compatibility.rst (LIBGCCJIT_ABI_14): New ABI tag. * docs/topics/expressions.rst (gcc_jit_global_set_initializer): Document new entry point in section 'Global variables'. * jit-playback.c (global_new_decl, global_finalize_lvalue): New method. (playback::context::new_global): Make use of global_new_decl, global_finalize_lvalue. (load_blob_in_ctor): New template function in use by the following. (playback::context::new_global_initialized): New method. * jit-playback.h (class context): Decl 'new_global_initialized', 'global_new_decl', 'global_finalize_lvalue'. (lvalue::set_initializer): Add implementation. * jit-recording.c (recording::memento_of_get_pointer::get_size) (recording::memento_of_get_type::get_size): Add implementation. (recording::global::write_initializer_reproducer): New function in use by 'recording::global::write_reproducer'. (recording::global::replay_into) (recording::global::write_to_dump) (recording::global::write_reproducer): Handle initialized case. * jit-recording.h (class type): Decl 'get_size' and 'num_elements'. * libgccjit++.h (class lvalue): Declare new 'set_initializer' method. (class lvalue): Decl 'is_global' and 'set_initializer'. (class global) Decl 'write_initializer_reproducer'. Add 'm_initializer', 'm_initializer_num_bytes' fields. Implement 'set_initializer'. Add a destructor to free 'm_initializer'. * libgccjit.c (gcc_jit_global_set_initializer): New function. * libgccjit.h (gcc_jit_global_set_initializer): New function declaration. * libgccjit.map (LIBGCCJIT_ABI_14): New ABI tag. gcc/testsuite/ChangeLog 2020-08-01 Andrea Corallo <andrea.corallo@arm.com> * jit.dg/all-non-failing-tests.h: Add test-blob.c. * jit.dg/test-global-set-initializer.c: New testcase.
Diffstat (limited to 'gcc/jit/jit-playback.h')
-rw-r--r--gcc/jit/jit-playback.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/jit/jit-playback.h b/gcc/jit/jit-playback.h
index f9b3e67..50b6975 100644
--- a/gcc/jit/jit-playback.h
+++ b/gcc/jit/jit-playback.h
@@ -111,6 +111,15 @@ public:
type *type,
const char *name);
+ lvalue *
+ new_global_initialized (location *loc,
+ enum gcc_jit_global_kind kind,
+ type *type,
+ size_t element_size,
+ size_t initializer_num_elem,
+ const void *initializer,
+ const char *name);
+
template <typename HOST_TYPE>
rvalue *
new_rvalue_from_const (type *type,
@@ -266,6 +275,14 @@ private:
const char * get_path_s_file () const;
const char * get_path_so_file () const;
+ tree
+ global_new_decl (location *loc,
+ enum gcc_jit_global_kind kind,
+ type *type,
+ const char *name);
+ lvalue *
+ global_finalize_lvalue (tree inner);
+
private:
/* Functions for implementing "compile". */