@@ -1125,6 +1125,21 @@ recording::context::new_global_init_rvalue (lvalue *variable,
1125
1125
gbl->set_rvalue_init (init); /* Needed by the global for write dump. */
1126
1126
}
1127
1127
1128
+ /* Create a recording::memento_of_sizeof instance and add it
1129
+ to this context's list of mementos.
1130
+
1131
+ Implements the post-error-checking part of
1132
+ gcc_jit_context_new_sizeof. */
1133
+
1134
+ recording::rvalue *
1135
+ recording::context::new_sizeof (recording::type *type)
1136
+ {
1137
+ recording::rvalue *result =
1138
+ new memento_of_new_sizeof (this , NULL , type);
1139
+ record (result);
1140
+ return result;
1141
+ }
1142
+
1128
1143
/* Create a recording::memento_of_new_string_literal instance and add it
1129
1144
to this context's list of mementos.
1130
1145
@@ -5535,6 +5550,43 @@ memento_of_new_rvalue_from_const <void *>::write_reproducer (reproducer &r)
5535
5550
5536
5551
} // namespace recording
5537
5552
5553
+ /* The implementation of class gcc::jit::recording::memento_of_new_sizeof. */
5554
+
5555
+ /* Implementation of pure virtual hook recording::memento::replay_into
5556
+ for recording::memento_of_new_sizeof. */
5557
+
5558
+ void
5559
+ recording::memento_of_new_sizeof::replay_into (replayer *r)
5560
+ {
5561
+ set_playback_obj (r->new_sizeof (m_type->playback_type ()));
5562
+ }
5563
+
5564
+ /* Implementation of recording::memento::make_debug_string for
5565
+ sizeof expressions. */
5566
+
5567
+ recording::string *
5568
+ recording::memento_of_new_sizeof::make_debug_string ()
5569
+ {
5570
+ return string::from_printf (m_ctxt,
5571
+ " sizeof (%s)" ,
5572
+ m_type->get_debug_string ());
5573
+ }
5574
+
5575
+ /* Implementation of recording::memento::write_reproducer for sizeof
5576
+ expressions. */
5577
+
5578
+ void
5579
+ recording::memento_of_new_sizeof::write_reproducer (reproducer &r)
5580
+ {
5581
+ const char *id = r.make_identifier (this , " rvalue" );
5582
+ r.write (" gcc_jit_rvalue *%s =\n "
5583
+ " gcc_jit_context_new_sizeof (%s, /* gcc_jit_context *ctxt */\n "
5584
+ " %s); /* gcc_jit_type *type */\n " ,
5585
+ id,
5586
+ r.get_identifier (get_context ()),
5587
+ m_type->get_debug_string ());
5588
+ }
5589
+
5538
5590
/* The implementation of class gcc::jit::recording::memento_of_new_string_literal. */
5539
5591
5540
5592
/* Implementation of pure virtual hook recording::memento::replay_into
0 commit comments