aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/main
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-03-18 11:31:12 +0100
committerMagnus Lång <[email protected]>2016-08-30 17:02:40 +0200
commit4b8c17b0901dfa356792c36f01d78de827cb6645 (patch)
treebcb18464e0150d82b53807a51b7427e30db2252e /lib/hipe/main
parentf8086b825904eb842f44671ce773197d6ba03879 (diff)
downloadotp-4b8c17b0901dfa356792c36f01d78de827cb6645.tar.gz
otp-4b8c17b0901dfa356792c36f01d78de827cb6645.tar.bz2
otp-4b8c17b0901dfa356792c36f01d78de827cb6645.zip
hipe: Fix o0 and o1
These options would not do anything, because they would not supress the 'o2' in ?COMPILE_DEFAULTS. Such behaviour is added to expand_options/2.
Diffstat (limited to 'lib/hipe/main')
-rw-r--r--lib/hipe/main/hipe.erl29
1 files changed, 20 insertions, 9 deletions
diff --git a/lib/hipe/main/hipe.erl b/lib/hipe/main/hipe.erl
index 8d9f893bec..4e6de2e0dc 100644
--- a/lib/hipe/main/hipe.erl
+++ b/lib/hipe/main/hipe.erl
@@ -1118,9 +1118,10 @@ help_hiper() ->
help_options() ->
HostArch = erlang:system_info(hipe_architecture),
- O1 = expand_options([o1], HostArch),
- O2 = expand_options([o2], HostArch),
- O3 = expand_options([o3], HostArch),
+ O0 = expand_options([o0] ++ ?COMPILE_DEFAULTS, HostArch),
+ O1 = expand_options([o1] ++ ?COMPILE_DEFAULTS, HostArch),
+ O2 = expand_options([o2] ++ ?COMPILE_DEFAULTS, HostArch),
+ O3 = expand_options([o3] ++ ?COMPILE_DEFAULTS, HostArch),
io:format("HiPE Compiler Options\n" ++
" Boolean-valued options generally have corresponding " ++
"aliases `no_...',\n" ++
@@ -1139,15 +1140,16 @@ help_options() ->
" pp_x86 = pp_native,\n" ++
" pp_amd64 = pp_native,\n" ++
" pp_ppc = pp_native,\n" ++
- " o0,\n" ++
- " o1 = ~p,\n" ++
+ " o0 = ~p,\n" ++
+ " o1 = ~p ++ o0,\n" ++
" o2 = ~p ++ o1,\n" ++
" o3 = ~p ++ o2.\n",
[ordsets:from_list([verbose, debug, time, load, pp_beam,
pp_icode, pp_rtl, pp_native, pp_asm,
timeout]),
expand_options([pp_all], HostArch),
- O1 -- [o1],
+ O0 -- [o0],
+ (O1 -- O0) -- [o1],
(O2 -- O1) -- [o2],
(O3 -- O2) -- [o3]]),
ok.
@@ -1485,7 +1487,8 @@ opt_basic_expansions() ->
[{pp_all, [pp_beam, pp_icode, pp_rtl, pp_native]}].
opt_expansions(TargetArch) ->
- [{o1, o1_opts(TargetArch)},
+ [{o0, o0_opts(TargetArch)},
+ {o1, o1_opts(TargetArch)},
{o2, o2_opts(TargetArch)},
{o3, o3_opts(TargetArch)},
{to_llvm, llvm_opts(o3, TargetArch)},
@@ -1532,13 +1535,21 @@ expand_kt2(Opts) ->
-spec expand_options(comp_options(), hipe_architecture()) -> comp_options().
-expand_options(Opts, TargetArch) ->
+expand_options(Opts0, TargetArch) ->
+ Opts1 = proplists:normalize(Opts0, [{aliases, opt_aliases()}]),
+ Opts = normalise_opt_options(Opts1),
proplists:normalize(Opts, [{negations, opt_negations()},
- {aliases, opt_aliases()},
{expand, opt_basic_expansions()},
{expand, opt_expansions(TargetArch)},
{negations, opt_negations()}]).
+normalise_opt_options([o0|Opts]) -> [o0] ++ (Opts -- [o0, o1, o2, o3]);
+normalise_opt_options([o1|Opts]) -> [o1] ++ (Opts -- [o0, o1, o2, o3]);
+normalise_opt_options([o2|Opts]) -> [o2] ++ (Opts -- [o0, o1, o2, o3]);
+normalise_opt_options([o3|Opts]) -> [o3] ++ (Opts -- [o0, o1, o2, o3]);
+normalise_opt_options([O|Opts]) -> [O|normalise_opt_options(Opts)];
+normalise_opt_options([]) -> [].
+
-spec check_options(comp_options()) -> 'ok'.
check_options(Opts) ->