diff options
author | Björn Gustavsson <[email protected]> | 2016-11-23 11:48:14 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-11-23 11:48:14 +0100 |
commit | bfc187c11ca3e0fd0df250633201e578c5a1651a (patch) | |
tree | cb930299eb47176de5c9aefbcf0810e350f41298 /lib/compiler/src | |
parent | d5f65731895c2ae00cc33343509290cbd81a1f64 (diff) | |
parent | d8afbc245f28c37c2417c86c9a2d9d27266fe37f (diff) | |
download | otp-bfc187c11ca3e0fd0df250633201e578c5a1651a.tar.gz otp-bfc187c11ca3e0fd0df250633201e578c5a1651a.tar.bz2 otp-bfc187c11ca3e0fd0df250633201e578c5a1651a.zip |
Merge branch 'bjorn/compiler/fix-unwanted-warning/ERL-301/OTP-14040' into maint
* bjorn/compiler/fix-unwanted-warning/ERL-301/OTP-14040:
Suppress warnings from v3_kernel when inlining is turned on
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/compile.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index e951a25e04..97d63d399a 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}, @@ -1241,6 +1241,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. |