Skip to content

Commit

Permalink
Consider remove_sub as semantic changing
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinWonho committed Jul 22, 2024
1 parent 5300391 commit 488a719
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spectec/src/il2al/translate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,8 @@ let translate_helper partial_funcs def =
let body =
Transpile.merge_blocks blocks
|> Transpile.insert_frame_binding
|> Walk.(walk_instrs { default_config with pre_expr = Transpile.remove_sub })
|> Transpile.enhance_readability
(* |> Walk.(walk_instrs { default_config with pre_expr = Transpile.remove_sub }) *)
|> (if List.mem id partial_funcs then Fun.id else Transpile.ensure_return)
|> Transpile.flatten_if in

Expand Down Expand Up @@ -1083,8 +1083,8 @@ and translate_rgroup (instr_name, rgroup) =
instrs
|> Transpile.insert_frame_binding
|> insert_nop
|> Walk.(walk_instrs { default_config with pre_expr = Transpile.remove_sub })
|> Transpile.enhance_readability
(* |> Walk.(walk_instrs { default_config with pre_expr = Transpile.remove_sub }) *)
|> Transpile.infer_assert
|> Transpile.flatten_if
in
Expand Down
2 changes: 1 addition & 1 deletion spectec/src/il2al/transpile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ let rec enhance_readability instrs =
let walk_config =
{
Walk.default_config with
pre_expr = composite remove_sub simplify_record_concat |> composite if_not_defined;
pre_expr = simplify_record_concat |> composite if_not_defined;
post_instr =
unify_if_tail @@ (lift swap_if) @@ early_return @@ (lift merge_three_branches);
} in
Expand Down

0 comments on commit 488a719

Please sign in to comment.