aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/jit-playback.h
diff options
context:
space:
mode:
authorAndrea Corallo <andrea.corallo@arm.com>2019-07-04 15:46:00 +0000
committerAndrea Corallo <akrl@gcc.gnu.org>2019-07-04 15:46:00 +0000
commitee118c14f71f43a4b82c439cd4381e034bd2786a (patch)
tree023d5a6423cfaf816e0dc16b7c00aafb8c673194 /gcc/jit/jit-playback.h
parentebebc928d8b0d17676e751848892f927373b1fe5 (diff)
downloadgcc-ee118c14f71f43a4b82c439cd4381e034bd2786a.zip
gcc-ee118c14f71f43a4b82c439cd4381e034bd2786a.tar.gz
gcc-ee118c14f71f43a4b82c439cd4381e034bd2786a.tar.bz2
introduce gcc_jit_context_new_bitfield
gcc/jit/ChangeLog: 2019-07-04 Andrea Corallo <andrea.corallo@arm.com> * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag. * docs/topics/types.rst: Add gcc_jit_context_new_bitfield. * jit-common.h (namespace recording): Add class bitfield. * jit-playback.c: (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros. (playback::context::new_bitfield): New method. (playback::compound_type::set_fields): Add bitfield support. (playback::lvalue::mark_addressable): Was jit_mark_addressable make this a method of lvalue plus return a bool to communicate success. (playback::lvalue::get_address): Check for jit_mark_addressable return value. * jit-playback.h (new_bitfield): New method. (class bitfield): New class. (class lvalue): Add jit_mark_addressable method. * jit-recording.c (recording::context::new_bitfield): New method. (recording::bitfield::replay_into): New method. (recording::bitfield::write_to_dump): Likewise. (recording::bitfield::make_debug_string): Likewise. (recording::bitfield::write_reproducer): Likewise. * jit-recording.h (class context): Add new_bitfield method. (class field): Make it derivable by class bitfield. (class bitfield): Add new class. * libgccjit++.h (class context): Add new_bitfield method. * libgccjit.c (struct gcc_jit_bitfield): New structure. (gcc_jit_context_new_bitfield): New function. * libgccjit.h (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro. (gcc_jit_context_new_bitfield): New function. * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag. gcc/testsuite/ChangeLog: 2019-07-04 Andrea Corallo <andrea.corallo@arm.com> * jit.dg/all-non-failing-tests.h: Add test-accessing-bitfield.c. * jit.dg/test-accessing-bitfield.c: New testcase. * jit.dg/test-error-gcc_jit_context_new_bitfield-invalid-type.c: Likewise. * jit.dg/test-error-gcc_jit_context_new_bitfield-invalid-width.c: Likewise. * jit.dg/test-error-gcc_jit_lvalue_get_address-bitfield.c: Likewise. From-SVN: r273086
Diffstat (limited to 'gcc/jit/jit-playback.h')
-rw-r--r--gcc/jit/jit-playback.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/jit/jit-playback.h b/gcc/jit/jit-playback.h
index bc4de9c..d4b148e 100644
--- a/gcc/jit/jit-playback.h
+++ b/gcc/jit/jit-playback.h
@@ -75,6 +75,12 @@ public:
type *type,
const char *name);
+ field *
+ new_bitfield (location *loc,
+ type *type,
+ int width,
+ const char *name);
+
compound_type *
new_compound_type (location *loc,
const char *name,
@@ -426,6 +432,8 @@ private:
tree m_inner;
};
+class bitfield : public field {};
+
class function : public wrapper
{
public:
@@ -614,6 +622,8 @@ public:
rvalue *
get_address (location *loc);
+private:
+ bool mark_addressable (location *loc);
};
class param : public lvalue
@@ -703,4 +713,3 @@ extern playback::context *active_playback_ctxt;
} // namespace gcc
#endif /* JIT_PLAYBACK_H */
-