aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/aclocal.m45
-rw-r--r--erts/emulator/Makefile.in10
-rw-r--r--lib/hipe/cerl/erl_bif_types.erl26
3 files changed, 21 insertions, 20 deletions
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 5daaa0ae5b..27f643921e 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -125,6 +125,9 @@ AC_DEFUN(LM_FIND_EMU_CC,
ac_cv_prog_emu_cc,
[
AC_TRY_COMPILE([],[
+#ifdef __llvm__
+#error "llvm is currently unable to compile beam_emu.c"
+#endif
__label__ lbl1;
__label__ lbl2;
int x = magic();
@@ -140,7 +143,7 @@ lbl2:
],ac_cv_prog_emu_cc=$CC,ac_cv_prog_emu_cc=no)
if test $ac_cv_prog_emu_cc = no; then
- for ac_progname in emu_cc.sh gcc; do
+ for ac_progname in emu_cc.sh gcc-4.2 gcc; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in
index 1ecda6bfa2..6cd9be5680 100644
--- a/erts/emulator/Makefile.in
+++ b/erts/emulator/Makefile.in
@@ -600,11 +600,6 @@ INCLUDES += -I$(ERL_TOP)/erts/etc/vxworks
endif
ifeq ($(TARGET),win32)
-# Usually the same as the default rule, but certain platforms (i.e. win32) mix
-# different compilers
-$(OBJDIR)/beam_emu.o: beam/beam_emu.c
- $(EMU_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
-
$(OBJDIR)/dll_sys.o: sys/$(ERLANG_OSTYPE)/sys.c
$(CC) $(CFLAGS) -DERL_RUN_SHARED_LIB=1 $(INCLUDES) -c $< -o $@
@@ -618,6 +613,11 @@ $(OBJDIR)/beam_emu.o: beam/beam_emu.c
$(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) \
-OPT:Olimit=0 -WOPT:lpre=off:spre=off:epre=off \
$(INCLUDES) -c $< -o $@
+else
+# Usually the same as the default rule, but certain platforms (e.g. win32) mix
+# different compilers
+$(OBJDIR)/beam_emu.o: beam/beam_emu.c
+ $(EMU_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
endif
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index 591b88e04a..1483b2aee1 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -2328,10 +2328,7 @@ type(lists, keyfind, 3, Xs) ->
case t_tuple_subtypes(Tuple) of
unknown -> Ret;
List ->
- Keys = [type(erlang, element, 2, [Y, S])
- || S <- List],
- Infs = [t_inf(Key, X) || Key <- Keys],
- case all_is_none(Infs) of
+ case key_comparisons_fail(X, Y, List) of
true -> t_atom('false');
false -> Ret
end
@@ -2361,9 +2358,7 @@ type(lists, keymember, 3, Xs) ->
case t_tuple_subtypes(Tuple) of
unknown -> t_boolean();
List ->
- Keys = [type(erlang, element, 2, [Y,S]) || S <- List],
- Infs = [t_inf(Key, X) || Key <- Keys],
- case all_is_none(Infs) of
+ case key_comparisons_fail(X, Y, List) of
true -> t_atom('false');
false -> t_boolean()
end
@@ -2393,10 +2388,7 @@ type(lists, keysearch, 3, Xs) ->
case t_tuple_subtypes(Tuple) of
unknown -> Ret;
List ->
- Keys = [type(erlang, element, 2, [Y, S])
- || S <- List],
- Infs = [t_inf(Key, X) || Key <- Keys],
- case all_is_none(Infs) of
+ case key_comparisons_fail(X, Y, List) of
true -> t_atom('false');
false -> Ret
end
@@ -2824,9 +2816,6 @@ list_replace(1, E, [_X | Xs]) ->
any_is_none_or_unit(Ts) ->
lists:any(fun erl_types:t_is_none_or_unit/1, Ts).
-all_is_none(Ts) ->
- lists:all(fun erl_types:t_is_none/1, Ts).
-
check_guard([X], Test, Type) ->
check_guard_single(X, Test, Type).
@@ -3221,6 +3210,15 @@ type_order() ->
[t_number(), t_atom(), t_reference(), t_fun(), t_port(), t_pid(), t_tuple(),
t_list(), t_binary()].
+key_comparisons_fail(X0, KeyPos, TupleList) ->
+ X = case t_is_number(t_inf(X0, t_number())) of
+ false -> X0;
+ true -> t_number()
+ end,
+ lists:all(fun(Tuple) ->
+ Key = type(erlang, element, 2, [KeyPos, Tuple]),
+ t_is_none(t_inf(Key, X))
+ end, TupleList).
%%=============================================================================