aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/jit-recording.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2017-08-10 00:18:19 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2017-08-10 00:18:19 +0000
commit47ee1b7c10f2aa90645b0d2a94926fa2a674450c (patch)
tree61c3ae03baedd98e46435b7e189fd5de3f11229f /gcc/jit/jit-recording.h
parentb240c0e02e292549e21f115d428d12cc34f3e971 (diff)
downloadgcc-47ee1b7c10f2aa90645b0d2a94926fa2a674450c.zip
gcc-47ee1b7c10f2aa90645b0d2a94926fa2a674450c.tar.gz
gcc-47ee1b7c10f2aa90645b0d2a94926fa2a674450c.tar.bz2
jit: add gcc_jit_type_get_vector
gcc/jit/ChangeLog: * docs/cp/topics/types.rst (Vector types): New section. * docs/topics/compatibility.rst (LIBGCCJIT_ABI_8): New tag. * docs/topics/types.rst (gcc_jit_context_get_type): Fix typo in example. (Vector types): New section. * docs/_build/texinfo/libgccjit.texi: Regenerate. * jit-playback.c (gcc::jit::playback::type::get_vector): New method. * jit-playback.h (gcc::jit::playback::type::get_vector): New method. * jit-recording.c: In namespace gcc::jit::recording:: (type::get_vector): New method. (memento_of_get_aligned::write_reproducer): Fix typo in leading comment. (memento_of_get_vector::replay_into): New method. (memento_of_get_vector::make_debug_string): New method. (memento_of_get_vector::write_reproducer): New method. * jit-recording.h: In namespace gcc::jit::recording:: (type::get_vector): New method. (class memento_of_get_vector): New class. * libgccjit++.h (gccjit::type::get_vector): New method. * libgccjit.c (gcc_jit_type_get_vector): New public entrypoint. * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_type_get_vector): New define. (gcc_jit_type_get_vector): New decl. * libgccjit.map (LIBGCCJIT_ABI_8): New ABI tag. gcc/testsuite/ChangeLog: * jit.dg/all-non-failing-tests.h: Add note about test-vector-types.cc. * jit.dg/test-error-gcc_jit_type_get_vector-bad-type.c: New test case. * jit.dg/test-error-gcc_jit_type_get_vector-non-power-of-two.c: New test case. * jit.dg/test-vector-types.cc: New test case. From-SVN: r251018
Diffstat (limited to 'gcc/jit/jit-recording.h')
-rw-r--r--gcc/jit/jit-recording.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/gcc/jit/jit-recording.h b/gcc/jit/jit-recording.h
index 5faf35e..248765d 100644
--- a/gcc/jit/jit-recording.h
+++ b/gcc/jit/jit-recording.h
@@ -474,6 +474,7 @@ public:
type *get_const ();
type *get_volatile ();
type *get_aligned (size_t alignment_in_bytes);
+ type *get_vector (size_t num_units);
/* Get the type obtained when dereferencing this type.
@@ -600,8 +601,8 @@ private:
type *m_other_type;
};
-/* A decorated version of a type, for get_const, get_volatile and
- get_aligned. */
+/* A decorated version of a type, for get_const, get_volatile,
+ get_aligned, and get_vector. */
class decorated_type : public type
{
@@ -683,6 +684,27 @@ private:
size_t m_alignment_in_bytes;
};
+/* Result of "gcc_jit_type_get_vector". */
+class memento_of_get_vector : public decorated_type
+{
+public:
+ memento_of_get_vector (type *other_type, size_t num_units)
+ : decorated_type (other_type),
+ m_num_units (num_units) {}
+
+ /* Strip off the alignment, giving the underlying type. */
+ type *unqualified () FINAL OVERRIDE { return m_other_type; }
+
+ void replay_into (replayer *) FINAL OVERRIDE;
+
+private:
+ string * make_debug_string () FINAL OVERRIDE;
+ void write_reproducer (reproducer &r) FINAL OVERRIDE;
+
+private:
+ size_t m_num_units;
+};
+
class array_type : public type
{
public: