Skip to content

Commit 1a8febb

Browse files
authored
flambda-backend: Formatting of help text for some Flambda 2 options (#101)
1 parent 9ae1c7a commit 1a8febb

File tree

1 file changed

+47
-42
lines changed

1 file changed

+47
-42
lines changed

driver/main_args.ml

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -926,152 +926,157 @@ module Flambda2 = Clflags.Flambda2
926926

927927
let mk_flambda2_join_points f =
928928
"-flambda2-join-points", Arg.Unit f,
929-
Printf.sprintf " Propagate information from incoming \
930-
edges at a join point%s (Flambda 2 only)"
929+
Printf.sprintf "Propagate information from incoming edges at a join\n\
930+
\ point%s (Flambda 2 only)"
931931
(format_default Flambda2.Default.join_points)
932932
;;
933933

934934
let mk_no_flambda2_join_points f =
935935
"-no-flambda2-join-points", Arg.Unit f,
936-
Printf.sprintf " Propagate information only from \
937-
the fork point to a join point%s (Flambda 2 only)"
936+
Printf.sprintf " Propagate information only from the fork point to\n\
937+
\ a join point%s (Flambda 2 only)"
938938
(format_not_default Flambda2.Default.join_points)
939939
;;
940940

941941
let mk_flambda2_unbox_along_intra_function_control_flow f =
942942
"-flambda2-unbox-along-intra-function-control-flow", Arg.Unit f,
943-
Printf.sprintf " Pass values within a function as unboxed where possible%s \
944-
(Flambda 2 only)"
943+
Printf.sprintf " Pass values within\n\
944+
\ a function as unboxed where possible%s (Flambda 2 only)"
945945
(format_default Flambda2.Default.unbox_along_intra_function_control_flow)
946946
;;
947947

948948
let mk_no_flambda2_unbox_along_intra_function_control_flow f =
949949
"-no-flambda2-unbox-along-intra-function-control-flow", Arg.Unit f,
950-
Printf.sprintf " Pass values within a function in their normal \
951-
representation%s (Flambda 2 only)"
950+
Printf.sprintf " Pass values within\n\
951+
\ a function in their normal representation%s (Flambda 2 only)"
952952
(format_not_default
953953
Flambda2.Default.unbox_along_intra_function_control_flow)
954954
;;
955955

956956
let mk_flambda2_backend_cse_at_toplevel f =
957957
"-flambda2-backend-cse-at-toplevel", Arg.Unit f,
958-
Printf.sprintf " Apply the backend CSE pass to module initializers%s \
959-
(Flambda 2 only)"
958+
Printf.sprintf " Apply the backend CSE pass to module\n\
959+
\ initializers%s (Flambda 2 only)"
960960
(format_default Flambda2.Default.backend_cse_at_toplevel)
961961
;;
962962

963963
let mk_no_flambda2_backend_cse_at_toplevel f =
964964
"-no-flambda2-backend-cse-at-toplevel", Arg.Unit f,
965-
Printf.sprintf " Do not apply the backend CSE pass to module initializers%s \
966-
(Flambda 2 only)"
965+
Printf.sprintf " Do not apply the backend CSE pass to\n\
966+
\ module initializers%s (Flambda 2 only)"
967967
(format_not_default Flambda2.Default.backend_cse_at_toplevel)
968968
;;
969969

970970
let mk_flambda2_cse_depth f =
971971
"-flambda2-cse-depth", Arg.Int f,
972-
Printf.sprintf " Depth threshold for eager tracking of CSE equations \
973-
(default %d) (Flambda 2 only)"
972+
Printf.sprintf " Depth threshold for eager tracking of CSE equations\n\
973+
\ (default %d) (Flambda 2 only)"
974974
Flambda2.Default.cse_depth
975975
;;
976976

977977
let mk_flambda2_expert_code_id_and_symbol_scoping_checks f =
978978
"-flambda2-expert-code-id-and-symbol-scoping-checks", Arg.Unit f,
979-
Printf.sprintf " Perform checks on static scopes of code IDs and symbols \
980-
during Un_cps%s (Flambda 2 only)"
979+
Printf.sprintf " Perform checks on static\n\
980+
\ scopes of code IDs and symbols during Un_cps%s\n\
981+
\ (Flambda 2 only)"
981982
(format_default Flambda2.Expert.Default.code_id_and_symbol_scoping_checks)
982983
;;
983984

984985
let mk_no_flambda2_expert_code_id_and_symbol_scoping_checks f =
985986
"-no-flambda2-expert-code-id-and-symbol-scoping-checks", Arg.Unit f,
986-
Printf.sprintf " Do not perform checks on static scopes of code IDs and \
987-
symbols during Un_cps%s (Flambda 2 only)"
987+
Printf.sprintf " Do not perform checks\n\
988+
\ on static scopes of code IDs and symbols during Un_cps%s\n\
989+
\ (Flambda 2 only)"
988990
(format_not_default
989991
Flambda2.Expert.Default.code_id_and_symbol_scoping_checks)
990992
;;
991993

992994
let mk_flambda2_expert_fallback_inlining_heuristic f =
993995
"-flambda2-expert-fallback-inlining-heuristic", Arg.Unit f,
994-
Printf.sprintf " Prevent inlining of functions whose bodies contain \
995-
closures%s (Flambda 2 only)"
996+
Printf.sprintf " Prevent inlining of functions\n\
997+
\ whose bodies contain closures%s (Flambda 2 only)"
996998
(format_default Flambda2.Expert.Default.fallback_inlining_heuristic)
997999
;;
9981000

9991001
let mk_no_flambda2_expert_fallback_inlining_heuristic f =
10001002
"-no-flambda2-expert-fallback-inlining-heuristic", Arg.Unit f,
1001-
Printf.sprintf " Allow inlining of functions whose bodies contain \
1002-
closures%s (Flambda 2 only)"
1003+
Printf.sprintf " Allow inlining of functions\n\
1004+
\ whose bodies contain closures%s (Flambda 2 only)"
10031005
(format_not_default Flambda2.Expert.Default.fallback_inlining_heuristic)
10041006
;;
10051007

10061008
let mk_flambda2_expert_inline_effects_in_cmm f =
10071009
"-flambda2-expert-inline-effects-in-cmm", Arg.Unit f,
1008-
Printf.sprintf " Allow inlining of effectful expressions in the produced \
1009-
Cmm code%s (Flambda 2 only)"
1010+
Printf.sprintf " Allow inlining of effectful\n\
1011+
\ expressions in the produced Cmm code%s (Flambda 2 only)"
10101012
(format_default Flambda2.Expert.Default.inline_effects_in_cmm)
10111013
;;
10121014

10131015
let mk_no_flambda2_expert_inline_effects_in_cmm f =
10141016
"-no-flambda2-expert-inline-effects-in-cmm", Arg.Unit f,
1015-
Printf.sprintf " Prevent inlining of effectful expressions in the produced \
1016-
Cmm code%s (Flambda 2 only)"
1017+
Printf.sprintf " Prevent inlining of effectful\n\
1018+
\ expressions in the produced Cmm code%s (Flambda 2 only)"
10171019
(format_not_default Flambda2.Expert.Default.inline_effects_in_cmm)
10181020
;;
10191021

10201022
let mk_flambda2_expert_phantom_lets f =
10211023
"-flambda2-expert-phantom-lets", Arg.Unit f,
1022-
Printf.sprintf " Generate phantom lets when -g is specified%s \
1023-
(Flambda 2 only)"
1024+
Printf.sprintf " Generate phantom lets when -g\n\
1025+
\ is specified%s (Flambda 2 only)"
10241026
(format_default Flambda2.Expert.Default.phantom_lets)
10251027
;;
10261028

10271029
let mk_no_flambda2_expert_phantom_lets f =
10281030
"-no-flambda2-expert-phantom-lets", Arg.Unit f,
1029-
Printf.sprintf " Do not generate phantom lets even when -g is specified%s \
1030-
(Flambda 2 only)"
1031+
Printf.sprintf " Do not generate phantom lets even when -g\n\
1032+
\ is specified%s (Flambda 2 only)"
10311033
(format_not_default Flambda2.Expert.Default.phantom_lets)
10321034
;;
10331035

10341036
let mk_flambda2_expert_max_block_size_for_projections f =
10351037
"-flambda2-expert-max-block-size-for-projections", Arg.Int f,
1036-
Printf.sprintf " Do not simplify projections from blocks if the block size \
1037-
exceeds this value (default %s) (Flambda 2 only)"
1038+
Printf.sprintf " Do not simplify projections\n\
1039+
\ from blocks if the block size exceeds this value (default %s)\n\
1040+
\ (Flambda 2 only)"
10381041
(match Flambda2.Expert.Default.max_block_size_for_projections with
10391042
| None -> "not set"
10401043
| Some max -> string_of_int max)
10411044
;;
10421045

10431046
let mk_flambda2_expert_max_unboxing_depth f =
10441047
"-flambda2-expert-max-unboxing-depth", Arg.Int f,
1045-
Printf.sprintf " Do not unbox (nested) values deeper than this many levels \
1046-
(default %d) (Flambda 2 only)"
1048+
Printf.sprintf " Do not unbox (nested) values deeper\n\
1049+
\ than this many levels (default %d) (Flambda 2 only)"
10471050
Flambda2.Expert.Default.max_unboxing_depth
10481051
;;
10491052

10501053
let mk_flambda2_debug_permute_every_name f =
10511054
"-flambda2-debug-permute-every-name", Arg.Unit f,
1052-
Printf.sprintf " Permute every name to test name permutation code%s \
1053-
(Flambda 2 only)"
1055+
Printf.sprintf " Permute every name to test name\n\
1056+
\ permutation code%s (Flambda 2 only)"
10541057
(format_default Flambda2.Debug.Default.permute_every_name)
10551058
;;
10561059

10571060
let mk_no_flambda2_debug_permute_every_name f =
10581061
"-no-flambda2-debug-permute-every-name", Arg.Unit f,
1059-
Printf.sprintf " Do not permute every name to test name permutation code%s \
1060-
(Flambda 2 only)"
1062+
Printf.sprintf " Do not permute every name to test\n\
1063+
\ name permutation code%s (Flambda 2 only)"
10611064
(format_not_default Flambda2.Debug.Default.permute_every_name)
10621065
;;
10631066

10641067
let mk_flambda2_debug_concrete_types_only_on_canonicals f =
10651068
"-flambda2-debug-concrete-types-only-on-canonicals", Arg.Unit f,
1066-
Printf.sprintf " Check that concrete types are only assigned to canonical \
1067-
names%s (Flambda 2 only)"
1069+
Printf.sprintf " Check that concrete\n\
1070+
\ types are only assigned to canonical\n\
1071+
\ names%s (Flambda 2 only)"
10681072
(format_default Flambda2.Debug.Default.concrete_types_only_on_canonicals)
10691073
;;
10701074

10711075
let mk_no_flambda2_debug_concrete_types_only_on_canonicals f =
10721076
"-no-flambda2-debug-concrete-types-only-on-canonicals", Arg.Unit f,
1073-
Printf.sprintf " Do not check that concrete types are only assigned to \
1074-
canonical names%s (Flambda 2 only)"
1077+
Printf.sprintf " Do not check that\n\
1078+
\ concrete types are only assigned to canonical\n\
1079+
\ names%s (Flambda 2 only)"
10751080
(format_not_default
10761081
Flambda2.Debug.Default.concrete_types_only_on_canonicals)
10771082
;;

0 commit comments

Comments
 (0)