diff --git a/compiler/hlds_out.m b/compiler/hlds_out.m index d78ddfe63..7f10191ec 100644 --- a/compiler/hlds_out.m +++ b/compiler/hlds_out.m @@ -230,7 +230,8 @@ hlds_out__write_pred(Indent, PredId, PredInfo) --> { ClausesInfo = clauses_info(VarSet, VarTypes, HeadVars, Clauses) }, hlds_out__write_var_types(Indent, VarSet, VarTypes, TVarSet), hlds_out__write_clauses(Indent, PredId, VarSet, HeadVars, Clauses), - hlds_out__write_procs(Indent, PredId, Imported, ProcTable). + hlds_out__write_procs(Indent, PredId, Imported, ProcTable), + io__write_string("\n"). :- pred hlds_out__write_clauses(int, pred_id, varset, list(var), list(clause), io__state, io__state). @@ -571,24 +572,21 @@ hlds_out__write_var_types_2([Var | Vars], Indent, VarSet, VarTypes, TypeVarSet) hlds_out__write_types(Indent, _X) --> hlds_out__write_indent(Indent), - % XXX - io__write_string("\n"). + io__write_string("% types (sorry, output of types not implemented)\n"). :- pred hlds_out__write_insts(int, inst_table, io__state, io__state). :- mode hlds_out__write_insts(in, in, in, out). hlds_out__write_insts(Indent, _X) --> hlds_out__write_indent(Indent), - % XXX - io__write_string("\n"). + io__write_string("% insts (sorry, output of insts not implemented)\n"). :- pred hlds_out__write_modes(int, mode_table, io__state, io__state). :- mode hlds_out__write_modes(in, in, in, out). hlds_out__write_modes(Indent, _X) --> hlds_out__write_indent(Indent), - % XXX - io__write_string("\n"). + io__write_string("% modes (sorry, output of modes not implemented)\n"). :- pred hlds_out__write_mode_list(int, list(mode), io__state, io__state). :- mode hlds_out__write_mode_list(in, in, in, out). diff --git a/compiler/mode_info.m b/compiler/mode_info.m index ea9f4a062..a84c7eb75 100644 --- a/compiler/mode_info.m +++ b/compiler/mode_info.m @@ -163,6 +163,35 @@ :- pred mode_info_set_delay_info(delay_info, mode_info, mode_info). :- mode mode_info_set_delay_info(in, mode_info_di, mode_info_uo) is det. +:- inst uniq_mode_info = bound_unique( + mode_info( + ground_unique, ground, + ground, ground, ground, ground, + ground, ground, ground, ground, + ground + ) + ). + +:- mode mode_info_uo :: free -> uniq_mode_info. +:- mode mode_info_ui :: uniq_mode_info -> uniq_mode_info. +:- mode mode_info_di :: uniq_mode_info -> dead. + + % Some fiddly modes used when we want to extract + % the io_state from a mode_info struct and then put it back again. + +:- inst mode_info_no_io = bound_unique( + mode_info( + dead, ground, + ground, ground, ground, ground, + ground, ground, ground, ground, + ground + ) + ). + +:- mode mode_info_get_io_state :: uniq_mode_info -> mode_info_no_io. +:- mode mode_info_no_io :: mode_info_no_io -> mode_info_no_io. +:- mode mode_info_set_io_state :: mode_info_no_io -> dead. + %-----------------------------------------------------------------------------% %-----------------------------------------------------------------------------% @@ -195,35 +224,6 @@ % the io_state and the struct itself unique, but with % multiple references allowed for the other parts. -:- inst uniq_mode_info = bound_unique( - mode_info( - ground_unique, ground, - ground, ground, ground, ground, - ground, ground, ground, ground, - ground - ) - ). - -:- mode mode_info_uo :: free -> uniq_mode_info. -:- mode mode_info_ui :: uniq_mode_info -> uniq_mode_info. -:- mode mode_info_di :: uniq_mode_info -> dead. - - % Some fiddly modes used when we want to extract - % the io_state from a mode_info struct and then put it back again. - -:- inst mode_info_no_io = bound_unique( - mode_info( - dead, ground, - ground, ground, ground, ground, - ground, ground, ground, ground, - ground - ) - ). - -:- mode mode_info_get_io_state :: uniq_mode_info -> mode_info_no_io. -:- mode mode_info_no_io :: mode_info_no_io -> mode_info_no_io. -:- mode mode_info_set_io_state :: mode_info_no_io -> dead. - %-----------------------------------------------------------------------------% % Initialize the mode_info diff --git a/compiler/switch_detection.m b/compiler/switch_detection.m index 5a61c5711..2acd7da4a 100644 --- a/compiler/switch_detection.m +++ b/compiler/switch_detection.m @@ -219,14 +219,12 @@ partition_disj_2([Goal | Goals], Var, Cases0, Cases) :- :- mode find_unify_var_functor(in, in, out) is semidet. find_unify_var_functor([Goal - _GoalInfo | Goals], Var, Functor) :- - ( Goal = unify(term__variable(Var0), term__functor(Name, Args, _), + ( Goal = unify(term__variable(Var), term__functor(Name, Args, _), _, _, _) -> - Var = Var0, list__length(Args, Arity), make_functor_cons_id(Name, Arity, Functor) - ; Goal = unify(term__functor(Name, Args, _), term__variable(Var0), + ; Goal = unify(term__functor(Name, Args, _), term__variable(Var), _, _, _) -> - Var = Var0, list__length(Args, Arity), make_functor_cons_id(Name, Arity, Functor) ; Goal = unify(_, _, _, _, _) ->