@@ -8628,10 +8628,7 @@ assemble(struct compiler *c, int addNone)
8628
8628
}
8629
8629
nlocalsplus -= numdropped ;
8630
8630
8631
- consts = consts_dict_keys_inorder (c -> u -> u_consts );
8632
- if (consts == NULL ) {
8633
- goto error ;
8634
- }
8631
+ /** Desugaring **/
8635
8632
if (calculate_jump_targets (g -> g_entryblock )) {
8636
8633
goto error ;
8637
8634
}
@@ -8641,6 +8638,12 @@ assemble(struct compiler *c, int addNone)
8641
8638
if (label_exception_targets (g -> g_entryblock )) {
8642
8639
goto error ;
8643
8640
}
8641
+
8642
+ /** Optimization **/
8643
+ consts = consts_dict_keys_inorder (c -> u -> u_consts );
8644
+ if (consts == NULL ) {
8645
+ goto error ;
8646
+ }
8644
8647
if (optimize_cfg (g , consts , c -> c_const_cache )) {
8645
8648
goto error ;
8646
8649
}
@@ -8665,6 +8668,7 @@ assemble(struct compiler *c, int addNone)
8665
8668
remove_redundant_nops (b );
8666
8669
}
8667
8670
8671
+ /** Assembly **/
8668
8672
/* Order of basic blocks must have been determined by now */
8669
8673
if (normalize_jumps (g ) < 0 ) {
8670
8674
goto error ;
@@ -9599,12 +9603,14 @@ is_exit_without_lineno(basicblock *b) {
9599
9603
static int
9600
9604
duplicate_exits_without_lineno (cfg_builder * g )
9601
9605
{
9606
+ assert (no_empty_basic_blocks (g ));
9602
9607
/* Copy all exit blocks without line number that are targets of a jump.
9603
9608
*/
9604
9609
basicblock * entryblock = g -> g_entryblock ;
9605
9610
for (basicblock * b = entryblock ; b != NULL ; b = b -> b_next ) {
9606
9611
struct instr * last = basicblock_last_instr (b );
9607
- if (last != NULL && is_jump (last )) {
9612
+ assert (last != NULL );
9613
+ if (is_jump (last )) {
9608
9614
basicblock * target = last -> i_target ;
9609
9615
if (is_exit_without_lineno (target ) && target -> b_predecessors > 1 ) {
9610
9616
basicblock * new_target = copy_basicblock (g , target );
@@ -9621,8 +9627,6 @@ duplicate_exits_without_lineno(cfg_builder *g)
9621
9627
}
9622
9628
}
9623
9629
9624
- assert (no_empty_basic_blocks (g ));
9625
-
9626
9630
/* Any remaining reachable exit blocks without line number can only be reached by
9627
9631
* fall through, and thus can only have a single predecessor */
9628
9632
for (basicblock * b = entryblock ; b != NULL ; b = b -> b_next ) {
0 commit comments