@@ -4450,7 +4450,24 @@ recording::function::new_local (recording::location *loc,
4450
4450
type *type,
4451
4451
const char *name)
4452
4452
{
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 );
4454
4471
m_ctxt->record (result);
4455
4472
m_locals.safe_push (result);
4456
4473
return result;
@@ -7295,7 +7312,8 @@ recording::local::replay_into (replayer *r)
7295
7312
->new_local (playback_location (r, m_loc),
7296
7313
m_type->playback_type (),
7297
7314
playback_string (m_name),
7298
- m_string_attributes);
7315
+ m_string_attributes,
7316
+ m_is_temp);
7299
7317
7300
7318
if (m_reg_name != NULL )
7301
7319
obj->set_register_name (m_reg_name->c_str ());
@@ -7326,16 +7344,26 @@ void
7326
7344
recording::local::write_reproducer (reproducer &r)
7327
7345
{
7328
7346
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 ());
7339
7367
}
7340
7368
7341
7369
/* The implementation of class gcc::jit::recording::statement. */
0 commit comments