diff options
author | David Malcolm <dmalcolm@redhat.com> | 2017-04-24 20:33:04 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2017-04-24 20:33:04 +0000 |
commit | 0ebd1f00b84a09e9dd0e7e2600daaa33ab5cfdec (patch) | |
tree | c90c5e9ff712be24739a3fe0b5fec18deb517683 /gcc/jit/jit-playback.c | |
parent | 761ad35c86ae6eb2101259feacc54ce409ca2ff5 (diff) | |
download | gcc-0ebd1f00b84a09e9dd0e7e2600daaa33ab5cfdec.zip gcc-0ebd1f00b84a09e9dd0e7e2600daaa33ab5cfdec.tar.gz gcc-0ebd1f00b84a09e9dd0e7e2600daaa33ab5cfdec.tar.bz2 |
types.rst (gccjit::type::get_const): Remove comment.
gcc_jit_type_get_aligned
gcc/jit/ChangeLog:
* docs/cp/topics/types.rst (gccjit::type::get_const): Remove
comment.
(gccjit::type::get_aligned): Add.
* docs/topics/compatibility.rst: Add LIBGCCJIT_ABI_7.
* docs/topics/types.rst: Add gcc_jit_type_get_aligned.
* docs/_build/texinfo/libgccjit.texi: Regenerate.
* jit-playback.c (gcc::jit::playback::type::get_aligned): New
method.
* jit-playback.h (gcc::jit::playback::type::get_aligned): New
method.
* jit-recording.c: Within namespace gcc::jit::recording...
(type::get_aligned): New method.
(memento_of_get_aligned::replay_into): New method.
(memento_of_get_aligned::make_debug_string): New method.
(memento_of_get_aligned::write_reproducer): New method.
* jit-recording.h: Within namespace gcc::jit::recording...
(type::get_aligned): New method.
(type::accepts_writes_from): Strip off qualifications from
this when comparing pointer equality.
(decorated_type): New subclass of type, subsuming the
commonality between memento_of_get_const and
memento_of_get_volatile.
(memento_of_get_const): Make a subclass of decorated_type,
rather than type.
(memento_of_get_volatile): Likewise.
(memento_of_get_aligned): Likewise.
* libgccjit++.h: Within namespace gccjit...
(type::get_const): New method.
(type::get_aligned): New method.
* libgccjit.c (gcc_jit_type_get_aligned): New function.
* libgccjit.h (gcc_jit_type_get_aligned): New decl.
* libgccjit.map (LIBGCCJIT_ABI_7): New
(gcc_jit_type_get_aligned): Add.
gcc/testsuite/ChangeLog:
* jit.dg/all-non-failing-tests.h: Add test-alignment.c.
* jit.dg/test-alignment.c: New test case.
* jit.dg/test-alignment.cc: New test case.
* jit.dg/test-error-gcc_jit_type_get_aligned-non-power-of-two.c:
New test case.
From-SVN: r247111
Diffstat (limited to 'gcc/jit/jit-playback.c')
-rw-r--r-- | gcc/jit/jit-playback.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c index c0f10c9..76cc88f 100644 --- a/gcc/jit/jit-playback.c +++ b/gcc/jit/jit-playback.c @@ -1095,6 +1095,21 @@ new_dereference (tree ptr, return datum; } +/* Construct a playback::type instance (wrapping a tree) + with the given alignment. */ + +playback::type * +playback::type:: +get_aligned (size_t alignment_in_bytes) const +{ + tree t_new_type = build_variant_type_copy (m_inner); + + SET_TYPE_ALIGN (t_new_type, alignment_in_bytes * BITS_PER_UNIT); + TYPE_USER_ALIGN (t_new_type) = 1; + + return new type (t_new_type); +} + /* Construct a playback::lvalue instance (wrapping a tree) for a field access. */ |