aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/compile.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-01-20 10:51:09 +0100
committerBjörn Gustavsson <[email protected]>2014-01-20 10:51:09 +0100
commit80205afbd31a29e052416bd8c686b65fe06ea3f4 (patch)
tree84549d523e91dadfe5bae4c14f36f18ee7d9f150 /lib/compiler/src/compile.erl
parent7ba68e1dc45981a82ccec84d157699606d664431 (diff)
parente12b7d5331c58b41db06cadfa4af75b78b62a2b1 (diff)
downloadotp-80205afbd31a29e052416bd8c686b65fe06ea3f4.tar.gz
otp-80205afbd31a29e052416bd8c686b65fe06ea3f4.tar.bz2
otp-80205afbd31a29e052416bd8c686b65fe06ea3f4.zip
Merge branch 'bjorn/compiler/optimizations/OTP-11584'
* bjorn/compiler/optimizations/OTP-11584: Generalize optimizations of case statements Ignore warnings when running sys_core_fold after inlining
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r--lib/compiler/src/compile.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 38a733751a..3db7ffc4d2 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -612,7 +612,7 @@ core_passes() ->
?pass(core_fold_module),
{core_inline_module,fun test_core_inliner/1,fun core_inline_module/1},
{iff,dinline,{listing,"inline"}},
- {core_fold_after_inline,fun test_core_inliner/1,fun core_fold_module/1},
+ {core_fold_after_inlining,fun test_core_inliner/1,fun core_fold_module_after_inlining/1},
?pass(core_transforms)]},
{iff,dcopt,{listing,"copt"}},
{iff,'to_core',{done,"core"}}]}
@@ -1134,6 +1134,12 @@ core_fold_module(#compile{code=Code0,options=Opts,warnings=Warns}=St) ->
{ok,Code,Ws} = sys_core_fold:module(Code0, Opts),
{ok,St#compile{code=Code,warnings=Warns ++ Ws}}.
+core_fold_module_after_inlining(#compile{code=Code0,options=Opts}=St) ->
+ %% Inlining may produce code that generates spurious warnings.
+ %% Ignore all warnings.
+ {ok,Code,_Ws} = sys_core_fold:module(Code0, Opts),
+ {ok,St#compile{code=Code}}.
+
test_old_inliner(#compile{options=Opts}) ->
%% The point of this test is to avoid loading the old inliner
%% if we know that it will not be used.