diff options
author | Björn Gustavsson <[email protected]> | 2016-11-23 12:16:25 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-11-23 12:16:25 +0100 |
commit | 480ddeaa1217411e07d694595e458a084c44b4f1 (patch) | |
tree | e9a4e6451e732559d46b86fb23dd1f356c114d2f | |
parent | 3c8ba27ed87707942c357ade1d1f2471700f4203 (diff) | |
parent | 9cac4f15d84a7682f17dee01c0ce4a12bac5d9ff (diff) | |
download | otp-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
-rw-r--r-- | bootstrap/lib/compiler/ebin/beam_bsm.beam | bin | 12632 -> 12600 bytes | |||
-rw-r--r-- | bootstrap/lib/compiler/ebin/compile.beam | bin | 39512 -> 39824 bytes | |||
-rw-r--r-- | bootstrap/lib/compiler/ebin/sys_core_fold.beam | bin | 52544 -> 51860 bytes | |||
-rw-r--r-- | bootstrap/lib/stdlib/ebin/gen_statem.beam | bin | 14076 -> 17344 bytes | |||
-rw-r--r-- | bootstrap/lib/stdlib/ebin/ms_transform.beam | bin | 20464 -> 20492 bytes | |||
-rw-r--r-- | lib/compiler/src/compile.erl | 13 | ||||
-rw-r--r-- | lib/compiler/test/warnings_SUITE.erl | 28 | ||||
-rw-r--r-- | lib/kernel/doc/src/rpc.xml | 16 |
8 files changed, 54 insertions, 3 deletions
diff --git a/bootstrap/lib/compiler/ebin/beam_bsm.beam b/bootstrap/lib/compiler/ebin/beam_bsm.beam Binary files differindex 1a7009c849..f52d74d1dc 100644 --- a/bootstrap/lib/compiler/ebin/beam_bsm.beam +++ b/bootstrap/lib/compiler/ebin/beam_bsm.beam diff --git a/bootstrap/lib/compiler/ebin/compile.beam b/bootstrap/lib/compiler/ebin/compile.beam Binary files differindex 86d7a86aa2..721b86c92c 100644 --- a/bootstrap/lib/compiler/ebin/compile.beam +++ b/bootstrap/lib/compiler/ebin/compile.beam diff --git a/bootstrap/lib/compiler/ebin/sys_core_fold.beam b/bootstrap/lib/compiler/ebin/sys_core_fold.beam Binary files differindex 48171c8fd2..180875b297 100644 --- a/bootstrap/lib/compiler/ebin/sys_core_fold.beam +++ b/bootstrap/lib/compiler/ebin/sys_core_fold.beam diff --git a/bootstrap/lib/stdlib/ebin/gen_statem.beam b/bootstrap/lib/stdlib/ebin/gen_statem.beam Binary files differindex 748bd1b987..c795111f93 100644 --- a/bootstrap/lib/stdlib/ebin/gen_statem.beam +++ b/bootstrap/lib/stdlib/ebin/gen_statem.beam diff --git a/bootstrap/lib/stdlib/ebin/ms_transform.beam b/bootstrap/lib/stdlib/ebin/ms_transform.beam Binary files differindex a1e1c6ebb6..dd7a1f54ba 100644 --- a/bootstrap/lib/stdlib/ebin/ms_transform.beam +++ b/bootstrap/lib/stdlib/ebin/ms_transform.beam 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. diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl index 35f7db82bd..72ead22191 100644 --- a/lib/compiler/test/warnings_SUITE.erl +++ b/lib/compiler/test/warnings_SUITE.erl @@ -42,7 +42,7 @@ comprehensions/1,maps/1,maps_bin_opt_info/1, redundant_boolean_clauses/1, latin1_fallback/1,underscore/1,no_warnings/1, - bit_syntax/1]). + bit_syntax/1,inlining/1]). init_per_testcase(_Case, Config) -> Config. @@ -65,7 +65,7 @@ groups() -> bin_opt_info,bin_construction,comprehensions,maps, maps_bin_opt_info, redundant_boolean_clauses,latin1_fallback, - underscore,no_warnings,bit_syntax]}]. + underscore,no_warnings,bit_syntax,inlining]}]. init_per_suite(Config) -> Config. @@ -822,6 +822,30 @@ bit_syntax(Config) -> run(Config, Ts), ok. +inlining(Config) -> + %% Make sure that no spurious warnings are generated + %% when inlining. + Ts = [{inlining_1, + <<"-compile(inline). + compute1(X) -> add(X, 0). + add(1, 0) -> 1; + add(1, Y) -> 1 + Y; + add(X, Y) -> X + Y. + ">>, + [], + []}, + {inlining_2, + <<"-compile({inline,[add/2]}). + compute1(X) -> add(X, 0). + add(1, 0) -> 1; + add(1, Y) -> 1 + Y; + add(X, Y) -> X + Y. + ">>, + [], + []} + ], + run(Config, Ts), + ok. %%% %%% End of test cases. diff --git a/lib/kernel/doc/src/rpc.xml b/lib/kernel/doc/src/rpc.xml index 5944e9321a..adec2d9520 100644 --- a/lib/kernel/doc/src/rpc.xml +++ b/lib/kernel/doc/src/rpc.xml @@ -88,6 +88,12 @@ to retrieve the value of evaluating <c>apply(<anno>Module</anno>, <anno>Function</anno>, <anno>Args</anno>)</c> on node <c><anno>Node</anno></c>.</p> + <note> + <p><seealso marker="#yield/1"><c>yield/1</c></seealso> and + <seealso marker="#nb_yield/1"><c>nb_yield/1,2</c></seealso> + must be called by the same process from which this function + was made otherwise they will never yield correctly.</p> + </note> </desc> </func> @@ -299,6 +305,11 @@ the tuple <c>{value, <anno>Val</anno>}</c> when the computation is finished, or <c>timeout</c> when <c><anno>Timeout</anno></c> milliseconds has elapsed.</p> + <note> + <p>This function must be called by the same process from which + <seealso marker="#async_call/4"><c>async_call/4</c></seealso> + was made otherwise it will only return <c>timeout</c>.</p> + </note> </desc> </func> @@ -407,6 +418,11 @@ If the answer is available, it is returned immediately. Otherwise, the calling process is suspended until the answer arrives from <c>Node</c>.</p> + <note> + <p>This function must be called by the same process from which + <seealso marker="#async_call/4"><c>async_call/4</c></seealso> + was made otherwise it will never return.</p> + </note> </desc> </func> </funcs> |