@@ -1246,6 +1246,22 @@ recording::context::new_cast (recording::location *loc,
1246
1246
return result ;
1247
1247
}
1248
1248
1249
+ /* Create a recording::bitcast instance and add it to this context's list
1250
+ of mementos.
1251
+
1252
+ Implements the post-error-checking part of
1253
+ gcc_jit_context_new_bitcast. */
1254
+
1255
+ recording ::rvalue *
1256
+ recording ::context ::new_bitcast (location * loc ,
1257
+ rvalue * expr ,
1258
+ type * type_ )
1259
+ {
1260
+ recording ::rvalue * result = new bitcast (this , loc , expr , type_ );
1261
+ record (result );
1262
+ return result ;
1263
+ }
1264
+
1249
1265
/* Create a recording::call instance and add it to this context's list
1250
1266
of mementos.
1251
1267
@@ -5817,6 +5833,56 @@ recording::cast::write_reproducer (reproducer &r)
5817
5833
r .get_identifier_as_type (get_type ()));
5818
5834
}
5819
5835
5836
+ /* Implementation of pure virtual hook recording::memento::replay_into
5837
+ for recording::bitcast. */
5838
+
5839
+ void
5840
+ recording ::bitcast ::replay_into (replayer * r )
5841
+ {
5842
+ set_playback_obj (r -> new_bitcast (playback_location (r , m_loc ),
5843
+ m_rvalue -> playback_rvalue (),
5844
+ get_type ()-> playback_type ()));
5845
+ }
5846
+
5847
+ /* Implementation of pure virtual hook recording::rvalue::visit_children
5848
+ for recording::bitcast. */
5849
+ void
5850
+ recording ::bitcast ::visit_children (rvalue_visitor * v )
5851
+ {
5852
+ v -> visit (m_rvalue );
5853
+ }
5854
+
5855
+ /* Implementation of recording::memento::make_debug_string for
5856
+ casts. */
5857
+
5858
+ recording ::string *
5859
+ recording ::bitcast ::make_debug_string ()
5860
+ {
5861
+ enum precedence prec = get_precedence ();
5862
+ return string ::from_printf (m_ctxt ,
5863
+ "bitcast(%s, %s)" ,
5864
+ m_rvalue -> get_debug_string_parens (prec ),
5865
+ get_type ()-> get_debug_string ());
5866
+ }
5867
+
5868
+ /* Implementation of recording::memento::write_reproducer for casts. */
5869
+
5870
+ void
5871
+ recording ::bitcast ::write_reproducer (reproducer & r )
5872
+ {
5873
+ const char * id = r .make_identifier (this , "rvalue" );
5874
+ r .write (" gcc_jit_rvalue *%s =\n"
5875
+ " gcc_jit_context_new_bitcast (%s,\n"
5876
+ " %s, /* gcc_jit_location *loc */\n"
5877
+ " %s, /* gcc_jit_rvalue *rvalue */\n"
5878
+ " %s); /* gcc_jit_type *type */\n" ,
5879
+ id ,
5880
+ r .get_identifier (get_context ()),
5881
+ r .get_identifier (m_loc ),
5882
+ r .get_identifier_as_rvalue (m_rvalue ),
5883
+ r .get_identifier_as_type (get_type ()));
5884
+ }
5885
+
5820
5886
/* The implementation of class gcc::jit::recording::base_call. */
5821
5887
5822
5888
/* The constructor for gcc::jit::recording::base_call. */
0 commit comments