@@ -5398,14 +5398,11 @@ recording::block::add_eval (recording::location *loc,
53985398
53995399recording::statement *
54005400recording::block::add_try_catch (location *loc,
5401- block *try_block ,
5402- block *catch_block ,
5401+ recording::region *try_region ,
5402+ recording::region *catch_region ,
54035403 bool is_finally)
54045404{
5405- statement *result = new try_catch (this , loc, try_block, catch_block, is_finally);
5406- // TODO: explain why we set the blocks reachable state.
5407- try_block->m_is_reachable = true ;
5408- catch_block->m_is_reachable = true ;
5405+ statement *result = new try_catch (this , loc, try_region, catch_region, is_finally);
54095406 m_ctxt->record (result);
54105407 m_statements.safe_push (result);
54115408 return result;
@@ -8080,16 +8077,20 @@ void
80808077recording::try_catch::clone_into (block_cloner &cloner, block *dest) const
80818078{
80828079 dest->add_try_catch (get_loc (),
8083- cloner.remap (m_try_block ),
8084- cloner.remap (m_catch_block ),
8080+ cloner.clone_region (m_try_region ),
8081+ cloner.clone_region (m_catch_region ),
80858082 m_is_finally);
80868083}
80878084
80888085void
80898086recording::try_catch::get_inlined_blocks (auto_vec<block *> &out) const
80908087{
8091- out.safe_push (m_try_block);
8092- out.safe_push (m_catch_block);
8088+ unsigned i;
8089+ block *b;
8090+ FOR_EACH_VEC_ELT (m_try_region->get_blocks (), i, b)
8091+ out.safe_push (b);
8092+ FOR_EACH_VEC_ELT (m_catch_region->get_blocks (), i, b)
8093+ out.safe_push (b);
80938094}
80948095
80958096void
@@ -8225,8 +8226,8 @@ recording::try_catch::replay_into (replayer *r)
82258226{
82268227 playback_block (get_block ())
82278228 ->add_try_catch (playback_location (r),
8228- m_try_block-> playback_block () ,
8229- m_catch_block-> playback_block () ,
8229+ m_try_region ,
8230+ m_catch_region ,
82308231 m_is_finally);
82318232}
82328233
@@ -8239,13 +8240,13 @@ recording::try_catch::make_debug_string ()
82398240 if (m_is_finally)
82408241 return string::from_printf (m_ctxt,
82418242 " try { %s } finally { %s };" ,
8242- m_try_block ->get_debug_string (),
8243- m_catch_block ->get_debug_string ());
8243+ m_try_region ->get_debug_string (),
8244+ m_catch_region ->get_debug_string ());
82448245 else
82458246 return string::from_printf (m_ctxt,
82468247 " try { %s } catch { %s };" ,
8247- m_try_block ->get_debug_string (),
8248- m_catch_block ->get_debug_string ());
8248+ m_try_region ->get_debug_string (),
8249+ m_catch_region ->get_debug_string ());
82498250}
82508251
82518252/* Implementation of recording::memento::write_reproducer for
@@ -8264,8 +8265,8 @@ recording::try_catch::write_reproducer (reproducer &r)
82648265 func_name,
82658266 r.get_identifier (get_block ()),
82668267 r.get_identifier (get_loc ()),
8267- r.get_identifier (m_try_block ),
8268- r.get_identifier (m_catch_block ));
8268+ r.get_identifier (m_try_region ),
8269+ r.get_identifier (m_catch_region ));
82698270}
82708271
82718272/* The implementation of class gcc::jit::recording::cleanup. */
0 commit comments