aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/compile.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-11-23 12:16:25 +0100
committerBjörn Gustavsson <[email protected]>2016-11-23 12:16:25 +0100
commit480ddeaa1217411e07d694595e458a084c44b4f1 (patch)
treee9a4e6451e732559d46b86fb23dd1f356c114d2f /lib/compiler/src/compile.erl
parent3c8ba27ed87707942c357ade1d1f2471700f4203 (diff)
parent9cac4f15d84a7682f17dee01c0ce4a12bac5d9ff (diff)
downloadotp-480ddeaa1217411e07d694595e458a084c44b4f1.tar.gz
otp-480ddeaa1217411e07d694595e458a084c44b4f1.tar.bz2
otp-480ddeaa1217411e07d694595e458a084c44b4f1.zip
Merge branch 'maint'
* maint: Update primary bootstrap document {yield/nb_yield}() limitation Suppress warnings from v3_kernel when inlining is turned on
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r--lib/compiler/src/compile.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 37da045d25..3868b971a3 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -684,7 +684,7 @@ kernel_passes() ->
{iff,core,?pass(save_core_code)},
%% Kernel Erlang and code generation.
- {pass,v3_kernel},
+ ?pass(v3_kernel),
{iff,dkern,{listing,"kernel"}},
{iff,'to_kernel',{done,"kernel"}},
{pass,v3_life},
@@ -1243,6 +1243,17 @@ core_fold_module_after_inlining(#compile{code=Code0,options=Opts}=St) ->
{ok,Code,_Ws} = sys_core_fold:module(Code0, Opts),
{ok,St#compile{code=Code}}.
+v3_kernel(#compile{code=Code0,options=Opts,warnings=Ws0}=St) ->
+ {ok,Code,Ws} = v3_kernel:module(Code0, Opts),
+ case Ws =:= [] orelse test_core_inliner(St) of
+ false ->
+ {ok,St#compile{code=Code,warnings=Ws0++Ws}};
+ true ->
+ %% cerl_inline may produce code that generates spurious
+ %% warnings. Ignore any such warnings.
+ {ok,St#compile{code=Code}}
+ end.
+
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.