@@ -1126,6 +1126,21 @@ recording::context::new_global_init_rvalue (lvalue *variable,
11261126 gbl->set_rvalue_init (init); /* Needed by the global for write dump. */
11271127}
11281128
1129+ /* Create a recording::memento_of_sizeof instance and add it
1130+ to this context's list of mementos.
1131+
1132+ Implements the post-error-checking part of
1133+ gcc_jit_context_new_sizeof. */
1134+
1135+ recording::rvalue *
1136+ recording::context::new_sizeof (recording::type *type)
1137+ {
1138+ recording::rvalue *result =
1139+ new memento_of_sizeof (this , NULL , type);
1140+ record (result);
1141+ return result;
1142+ }
1143+
11291144/* Create a recording::memento_of_new_string_literal instance and add it
11301145 to this context's list of mementos.
11311146
@@ -5754,6 +5769,43 @@ memento_of_new_rvalue_from_const <void *>::write_reproducer (reproducer &r)
57545769
57555770} // namespace recording
57565771
5772+ /* The implementation of class gcc::jit::recording::memento_of_sizeof. */
5773+
5774+ /* Implementation of pure virtual hook recording::memento::replay_into
5775+ for recording::memento_of_sizeof. */
5776+
5777+ void
5778+ recording::memento_of_sizeof::replay_into (replayer *r)
5779+ {
5780+ set_playback_obj (r->new_sizeof (m_type->playback_type ()));
5781+ }
5782+
5783+ /* Implementation of recording::memento::make_debug_string for
5784+ sizeof expressions. */
5785+
5786+ recording::string *
5787+ recording::memento_of_sizeof::make_debug_string ()
5788+ {
5789+ return string::from_printf (m_ctxt,
5790+ " sizeof (%s)" ,
5791+ m_type->get_debug_string ());
5792+ }
5793+
5794+ /* Implementation of recording::memento::write_reproducer for sizeof
5795+ expressions. */
5796+
5797+ void
5798+ recording::memento_of_sizeof::write_reproducer (reproducer &r)
5799+ {
5800+ const char *id = r.make_identifier (this , " rvalue" );
5801+ r.write (" gcc_jit_rvalue *%s =\n "
5802+ " gcc_jit_context_new_sizeof (%s, /* gcc_jit_context *ctxt */\n "
5803+ " %s); /* gcc_jit_type *type */\n " ,
5804+ id,
5805+ r.get_identifier (get_context ()),
5806+ r.get_identifier (m_type));
5807+ }
5808+
57575809/* The implementation of class gcc::jit::recording::memento_of_new_string_literal. */
57585810
57595811/* Implementation of pure virtual hook recording::memento::replay_into
0 commit comments