Index: otp/lib/hipe/icode/hipe_icode_type.erl diff -u otp/lib/hipe/icode/hipe_icode_type.erl:1.131 otp/lib/hipe/icode/hipe_icode_type.erl:1.132 --- otp/lib/hipe/icode/hipe_icode_type.erl:1.131 Sun Mar 20 18:49:34 2005 +++ otp/lib/hipe/icode/hipe_icode_type.erl Tue Mar 29 17:25:42 2005 @@ -1213,12 +1213,7 @@ enter(Key, Value, Tree)-> case hipe_icode:is_var(Key) of true -> - case t_is_none(Value) of - true -> - Tree; - false -> - enter_to_leaf(Key, Value, Tree) - end; + enter_to_leaf(Key, Value, Tree); false -> Tree end. @@ -1232,10 +1227,20 @@ true-> enter_to_leaf(Val, Value, Tree); false -> - gb_trees:enter(Key, Value, Tree) + case t_is_none(Value) of + true -> + gb_trees:delete(Key, Tree); + false -> + gb_trees:enter(Key, Value, Tree) + end end; none -> - gb_trees:insert(Key, Value, Tree) + case t_is_none(Value) of + true -> + Tree; + false -> + gb_trees:insert(Key, Value, Tree) + end end. empty()-> @@ -1704,24 +1710,30 @@ warn_on_control_flow([Label|Left], State, IcodeFun) -> I = hipe_bb:last(state__bb(State, Label)), Info = state__info_out(State, Label), - case hipe_icode:type(I) of - 'if' -> - warn_on_if(I, Info, IcodeFun); - switch_tuple_arity -> - warn_on_switch_tuple_arity(I, Info, IcodeFun); - switch_val -> - warn_on_switch_val(I, Info, IcodeFun); - type -> - warn_on_type(I, Info, IcodeFun, State); - call -> - case hipe_icode:call_in_guard(I) of - true -> - warn_on_call(I, Info, IcodeFun); - false -> + case any_is_none(lookup_list(args(I), Info)) of + true -> + %% Try to avoid follow-up warnings. + ok; + false -> + case hipe_icode:type(I) of + 'if' -> + warn_on_if(I, Info, IcodeFun); + switch_tuple_arity -> + warn_on_switch_tuple_arity(I, Info, IcodeFun); + switch_val -> + warn_on_switch_val(I, Info, IcodeFun); + type -> + warn_on_type(I, Info, IcodeFun, State); + call -> + case hipe_icode:call_in_guard(I) of + true -> + warn_on_call(I, Info, IcodeFun); + false -> + ok + end; + _ -> ok - end; - _ -> - ok + end end, warn_on_control_flow(Left, State, IcodeFun); warn_on_control_flow([], _State, _IcodeFun) -> @@ -1968,7 +1980,8 @@ false -> Fun = hipe_icode:call_fun(I), Args = safe_lookup_list(hipe_icode:call_args(I), Info), - case check_for_tuple_as_fun(Fun, Args) of + case (hipe_icode:call_type(I) =/= primop) andalso + check_for_tuple_as_fun(Fun, Args) of true -> W = io_lib:format("~w: Unsafe use of tuple as a fun" " in call to ~w\n", [IcodeFun, Fun]), @@ -1983,7 +1996,8 @@ true -> Fun = hipe_icode:enter_fun(I), Args = safe_lookup_list(hipe_icode:enter_args(I), Info), - case check_for_tuple_as_fun(Fun, Args) of + case (hipe_icode:enter_type(I) =/= primop) andalso + check_for_tuple_as_fun(Fun, Args) of true -> W = io_lib:format("~w: Unsafe use of tuple as a fun in call " "to ~w\n", [IcodeFun, Fun]), @@ -2384,7 +2398,7 @@ SigArgTypes = t_fun_args(Sig), case t_is_any(SigArgTypes) of true -> - t_fun_range(PltSig); + t_fun_range(Sig); false -> case any_is_none(t_inf_lists(ArgTypes, SigArgTypes)) of true -> t_none();