@@ -4447,7 +4447,24 @@ recording::function::new_local (recording::location *loc,
44474447 type *type,
44484448 const char *name)
44494449{
4450- local *result = new local (this , loc, type, new_string (name));
4450+ local *result = new local (this , loc, type, new_string (name), false );
4451+ m_ctxt->record (result);
4452+ m_locals.safe_push (result);
4453+ return result;
4454+ }
4455+
4456+ /* Create a recording::local instance and add it to
4457+ the functions's context's list of mementos, and to the function's
4458+ list of locals.
4459+
4460+ Implements the post-error-checking part of
4461+ gcc_jit_function_new_temp. */
4462+
4463+ recording::lvalue *
4464+ recording::function::new_temp (recording::location *loc,
4465+ type *type)
4466+ {
4467+ local *result = new local (this , loc, type, NULL , true );
44514468 m_ctxt->record (result);
44524469 m_locals.safe_push (result);
44534470 return result;
@@ -7213,7 +7230,8 @@ recording::local::replay_into (replayer *r)
72137230 ->new_local (playback_location (r, m_loc),
72147231 m_type->playback_type (),
72157232 playback_string (m_name),
7216- m_attributes);
7233+ m_attributes,
7234+ m_is_temp);
72177235
72187236 if (m_reg_name != NULL )
72197237 obj->set_register_name (m_reg_name->c_str ());
@@ -7244,16 +7262,26 @@ void
72447262recording::local::write_reproducer (reproducer &r)
72457263{
72467264 const char *id = r.make_identifier (this , " local" );
7247- r.write (" gcc_jit_lvalue *%s =\n "
7248- " gcc_jit_function_new_local (%s, /* gcc_jit_function *func */\n "
7249- " %s, /* gcc_jit_location *loc */\n "
7250- " %s, /* gcc_jit_type *type */\n "
7251- " %s); /* const char *name */\n " ,
7252- id,
7253- r.get_identifier (m_func),
7254- r.get_identifier (m_loc),
7255- r.get_identifier_as_type (m_type),
7256- m_name->get_debug_string ());
7265+ if (m_is_temp)
7266+ r.write (" gcc_jit_lvalue *%s =\n "
7267+ " gcc_jit_function_new_temp (%s, /* gcc_jit_function *func */\n "
7268+ " %s, /* gcc_jit_location *loc */\n "
7269+ " %s); /* gcc_jit_type *type */\n " ,
7270+ id,
7271+ r.get_identifier (m_func),
7272+ r.get_identifier (m_loc),
7273+ r.get_identifier_as_type (m_type));
7274+ else
7275+ r.write (" gcc_jit_lvalue *%s =\n "
7276+ " gcc_jit_function_new_local (%s, /* gcc_jit_function *func */\n "
7277+ " %s, /* gcc_jit_location *loc */\n "
7278+ " %s, /* gcc_jit_type *type */\n "
7279+ " %s); /* const char *name */\n " ,
7280+ id,
7281+ r.get_identifier (m_func),
7282+ r.get_identifier (m_loc),
7283+ r.get_identifier_as_type (m_type),
7284+ m_name->get_debug_string ());
72577285}
72587286
72597287/* The implementation of class gcc::jit::recording::statement. */
0 commit comments