@@ -4450,7 +4450,24 @@ recording::function::new_local (recording::location *loc,
44504450 type *type,
44514451 const char *name)
44524452{
4453- local *result = new local (this , loc, type, new_string (name));
4453+ local *result = new local (this , loc, type, new_string (name), false );
4454+ m_ctxt->record (result);
4455+ m_locals.safe_push (result);
4456+ return result;
4457+ }
4458+
4459+ /* Create a recording::local instance and add it to
4460+ the functions's context's list of mementos, and to the function's
4461+ list of locals.
4462+
4463+ Implements the post-error-checking part of
4464+ gcc_jit_function_new_temp. */
4465+
4466+ recording::lvalue *
4467+ recording::function::new_temp (recording::location *loc,
4468+ type *type)
4469+ {
4470+ local *result = new local (this , loc, type, NULL , true );
44544471 m_ctxt->record (result);
44554472 m_locals.safe_push (result);
44564473 return result;
@@ -7295,7 +7312,8 @@ recording::local::replay_into (replayer *r)
72957312 ->new_local (playback_location (r, m_loc),
72967313 m_type->playback_type (),
72977314 playback_string (m_name),
7298- m_string_attributes);
7315+ m_string_attributes,
7316+ m_is_temp);
72997317
73007318 if (m_reg_name != NULL )
73017319 obj->set_register_name (m_reg_name->c_str ());
@@ -7326,16 +7344,26 @@ void
73267344recording::local::write_reproducer (reproducer &r)
73277345{
73287346 const char *id = r.make_identifier (this , " local" );
7329- r.write (" gcc_jit_lvalue *%s =\n "
7330- " gcc_jit_function_new_local (%s, /* gcc_jit_function *func */\n "
7331- " %s, /* gcc_jit_location *loc */\n "
7332- " %s, /* gcc_jit_type *type */\n "
7333- " %s); /* const char *name */\n " ,
7334- id,
7335- r.get_identifier (m_func),
7336- r.get_identifier (m_loc),
7337- r.get_identifier_as_type (m_type),
7338- m_name->get_debug_string ());
7347+ if (m_is_temp)
7348+ r.write (" gcc_jit_lvalue *%s =\n "
7349+ " gcc_jit_function_new_temp (%s, /* gcc_jit_function *func */\n "
7350+ " %s, /* gcc_jit_location *loc */\n "
7351+ " %s); /* gcc_jit_type *type */\n " ,
7352+ id,
7353+ r.get_identifier (m_func),
7354+ r.get_identifier (m_loc),
7355+ r.get_identifier_as_type (m_type));
7356+ else
7357+ r.write (" gcc_jit_lvalue *%s =\n "
7358+ " gcc_jit_function_new_local (%s, /* gcc_jit_function *func */\n "
7359+ " %s, /* gcc_jit_location *loc */\n "
7360+ " %s, /* gcc_jit_type *type */\n "
7361+ " %s); /* const char *name */\n " ,
7362+ id,
7363+ r.get_identifier (m_func),
7364+ r.get_identifier (m_loc),
7365+ r.get_identifier_as_type (m_type),
7366+ m_name->get_debug_string ());
73397367}
73407368
73417369/* The implementation of class gcc::jit::recording::statement. */
0 commit comments