diff options
author | Björn Gustavsson <[email protected]> | 2016-11-17 16:21:34 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-11-18 10:52:33 +0100 |
commit | d8afbc245f28c37c2417c86c9a2d9d27266fe37f (patch) | |
tree | dc17dc4e29dc796ba8eca6d19a44d85c89fcb1e4 /erts/emulator/beam | |
parent | 8fc527964d8fee17b9c10ce2516b3eb749332334 (diff) | |
download | otp-d8afbc245f28c37c2417c86c9a2d9d27266fe37f.tar.gz otp-d8afbc245f28c37c2417c86c9a2d9d27266fe37f.tar.bz2 otp-d8afbc245f28c37c2417c86c9a2d9d27266fe37f.zip |
Suppress warnings from v3_kernel when inlining is turned on
v3_kernel may produce unwanted and confusing warnings for code that
has been inlined with the new inliner (cerl_inline). Consider this
code:
-compile(inline).
compute1(X) ->
add(X, 0).
compute2(X, Y) ->
add(X, Y).
add(1, 0) ->
1;
add(1, Y) -> %% "this clause cannot match..."
1 + Y;
add(X, Y) ->
X + Y.
v3_kernel warns because add/2 has been inlined into compute1/1 and only
the first clause in add/2 will match. But the other clauses are needed
when add/2 is inlined into compute2/2, so the user cannot do anything
to eliminate the warning (short of manually inlining add/2, defeating the
purpose of the 'inline' option).
The warning would be reasonable if compute2/2 didn't exist, but it would
be too complicated for the compiler to figure whether a warning make
sense or not.
Therefore, suppress all warnings generated by v3_kernel if cerl_inline
has been run.
ERL-301
Diffstat (limited to 'erts/emulator/beam')
0 files changed, 0 insertions, 0 deletions