@@ -799,12 +799,12 @@ impl Module {
799799
800800 Seq :: Function
801801 } ;
802- if let Some ( prev_seq) = seq {
803- if prev_seq > next_seq {
804- return Err ( invalid ( & format ! (
805- "out of order: {next_seq:?} instructions must precede {prev_seq:?} instructions"
806- ) ) ) ;
807- }
802+ if let Some ( prev_seq) = seq
803+ && prev_seq > next_seq
804+ {
805+ return Err ( invalid ( & format ! (
806+ "out of order: {next_seq:?} instructions must precede {prev_seq:?} instructions"
807+ ) ) ) ;
808808 }
809809 seq = Some ( next_seq) ;
810810
@@ -978,26 +978,26 @@ impl Module {
978978 local_id_defs. insert ( id, local_id_def) ;
979979 }
980980
981- if let Some ( def_map) = & mut cfgssa_def_map {
982- if let DeclDef :: Present ( func_def_body) = & func_decl. def {
983- let current_block = match block_details. last ( ) {
984- Some ( ( & current_block, _) ) => current_block,
985- // HACK(eddyb) ensure e.g. `OpFunctionParameter`
986- // are treated like `OpPhi`s of the entry block.
987- None => func_def_body. body ,
988- } ;
981+ if let Some ( def_map) = & mut cfgssa_def_map
982+ && let DeclDef :: Present ( func_def_body) = & func_decl. def
983+ {
984+ let current_block = match block_details. last ( ) {
985+ Some ( ( & current_block, _) ) => current_block,
986+ // HACK(eddyb) ensure e.g. `OpFunctionParameter`
987+ // are treated like `OpPhi`s of the entry block.
988+ None => func_def_body. body ,
989+ } ;
989990
990- if opcode == wk. OpLabel {
991- // HACK(eddyb) the entry block was already added.
992- if current_block != func_def_body. body {
993- def_map. add_block ( current_block) ;
994- }
995- continue ;
991+ if opcode == wk. OpLabel {
992+ // HACK(eddyb) the entry block was already added.
993+ if current_block != func_def_body. body {
994+ def_map. add_block ( current_block) ;
996995 }
996+ continue ;
997+ }
997998
998- if let Some ( id) = result_id {
999- def_map. add_def ( current_block, id, result_type. unwrap ( ) ) ;
1000- }
999+ if let Some ( id) = result_id {
1000+ def_map. add_def ( current_block, id, result_type. unwrap ( ) ) ;
10011001 }
10021002 }
10031003 }
@@ -1643,14 +1643,12 @@ impl Module {
16431643 }
16441644
16451645 // Sanity-check the entry block.
1646- if let Some ( func_def_body) = func_def_body {
1647- if block_details[ & func_def_body. body ] . phi_count > 0 {
1648- // FIXME(remove) embed IDs in errors by moving them to the
1649- // `let invalid = |...| ...;` closure that wraps insts.
1650- return Err ( invalid ( & format ! (
1651- "in %{func_id}, the entry block contains `OpPhi`s"
1652- ) ) ) ;
1653- }
1646+ if let Some ( func_def_body) = func_def_body
1647+ && block_details[ & func_def_body. body ] . phi_count > 0
1648+ {
1649+ // FIXME(remove) embed IDs in errors by moving them to the
1650+ // `let invalid = |...| ...;` closure that wraps insts.
1651+ return Err ( invalid ( & format ! ( "in %{func_id}, the entry block contains `OpPhi`s" ) ) ) ;
16541652 }
16551653 }
16561654
0 commit comments