aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/dist.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-03-15 07:55:44 +0100
committerBjörn Gustavsson <[email protected]>2011-03-25 11:02:11 +0100
commitc6b0d6dce5709c61e549e850c2615fd288e27ba9 (patch)
treed2fda98512c2f42e83b374d6489dd8670a2b852a /erts/emulator/beam/dist.c
parent40a96ab9a41b780d59da643cce71084e72901a54 (diff)
downloadotp-c6b0d6dce5709c61e549e850c2615fd288e27ba9.tar.gz
otp-c6b0d6dce5709c61e549e850c2615fd288e27ba9.tar.bz2
otp-c6b0d6dce5709c61e549e850c2615fd288e27ba9.zip
sys_core_fold: Eliminate incorrect warning
The compiler (sys_core_fold) tries to avoid constructing tuples in case expressions. The following code: c(A, B) -> case {A,B} of {ok,X} -> X; {_,_} -> error end. will be rewritten so that no tuple is built. If a clause requires a tuple to be built as in this code: c(A, B) -> case {A,B} of {ok,X} -> X; V -> V %The tuple will be built here end. the tuple will be built in the clause(s) in which it is needed. If the value returned from the case is not used as in this code: c(A, B) -> case {A,B} of V -> V %Warning: a term is constructed, but never used end, ok. there will be an incorrect warning. Basically, what happens is that the code is reduced to: c(A, B) -> {A,B}, %Warning: a term is constructed, but never used ok. and the optimizer sees that the {A,B} tuple can't possibly be used. Eliminate the warning by adding a 'compiler_generated' annotation to the tuple. Reported-by: Kostis Sagonas
Diffstat (limited to 'erts/emulator/beam/dist.c')
0 files changed, 0 insertions, 0 deletions