diff --git a/compiler/abstract_mode_constraints.m b/compiler/abstract_mode_constraints.m index f84ec907c..7c4a283dc 100644 --- a/compiler/abstract_mode_constraints.m +++ b/compiler/abstract_mode_constraints.m @@ -20,7 +20,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module parse_tree. diff --git a/compiler/accumulator.m b/compiler/accumulator.m index 7f29afcc6..3e66e4983 100644 --- a/compiler/accumulator.m +++ b/compiler/accumulator.m @@ -148,6 +148,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module io. :- import_module univ. diff --git a/compiler/add_class.m b/compiler/add_class.m index 420ba04b6..083338571 100644 --- a/compiler/add_class.m +++ b/compiler/add_class.m @@ -45,6 +45,7 @@ :- import_module hlds.make_hlds.add_pred. :- import_module hlds.make_hlds.state_var. :- import_module hlds.make_hlds_error. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/add_clause.m b/compiler/add_clause.m index c11c2b63b..44995fe4a 100644 --- a/compiler/add_clause.m +++ b/compiler/add_clause.m @@ -12,8 +12,8 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.make_hlds.qual_info. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. @@ -65,6 +65,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.make_goal. :- import_module hlds.make_hlds.add_pred. diff --git a/compiler/add_foreign_proc.m b/compiler/add_foreign_proc.m index 4d747550c..2b8497a6f 100644 --- a/compiler/add_foreign_proc.m +++ b/compiler/add_foreign_proc.m @@ -43,10 +43,12 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.make_hlds.add_pred. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module libs. diff --git a/compiler/add_heap_ops.m b/compiler/add_heap_ops.m index a2f8126a8..cbbd155ad 100644 --- a/compiler/add_heap_ops.m +++ b/compiler/add_heap_ops.m @@ -34,7 +34,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- pred add_heap_ops(module_info::in, proc_info::in, proc_info::out) is det. diff --git a/compiler/add_pragma_decl.m b/compiler/add_pragma_decl.m index 62a7a3db7..771e8ec84 100644 --- a/compiler/add_pragma_decl.m +++ b/compiler/add_pragma_decl.m @@ -81,11 +81,13 @@ :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_hlds.add_pragma_type_spec. :- import_module hlds.make_hlds.add_pragma_type_spec_constr. :- import_module hlds.make_hlds.add_pragma_util. :- import_module hlds.make_hlds_error. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module mdbcomp. diff --git a/compiler/add_pragma_gen.m b/compiler/add_pragma_gen.m index ad4584cb2..1e2442528 100644 --- a/compiler/add_pragma_gen.m +++ b/compiler/add_pragma_gen.m @@ -45,7 +45,9 @@ :- implementation. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_hlds.add_pragma_util. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module mdbcomp. diff --git a/compiler/add_pragma_impl.m b/compiler/add_pragma_impl.m index a2dc75caa..f4854f47b 100644 --- a/compiler/add_pragma_impl.m +++ b/compiler/add_pragma_impl.m @@ -61,11 +61,13 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_hlds.add_foreign_proc. :- import_module hlds.make_hlds.add_pragma_tabling. :- import_module hlds.make_hlds.add_pragma_util. :- import_module hlds.make_hlds.make_hlds_warn. :- import_module hlds.make_hlds_error. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.status. diff --git a/compiler/add_pragma_tabling.m b/compiler/add_pragma_tabling.m index b8644be28..b55632103 100644 --- a/compiler/add_pragma_tabling.m +++ b/compiler/add_pragma_tabling.m @@ -35,12 +35,14 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_hlds.add_clause. :- import_module hlds.make_hlds.add_foreign_proc. :- import_module hlds.make_hlds.add_pred. :- import_module hlds.make_hlds_error. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/add_pragma_type_spec.m b/compiler/add_pragma_type_spec.m index ada01489d..60c3149c9 100644 --- a/compiler/add_pragma_type_spec.m +++ b/compiler/add_pragma_type_spec.m @@ -34,10 +34,12 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.make_hlds_error. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/add_pragma_util.m b/compiler/add_pragma_util.m index 992437fc4..a855369bb 100644 --- a/compiler/add_pragma_util.m +++ b/compiler/add_pragma_util.m @@ -18,7 +18,9 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_hlds_error. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module mdbcomp. diff --git a/compiler/add_pred.m b/compiler/add_pred.m index 7fb9132cf..5c3b75ee6 100644 --- a/compiler/add_pred.m +++ b/compiler/add_pred.m @@ -19,9 +19,9 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. @@ -102,6 +102,7 @@ :- import_module hlds.hlds_args. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.make_hlds.check_field_access_functions. :- import_module hlds.make_hlds_error. diff --git a/compiler/add_special_pred.m b/compiler/add_special_pred.m index e6ea80f53..5b204ac0d 100644 --- a/compiler/add_special_pred.m +++ b/compiler/add_special_pred.m @@ -20,7 +20,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. @@ -102,6 +102,7 @@ :- import_module check_hlds.unify_proc. :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. diff --git a/compiler/add_trail_ops.m b/compiler/add_trail_ops.m index 9b5fc9a07..2132044e9 100644 --- a/compiler/add_trail_ops.m +++ b/compiler/add_trail_ops.m @@ -56,7 +56,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module libs. :- import_module libs.optimization_options. diff --git a/compiler/analysis.file.m b/compiler/analysis.file.m index 91aa672c2..0e26f67b9 100644 --- a/compiler/analysis.file.m +++ b/compiler/analysis.file.m @@ -132,7 +132,7 @@ :- implementation. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs.options. :- import_module libs.pickle. :- import_module mdbcomp.prim_data. diff --git a/compiler/analysis.framework.m b/compiler/analysis.framework.m index 4cc39a374..0273d807c 100644 --- a/compiler/analysis.framework.m +++ b/compiler/analysis.framework.m @@ -25,7 +25,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. diff --git a/compiler/arg_info.m b/compiler/arg_info.m index 5f81e0462..a27740df6 100644 --- a/compiler/arg_info.m +++ b/compiler/arg_info.m @@ -32,7 +32,7 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_info_types. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -140,7 +140,9 @@ :- implementation. +:- import_module hlds.hlds_pred. :- import_module hlds.mode_top_functor. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/assertion.m b/compiler/assertion.m index ba141cc71..51f91c908 100644 --- a/compiler/assertion.m +++ b/compiler/assertion.m @@ -21,8 +21,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_promise. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.set_of_var. @@ -179,6 +179,7 @@ :- import_module hlds.goal_refs. :- import_module hlds.hlds_clauses. +:- import_module hlds.hlds_pred. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. diff --git a/compiler/base_typeclass_info.m b/compiler/base_typeclass_info.m index 8a3ca1bb0..8cadf894f 100644 --- a/compiler/base_typeclass_info.m +++ b/compiler/base_typeclass_info.m @@ -45,9 +45,9 @@ :- import_module backend_libs.type_class_info. :- import_module hlds.hlds_class. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module parse_tree. :- import_module parse_tree.prog_data. diff --git a/compiler/build_mode_constraints.m b/compiler/build_mode_constraints.m index fc8daa75a..b7fc24a8a 100644 --- a/compiler/build_mode_constraints.m +++ b/compiler/build_mode_constraints.m @@ -25,6 +25,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module parse_tree. @@ -191,6 +192,7 @@ :- import_module hlds.hlds_args. :- import_module hlds.hlds_clauses. +:- import_module hlds.hlds_proc. :- import_module hlds.inst_test. :- import_module hlds.mode_util. :- import_module hlds.var_table_hlds. diff --git a/compiler/builtin_ops.m b/compiler/builtin_ops.m index 80f902c43..f3cb29039 100644 --- a/compiler/builtin_ops.m +++ b/compiler/builtin_ops.m @@ -21,7 +21,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. diff --git a/compiler/call_gen.m b/compiler/call_gen.m index 7ade338fa..5ec49e72f 100644 --- a/compiler/call_gen.m +++ b/compiler/call_gen.m @@ -21,8 +21,8 @@ :- import_module hlds. :- import_module hlds.code_model. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module ll_backend.code_info. @@ -79,6 +79,7 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. :- import_module hlds.instmap. :- import_module libs.options. :- import_module ll_backend.code_util. diff --git a/compiler/check_pragma_format_call.m b/compiler/check_pragma_format_call.m index 301dbd137..b50ec5651 100644 --- a/compiler/check_pragma_format_call.m +++ b/compiler/check_pragma_format_call.m @@ -39,7 +39,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. @@ -58,6 +58,8 @@ :- implementation. :- import_module hlds.hlds_error_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_test. :- import_module hlds.pred_info_types. :- import_module hlds.status. diff --git a/compiler/check_promise.m b/compiler/check_promise.m index bfba1ee3c..026508fd2 100644 --- a/compiler/check_promise.m +++ b/compiler/check_promise.m @@ -40,6 +40,7 @@ :- import_module hlds.hlds_promise. :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. diff --git a/compiler/check_typeclass.m b/compiler/check_typeclass.m index 9ba975e58..102101b96 100644 --- a/compiler/check_typeclass.m +++ b/compiler/check_typeclass.m @@ -140,10 +140,12 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_hlds.instance_method_clauses. :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.status. diff --git a/compiler/clause_to_proc.m b/compiler/clause_to_proc.m index f8892a5af..d6636f7ca 100644 --- a/compiler/clause_to_proc.m +++ b/compiler/clause_to_proc.m @@ -13,6 +13,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module list. @@ -107,7 +109,7 @@ copy_clauses_to_maybe_imported_proc_in_proc_info(PredInfo, ClausesInfo, pred_info_is_imported(PredInfo) ; pred_info_is_pseudo_imported(PredInfo), - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) ) then % We need to set these fields in the proc_info here, because @@ -255,7 +257,7 @@ select_matching_clauses(PredInfo, ProcId, Clauses, MatchingClauses) :- ( if Origin = origin_compiler(made_for_uci(spec_pred_unify, _TypeCtor)) then - ( if hlds_pred.in_in_unification_proc_id(ProcId) then + ( if in_in_unification_proc_id(ProcId) then MaybeInInMode = in_in_mode else MaybeInInMode = not_in_in_mode diff --git a/compiler/closure_analysis.m b/compiler/closure_analysis.m index 1c51f7f52..71c2da989 100644 --- a/compiler/closure_analysis.m +++ b/compiler/closure_analysis.m @@ -39,8 +39,10 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_test. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.dependency_graph. :- import_module libs.globals. diff --git a/compiler/closure_gen.m b/compiler/closure_gen.m index 2785a29f3..96ba08120 100644 --- a/compiler/closure_gen.m +++ b/compiler/closure_gen.m @@ -17,7 +17,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module ll_backend.code_info. :- import_module ll_backend.code_loc_dep. :- import_module ll_backend.llds. @@ -44,6 +44,8 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.pred_info_types. :- import_module hlds.type_classify. diff --git a/compiler/code_gen.m b/compiler/code_gen.m index 1501b079b..14fe47c72 100644 --- a/compiler/code_gen.m +++ b/compiler/code_gen.m @@ -47,7 +47,7 @@ :- import_module hlds.goal_form. :- import_module hlds.hlds_desc. :- import_module hlds.hlds_markers. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. :- import_module hlds.proc_info_types. :- import_module libs. diff --git a/compiler/code_info.m b/compiler/code_info.m index 4e55047e3..62f261b49 100644 --- a/compiler/code_info.m +++ b/compiler/code_info.m @@ -32,7 +32,9 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module libs.optimization_options. diff --git a/compiler/code_loc_dep.m b/compiler/code_loc_dep.m index b95f9597f..a32b36e61 100644 --- a/compiler/code_loc_dep.m +++ b/compiler/code_loc_dep.m @@ -74,7 +74,7 @@ :- import_module backend_libs.builtin_ops. :- import_module hlds.arg_info. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module libs.globals. diff --git a/compiler/code_model.m b/compiler/code_model.m index b57d489e0..85a5c726e 100644 --- a/compiler/code_model.m +++ b/compiler/code_model.m @@ -24,7 +24,7 @@ :- interface. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree. :- import_module parse_tree.prog_data. diff --git a/compiler/code_util.m b/compiler/code_util.m index 4912bcf1d..09b61540a 100644 --- a/compiler/code_util.m +++ b/compiler/code_util.m @@ -19,9 +19,10 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.optimization_options. :- import_module ll_backend.llds. diff --git a/compiler/common.m b/compiler/common.m index 7724f3857..9b38ff848 100644 --- a/compiler/common.m +++ b/compiler/common.m @@ -98,7 +98,7 @@ :- import_module check_hlds.simplify.simplify_tasks. :- import_module hlds. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -166,6 +166,8 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.inst_match. :- import_module hlds.inst_test. diff --git a/compiler/complexity.m b/compiler/complexity.m index 65e0130c3..27dab18e7 100644 --- a/compiler/complexity.m +++ b/compiler/complexity.m @@ -20,7 +20,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module io. :- import_module maybe. @@ -65,6 +66,7 @@ :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.mode_test. diff --git a/compiler/continuation_info.m b/compiler/continuation_info.m index b0d073f47..3a72e1321 100644 --- a/compiler/continuation_info.m +++ b/compiler/continuation_info.m @@ -56,9 +56,11 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/coverage_profiling.m b/compiler/coverage_profiling.m index aec22c2e7..8fc3fbe89 100644 --- a/compiler/coverage_profiling.m +++ b/compiler/coverage_profiling.m @@ -19,7 +19,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. diff --git a/compiler/cse_detection.m b/compiler/cse_detection.m index 12fd7afe5..c740547eb 100644 --- a/compiler/cse_detection.m +++ b/compiler/cse_detection.m @@ -80,7 +80,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module io. @@ -103,6 +103,8 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.inst_test. diff --git a/compiler/ctgc.livedata.m b/compiler/ctgc.livedata.m index aab93ffc0..0b11dbf6f 100644 --- a/compiler/ctgc.livedata.m +++ b/compiler/ctgc.livedata.m @@ -23,7 +23,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_data_pragma. diff --git a/compiler/ctgc.util.m b/compiler/ctgc.util.m index 160a74f44..b005f55fe 100644 --- a/compiler/ctgc.util.m +++ b/compiler/ctgc.util.m @@ -20,6 +20,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.set_of_var. @@ -101,6 +102,7 @@ :- implementation. +:- import_module hlds.hlds_proc. :- import_module hlds.status. :- import_module hlds.type_classify. :- import_module parse_tree.prog_type. diff --git a/compiler/dead_proc_elim.m b/compiler/dead_proc_elim.m index f1b0aa116..78c51cf45 100644 --- a/compiler/dead_proc_elim.m +++ b/compiler/dead_proc_elim.m @@ -25,7 +25,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. @@ -191,6 +191,8 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.introduced_call_table. :- import_module hlds.make_goal. :- import_module hlds.passes_aux. @@ -1113,7 +1115,7 @@ dead_proc_eliminate_pred(ElimOptImported, PredId, !ProcElimInfo) :- KeepAnyProc = no ; PredStatus = pred_status(status_pseudo_exported), - hlds_pred.in_in_unification_proc_id(InitProcId), + in_in_unification_proc_id(InitProcId), KeepAnyProc = yes(InitProcId) ) then diff --git a/compiler/deep_profiling.m b/compiler/deep_profiling.m index 426b50588..6bdc83ba6 100644 --- a/compiler/deep_profiling.m +++ b/compiler/deep_profiling.m @@ -22,7 +22,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.var_table. @@ -32,6 +32,8 @@ :- import_module list. :- import_module maybe. +%-----------------------------------------------------------------------------% + :- pred apply_deep_profiling_transform(io.text_output_stream::in, module_info::in, module_info::out) is det. @@ -72,6 +74,8 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. diff --git a/compiler/default_func_mode.m b/compiler/default_func_mode.m index b4757c2cd..2f870ebba 100644 --- a/compiler/default_func_mode.m +++ b/compiler/default_func_mode.m @@ -11,6 +11,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module list. diff --git a/compiler/deforest.m b/compiler/deforest.m index 8df925f81..2aa357c78 100644 --- a/compiler/deforest.m +++ b/compiler/deforest.m @@ -62,11 +62,13 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_test. :- import_module hlds.instmap. :- import_module hlds.mode_util. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.var_table_hlds. diff --git a/compiler/delay_construct.m b/compiler/delay_construct.m index 6f7bfd990..c011f3de7 100644 --- a/compiler/delay_construct.m +++ b/compiler/delay_construct.m @@ -30,7 +30,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module io. @@ -45,6 +46,7 @@ :- implementation. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.inst_test. diff --git a/compiler/delay_partial_inst.m b/compiler/delay_partial_inst.m index 59110c1f3..bc9d4bc6a 100644 --- a/compiler/delay_partial_inst.m +++ b/compiler/delay_partial_inst.m @@ -116,7 +116,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module io. :- import_module list. @@ -136,6 +136,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_test. :- import_module hlds.instmap. diff --git a/compiler/dep_par_conj.m b/compiler/dep_par_conj.m index 73a6ee499..ee938f9fc 100644 --- a/compiler/dep_par_conj.m +++ b/compiler/dep_par_conj.m @@ -142,11 +142,13 @@ :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_test. :- import_module hlds.instmap. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. diff --git a/compiler/det_analysis.m b/compiler/det_analysis.m index 038f1760d..37d2fd526 100644 --- a/compiler/det_analysis.m +++ b/compiler/det_analysis.m @@ -51,7 +51,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module parse_tree. @@ -110,6 +110,8 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.passes_aux. @@ -484,7 +486,7 @@ determinism_declarations_procs(PredId, PredInfo, [ProcId | ProcIds], % ourselves, they do not need to be checked. ( pred_info_is_pseudo_imported(PredInfo), - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) ; pred_info_get_markers(PredInfo, Markers), marker_is_present(Markers, marker_class_method) diff --git a/compiler/det_check_goal.m b/compiler/det_check_goal.m index 5111e3d7d..47b43e0f2 100644 --- a/compiler/det_check_goal.m +++ b/compiler/det_check_goal.m @@ -70,6 +70,7 @@ :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_pred. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.maybe_util. :- import_module mdbcomp. diff --git a/compiler/det_check_proc.m b/compiler/det_check_proc.m index 0efd18fbd..b37f115c7 100644 --- a/compiler/det_check_proc.m +++ b/compiler/det_check_proc.m @@ -24,7 +24,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. @@ -80,6 +80,8 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.mode_test. diff --git a/compiler/det_check_switch.m b/compiler/det_check_switch.m index 0b68330df..5c42d0685 100644 --- a/compiler/det_check_switch.m +++ b/compiler/det_check_switch.m @@ -187,7 +187,6 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. -:- import_module hlds.hlds_pred. :- import_module hlds.inst_test. :- import_module hlds.mode_util. :- import_module libs. diff --git a/compiler/det_infer_goal.m b/compiler/det_infer_goal.m index 63701c6ac..e398c05cc 100644 --- a/compiler/det_infer_goal.m +++ b/compiler/det_infer_goal.m @@ -73,8 +73,10 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.maybe_util. diff --git a/compiler/det_util.m b/compiler/det_util.m index 6ad2578ec..969690fa0 100644 --- a/compiler/det_util.m +++ b/compiler/det_util.m @@ -24,6 +24,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. diff --git a/compiler/direct_arg_in_out.m b/compiler/direct_arg_in_out.m index ff0b85c01..a029216a5 100644 --- a/compiler/direct_arg_in_out.m +++ b/compiler/direct_arg_in_out.m @@ -152,7 +152,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. @@ -204,6 +204,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.inst_lookup. diff --git a/compiler/distance_granularity.m b/compiler/distance_granularity.m index 7d4ee96a4..cf233ff50 100644 --- a/compiler/distance_granularity.m +++ b/compiler/distance_granularity.m @@ -135,10 +135,12 @@ :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.make_goal. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. diff --git a/compiler/equiv_type_hlds.m b/compiler/equiv_type_hlds.m index 53ec4277e..a047f4e0e 100644 --- a/compiler/equiv_type_hlds.m +++ b/compiler/equiv_type_hlds.m @@ -41,8 +41,10 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module hlds.type_classify. diff --git a/compiler/exception_analysis.m b/compiler/exception_analysis.m index 2a53b6632..6663d7cf8 100644 --- a/compiler/exception_analysis.m +++ b/compiler/exception_analysis.m @@ -86,7 +86,7 @@ :- import_module analysis.operations. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data_pragma. @@ -126,6 +126,8 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_name. :- import_module hlds.proc_info_types. :- import_module hlds.type_classify. diff --git a/compiler/export.m b/compiler/export.m index bdb50275d..9b5232124 100644 --- a/compiler/export.m +++ b/compiler/export.m @@ -94,7 +94,9 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/fact_table_gen.m b/compiler/fact_table_gen.m index 4eb95bbf1..8db58171a 100644 --- a/compiler/fact_table_gen.m +++ b/compiler/fact_table_gen.m @@ -55,6 +55,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. @@ -1545,7 +1547,7 @@ write_fact_table_arrays(MaybeProgressStream, OutputStream, FactTableSize, ProcFiles = [], HeaderCode = "", % This won't get used anyway. - PrimaryProcId = hlds_pred.initial_proc_id + PrimaryProcId = initial_proc_id ; ProcFiles = [PrimaryProcId - FileName | TailProcFiles], ( diff --git a/compiler/find_bind_var.m b/compiler/find_bind_var.m index 9121b73c9..eff281bb7 100644 --- a/compiler/find_bind_var.m +++ b/compiler/find_bind_var.m @@ -65,7 +65,6 @@ :- import_module check_hlds.det_util. :- import_module hlds.hlds_markers. -:- import_module hlds.hlds_pred. :- import_module mdbcomp. :- import_module map. diff --git a/compiler/float_regs.m b/compiler/float_regs.m index 723f7a17a..3e124dc97 100644 --- a/compiler/float_regs.m +++ b/compiler/float_regs.m @@ -155,6 +155,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_lookup. :- import_module hlds.inst_test. @@ -163,6 +164,7 @@ :- import_module hlds.mode_util. :- import_module hlds.passes_aux. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.quantification. :- import_module hlds.type_util. :- import_module hlds.var_table_hlds. diff --git a/compiler/follow_code.m b/compiler/follow_code.m index 5285657f2..043f85b32 100644 --- a/compiler/follow_code.m +++ b/compiler/follow_code.m @@ -34,7 +34,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. %-----------------------------------------------------------------------------% diff --git a/compiler/follow_vars.m b/compiler/follow_vars.m index bb96fd028..6a39d3642 100644 --- a/compiler/follow_vars.m +++ b/compiler/follow_vars.m @@ -35,7 +35,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree. :- import_module parse_tree.var_table. @@ -56,8 +56,10 @@ :- import_module hlds.arg_info. :- import_module hlds.code_model. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module ll_backend.call_gen. :- import_module parse_tree.prog_data. diff --git a/compiler/foreign_proc_gen.m b/compiler/foreign_proc_gen.m index e5c5e05d3..c992915a9 100644 --- a/compiler/foreign_proc_gen.m +++ b/compiler/foreign_proc_gen.m @@ -27,7 +27,7 @@ :- import_module hlds. :- import_module hlds.code_model. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module ll_backend.code_info. :- import_module ll_backend.code_loc_dep. :- import_module ll_backend.llds. @@ -69,6 +69,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. :- import_module hlds.instmap. :- import_module hlds.mode_top_functor. :- import_module hlds.pred_info_types. diff --git a/compiler/global_data.m b/compiler/global_data.m index eba89be6e..979ddd76c 100644 --- a/compiler/global_data.m +++ b/compiler/global_data.m @@ -19,7 +19,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.optimization_options. :- import_module ll_backend.continuation_info. diff --git a/compiler/goal_contains.m b/compiler/goal_contains.m index 0baaa814f..5f1bf2157 100644 --- a/compiler/goal_contains.m +++ b/compiler/goal_contains.m @@ -42,7 +42,6 @@ :- implementation. -:- import_module hlds.hlds_pred. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. diff --git a/compiler/goal_expr_to_goal.m b/compiler/goal_expr_to_goal.m index 65a238056..aad87e350 100644 --- a/compiler/goal_expr_to_goal.m +++ b/compiler/goal_expr_to_goal.m @@ -48,13 +48,13 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. -:- import_module hlds.hlds_pred. :- import_module hlds.make_goal. :- import_module hlds.make_hlds.field_access. :- import_module hlds.make_hlds.qual_info. :- import_module hlds.make_hlds.superhomogeneous. :- import_module hlds.make_hlds.superhomogeneous_util. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/goal_form.m b/compiler/goal_form.m index 47c9b0c30..1dbd30c8a 100644 --- a/compiler/goal_form.m +++ b/compiler/goal_form.m @@ -21,7 +21,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.set_of_var. @@ -246,6 +246,8 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.proc_info_types. :- import_module parse_tree.prog_data_foreign. :- import_module parse_tree.prog_data_pragma. diff --git a/compiler/goal_mode.m b/compiler/goal_mode.m index 775607e6f..973aa5b76 100644 --- a/compiler/goal_mode.m +++ b/compiler/goal_mode.m @@ -97,10 +97,12 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_match. :- import_module hlds.inst_test. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module parse_tree.parse_tree_out_term. :- import_module parse_tree.set_of_var. diff --git a/compiler/goal_path.m b/compiler/goal_path.m index 6b93a2328..3bd0d89b4 100644 --- a/compiler/goal_path.m +++ b/compiler/goal_path.m @@ -29,7 +29,7 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module parse_tree. diff --git a/compiler/goal_refs.m b/compiler/goal_refs.m index 60ec59de9..d609cc505 100644 --- a/compiler/goal_refs.m +++ b/compiler/goal_refs.m @@ -19,7 +19,7 @@ :- interface. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. diff --git a/compiler/goal_transform.m b/compiler/goal_transform.m index b44038e43..fb7e04c57 100644 --- a/compiler/goal_transform.m +++ b/compiler/goal_transform.m @@ -125,7 +125,6 @@ :- implementation. -:- import_module hlds.hlds_pred. :- import_module hlds.inst_lookup. :- import_module hlds.type_util. :- import_module mdbcomp.sym_name. diff --git a/compiler/goal_util.m b/compiler/goal_util.m index 88e087cff..5cf3343b4 100644 --- a/compiler/goal_util.m +++ b/compiler/goal_util.m @@ -255,6 +255,7 @@ :- implementation. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree.prog_mode. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_scan. diff --git a/compiler/goal_vars.m b/compiler/goal_vars.m index 4bb23ebef..71954c1ca 100644 --- a/compiler/goal_vars.m +++ b/compiler/goal_vars.m @@ -62,7 +62,6 @@ :- implementation. :- import_module hlds.hlds_markers. -:- import_module hlds.hlds_pred. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/granularity.m b/compiler/granularity.m index 630276617..3faacbc51 100644 --- a/compiler/granularity.m +++ b/compiler/granularity.m @@ -37,7 +37,9 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. diff --git a/compiler/headvar_names.m b/compiler/headvar_names.m index c51d442a6..9b3d418c3 100644 --- a/compiler/headvar_names.m +++ b/compiler/headvar_names.m @@ -52,6 +52,8 @@ :- import_module hlds.hlds_args. :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module libs.op_mode. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -65,6 +67,8 @@ :- import_module set. :- import_module varset. +%-----------------------------------------------------------------------------% + maybe_improve_headvar_names(Globals, MaybeLookForUnusedSVars, !PredInfo) :- globals.get_op_mode(Globals, OpMode), ( if OpMode = opm_top_args(opma_augment(opmau_make_plain_opt), _) then diff --git a/compiler/hhf.m b/compiler/hhf.m index 5cb9fd7d8..8c4d73a1b 100644 --- a/compiler/hhf.m +++ b/compiler/hhf.m @@ -22,8 +22,8 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.inst_graph. +:- import_module hlds.pred_proc_id. :- import_module bool. :- import_module io. @@ -43,6 +43,7 @@ :- import_module hlds.goal_transform. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. :- import_module hlds.type_util. :- import_module mdbcomp. diff --git a/compiler/higher_order.higher_order_global_info.m b/compiler/higher_order.higher_order_global_info.m index b6eeaa225..d06c9440d 100644 --- a/compiler/higher_order.higher_order_global_info.m +++ b/compiler/higher_order.higher_order_global_info.m @@ -13,8 +13,8 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.optimization_options. :- import_module mdbcomp. @@ -318,6 +318,7 @@ :- implementation. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. :- import_module hlds.mode_util. :- import_module parse_tree.prog_type_subst. :- import_module parse_tree.prog_type_unify. diff --git a/compiler/higher_order.higher_order_info.m b/compiler/higher_order.higher_order_info.m index a1de91b7f..c6775c6d6 100644 --- a/compiler/higher_order.higher_order_info.m +++ b/compiler/higher_order.higher_order_info.m @@ -12,6 +12,8 @@ :- import_module hlds. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.higher_order.higher_order_global_info. :- import_module set. diff --git a/compiler/higher_order.make_specialized_preds.m b/compiler/higher_order.make_specialized_preds.m index 81603b5c9..88ece4864 100644 --- a/compiler/higher_order.make_specialized_preds.m +++ b/compiler/higher_order.make_specialized_preds.m @@ -41,11 +41,13 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module hlds.type_util. @@ -412,7 +414,7 @@ construct_created_spec_name_status(ModuleInfo, Request, PredInfo0, pred_info_get_status(PredInfo0, PredStatus) ; RequestKind = non_user_type_spec, - NewProcId = hlds_pred.initial_proc_id, + NewProcId = initial_proc_id, hogi_allocate_id(SeqNum, !GlobalInfo), Transform = tn_higher_order(PredOrFunc, SeqNum), Name0 = pred_info_name(PredInfo0), diff --git a/compiler/higher_order.specialize_calls.m b/compiler/higher_order.specialize_calls.m index d57264d87..21eff0bcc 100644 --- a/compiler/higher_order.specialize_calls.m +++ b/compiler/higher_order.specialize_calls.m @@ -11,7 +11,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.higher_order.higher_order_global_info. :- import_module set. @@ -51,6 +51,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. @@ -1037,7 +1039,7 @@ maybe_specialize_call(GoalExpr0, GoalInfo, GoalExpr, !Info) :- not set.member(proc(CalleePredId, CalleeProcId), TypeSpecProcs) ; pred_info_is_pseudo_imported(CalleePredInfo), - hlds_pred.in_in_unification_proc_id(CalleeProcId) + in_in_unification_proc_id(CalleeProcId) ; pred_info_defn_has_foreign_proc(CalleePredInfo) ) diff --git a/compiler/higher_order.specialize_in_module.m b/compiler/higher_order.specialize_in_module.m index f732b0854..1ce369479 100644 --- a/compiler/higher_order.specialize_in_module.m +++ b/compiler/higher_order.specialize_in_module.m @@ -50,7 +50,6 @@ :- implementation. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.globals. :- import_module libs.optimization_options. diff --git a/compiler/higher_order.specialize_unify_compare.m b/compiler/higher_order.specialize_unify_compare.m index 46b8f4a8b..102d2f911 100644 --- a/compiler/higher_order.specialize_unify_compare.m +++ b/compiler/higher_order.specialize_unify_compare.m @@ -13,6 +13,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module transform_hlds.higher_order.higher_order_info. @@ -37,6 +38,7 @@ :- import_module hlds.add_special_pred. :- import_module hlds.goal_util. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.make_goal. @@ -344,7 +346,7 @@ find_unify_or_compare_proc(TypeCtor, SpecialId, SymName, PredId, ProcId, SpecialId = spec_pred_compare, add_lazily_generated_compare_pred_decl(TypeCtor, PredId, ModuleInfo0, ModuleInfo), - ProcId = hlds_pred.initial_proc_id + ProcId = initial_proc_id ; SpecialId = spec_pred_index, % This shouldn't happen. The index predicate should only be called @@ -362,7 +364,7 @@ find_unify_or_compare_proc(TypeCtor, SpecialId, SymName, PredId, ProcId, % reordering which requires rescheduling a conjunction. add_lazily_generated_unify_pred(TypeCtor, PredId, ModuleInfo0, ModuleInfo), - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) ), module_info_pred_info(ModuleInfo, PredId, PredInfo), ModuleName = pred_info_module(PredInfo), diff --git a/compiler/hlds.m b/compiler/hlds.m index 6dad31e93..0421ef7a8 100644 --- a/compiler/hlds.m +++ b/compiler/hlds.m @@ -30,11 +30,13 @@ :- include_module hlds_markers. :- include_module hlds_module. :- include_module hlds_pred. +:- include_module hlds_proc. :- include_module hlds_promise. :- include_module hlds_rtti. :- include_module inst_graph. :- include_module instmap. :- include_module pred_info_types. +:- include_module pred_proc_id. :- include_module pred_table. :- include_module proc_info_types. :- include_module special_pred. diff --git a/compiler/hlds_call_tree.m b/compiler/hlds_call_tree.m index eb2b3e04a..c94011cfc 100644 --- a/compiler/hlds_call_tree.m +++ b/compiler/hlds_call_tree.m @@ -153,7 +153,9 @@ :- import_module hlds.hlds_desc. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/hlds_class.m b/compiler/hlds_class.m index 5f85d1044..ec6dcb908 100644 --- a/compiler/hlds_class.m +++ b/compiler/hlds_class.m @@ -17,7 +17,7 @@ :- module hlds.hlds_class. :- interface. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. diff --git a/compiler/hlds_clauses.m b/compiler/hlds_clauses.m index 4afc1fccd..0b249b92c 100644 --- a/compiler/hlds_clauses.m +++ b/compiler/hlds_clauses.m @@ -19,9 +19,9 @@ :- import_module hlds.hlds_args. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module parse_tree. diff --git a/compiler/hlds_code_util.m b/compiler/hlds_code_util.m index 04c475805..15674de86 100644 --- a/compiler/hlds_code_util.m +++ b/compiler/hlds_code_util.m @@ -20,6 +20,8 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. diff --git a/compiler/hlds_data.m b/compiler/hlds_data.m index 934411564..4c2101eb9 100644 --- a/compiler/hlds_data.m +++ b/compiler/hlds_data.m @@ -18,7 +18,7 @@ :- module hlds.hlds_data. :- interface. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/hlds_defns.m b/compiler/hlds_defns.m index 18e7df6d1..ccde535fd 100644 --- a/compiler/hlds_defns.m +++ b/compiler/hlds_defns.m @@ -64,6 +64,7 @@ :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_pred. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/hlds_dependency_graph.m b/compiler/hlds_dependency_graph.m index b69491bd4..c41c8ae48 100644 --- a/compiler/hlds_dependency_graph.m +++ b/compiler/hlds_dependency_graph.m @@ -26,7 +26,7 @@ :- interface. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.dependency_graph. @@ -145,6 +145,8 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. diff --git a/compiler/hlds_desc.m b/compiler/hlds_desc.m index d56749e12..5c5f154ec 100644 --- a/compiler/hlds_desc.m +++ b/compiler/hlds_desc.m @@ -26,6 +26,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.indent. :- import_module parse_tree. diff --git a/compiler/hlds_error_util.m b/compiler/hlds_error_util.m index 0c82b747c..fd11fa044 100644 --- a/compiler/hlds_error_util.m +++ b/compiler/hlds_error_util.m @@ -24,6 +24,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module libs. :- import_module libs.maybe_util. @@ -305,6 +306,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_name. :- import_module hlds.special_pred. :- import_module mdbcomp. diff --git a/compiler/hlds_goal.m b/compiler/hlds_goal.m index b2404ad08..06cd98484 100644 --- a/compiler/hlds_goal.m +++ b/compiler/hlds_goal.m @@ -23,8 +23,8 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_markers. -:- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module mdbcomp.prim_data. diff --git a/compiler/hlds_module.m b/compiler/hlds_module.m index 471fa4f3b..c859935b5 100644 --- a/compiler/hlds_module.m +++ b/compiler/hlds_module.m @@ -30,7 +30,9 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_promise. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.special_pred. diff --git a/compiler/hlds_out_goal.m b/compiler/hlds_out_goal.m index 388cfdd2c..1dd5140ad 100644 --- a/compiler/hlds_out_goal.m +++ b/compiler/hlds_out_goal.m @@ -186,6 +186,7 @@ :- import_module hlds.hlds_out.hlds_out_mode. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module libs.globals. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. diff --git a/compiler/hlds_out_module.m b/compiler/hlds_out_module.m index de150118b..274427d1f 100644 --- a/compiler/hlds_out_module.m +++ b/compiler/hlds_out_module.m @@ -118,6 +118,7 @@ :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.dependency_graph. @@ -840,7 +841,7 @@ maybe_write_pred(Info, Lang, ModuleInfo, PredId - PredInfo, !State) :- % only print them if we are using a local mode for them. pred_info_is_pseudo_imported(PredInfo), ProcIds = pred_info_all_proc_ids(PredInfo), - hlds_pred.in_in_unification_proc_id(ProcId), + in_in_unification_proc_id(ProcId), ProcIds = [ProcId] ) ; diff --git a/compiler/hlds_out_pred.m b/compiler/hlds_out_pred.m index e83145ad5..92021841e 100644 --- a/compiler/hlds_out_pred.m +++ b/compiler/hlds_out_pred.m @@ -19,6 +19,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.indent. @@ -83,6 +84,7 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_out.hlds_out_goal. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.pred_info_types. @@ -805,7 +807,7 @@ format_proc(Info, VarNamePrint, ModuleInfo, PredId, PredInfo, pred_info_get_status(PredInfo, PredStatus), ( if PredStatus = pred_status(status_pseudo_imported), - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) then true else diff --git a/compiler/hlds_out_typeclass_table.m b/compiler/hlds_out_typeclass_table.m index f3b2d88f7..d5cb249e6 100644 --- a/compiler/hlds_out_typeclass_table.m +++ b/compiler/hlds_out_typeclass_table.m @@ -30,7 +30,7 @@ :- implementation. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.indent. diff --git a/compiler/hlds_out_util.m b/compiler/hlds_out_util.m index 274635358..712d7bff0 100644 --- a/compiler/hlds_out_util.m +++ b/compiler/hlds_out_util.m @@ -18,7 +18,7 @@ :- import_module hlds.hlds_class. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.globals. @@ -259,6 +259,7 @@ :- implementation. +:- import_module hlds.hlds_pred. :- import_module hlds.pred_name. :- import_module libs.options. :- import_module parse_tree.parse_tree_out_cons_id. diff --git a/compiler/hlds_pred.m b/compiler/hlds_pred.m index 5d8f33fe4..601abb91d 100644 --- a/compiler/hlds_pred.m +++ b/compiler/hlds_pred.m @@ -10,29 +10,27 @@ % File: hlds_pred.m. % Main authors: fjh, conway. % -% This module defines the part of the HLDS that deals with predicates -% and procedures. +% This module defines the part of the HLDS that deals with predicates. % %---------------------------------------------------------------------------% :- module hlds.hlds_pred. :- interface. -:- import_module check_hlds. -:- import_module check_hlds.mode_constraint_robdd. :- import_module hlds.hlds_class. :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_cons. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_llds. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_promise. :- import_module hlds.hlds_rtti. :- import_module hlds.inst_graph. :- import_module hlds.instmap. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.status. @@ -42,15 +40,9 @@ :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. :- import_module parse_tree. -:- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. -:- import_module parse_tree.prog_data_pragma. :- import_module parse_tree.prog_data_rare. -:- import_module parse_tree.set_of_var. :- import_module parse_tree.var_table. -:- import_module transform_hlds. -:- import_module transform_hlds.term_constr_main_types. -:- import_module transform_hlds.term_util. :- import_module bool. :- import_module list. @@ -68,20 +60,20 @@ :- import_module hlds.goal_vars. :- import_module hlds.hlds_args. :- import_module hlds.hlds_data. -:- import_module hlds.type_util. :- import_module libs.optimization_options. :- import_module libs.options. :- import_module mdbcomp.builtin_modules. :- import_module mdbcomp.program_representation. -:- import_module parse_tree.prog_type. +:- import_module parse_tree.prog_data_pragma. :- import_module parse_tree.prog_type_scan. :- import_module parse_tree.prog_util. +:- import_module parse_tree.set_of_var. :- import_module parse_tree.vartypes. +:- import_module transform_hlds. :- import_module int. :- import_module pair. :- import_module require. -:- import_module string. :- import_module term. :- import_module unit. :- import_module varset. @@ -90,71 +82,7 @@ :- interface. - % A proc_id is the name of a mode within a particular predicate - - % not to be confused with a mode_id, which is the name of a - % user-defined mode. - -:- type pred_id. -:- type proc_id. -:- type pred_proc_id - ---> proc(pred_id, proc_id). - -:- func pred_proc_id_project_pred_id(pred_proc_id) = pred_id. -:- func pred_proc_id_project_proc_id(pred_proc_id) = proc_id. - - % Several passes operate on the module one SCC at a time. An SCC is - % a strongly connected component of the call graph, i.e. a group of - % procedures that all recursively call each other, directly or indirectly, - % which aren't mutually recursive with any procedure outside the SCC. -:- type scc == set(pred_proc_id). - - % Predicate and procedure ids are abstract data types. One important - % advantage of this arrangement is to make it harder to accidentally - % confuse them for each other, or to use an integer in their place. - % However, you can convert between integers and pred_ids/proc_ids - % with the following predicates and functions. - % -:- func shroud_pred_id(pred_id) = shrouded_pred_id. -:- func shroud_proc_id(proc_id) = shrouded_proc_id. -:- func shroud_pred_proc_id(pred_proc_id) = shrouded_pred_proc_id. - -:- func unshroud_pred_id(shrouded_pred_id) = pred_id. -:- func unshroud_proc_id(shrouded_proc_id) = proc_id. -:- func unshroud_pred_proc_id(shrouded_pred_proc_id) = pred_proc_id. - -:- pred pred_id_to_int(pred_id, int). -:- mode pred_id_to_int(in, out) is det. -:- mode pred_id_to_int(out, in) is det. -:- func pred_id_to_int(pred_id) = int. - -:- pred proc_id_to_int(proc_id, int). -:- mode proc_id_to_int(in, out) is det. -:- mode proc_id_to_int(out, in) is det. -:- func proc_id_to_int(proc_id) = int. - - % Return the id of the first predicate in a module, and of the first - % procedure in a predicate. - % -:- func initial_pred_id = pred_id. -:- func initial_proc_id = proc_id. - - % Return an invalid predicate or procedure id. These are intended to be - % used to initialize the relevant fields in call(...) goals before - % we do type- and mode-checks, or when those checks find that there was - % no predicate matching the call. - % -:- func invalid_pred_id = pred_id. -:- func invalid_proc_id = proc_id. - -:- pred next_pred_id(pred_id::in, pred_id::out) is det. - - % For semidet complicated unifications with mode (in, in), these are - % defined to have the same proc_id (0). This returns that proc_id. - % -:- pred in_in_unification_proc_id(proc_id::out) is det. - :- type pred_info. -:- type proc_info. :- type proc_table == map(proc_id, proc_info). @@ -518,41 +446,6 @@ :- implementation. -:- type pred_id - ---> pred_id(int). - -:- type proc_id == int. - -pred_proc_id_project_pred_id(proc(PredId, _ProcId)) = PredId. -pred_proc_id_project_proc_id(proc(_PredId, ProcId)) = ProcId. - -shroud_pred_id(pred_id(PredId)) = shrouded_pred_id(PredId). -shroud_proc_id(ProcId) = shrouded_proc_id(ProcId). -shroud_pred_proc_id(proc(pred_id(PredId), ProcId)) = - shrouded_pred_proc_id(PredId, ProcId). - -unshroud_pred_id(shrouded_pred_id(PredId)) = pred_id(PredId). -unshroud_proc_id(shrouded_proc_id(ProcId)) = ProcId. -unshroud_pred_proc_id(shrouded_pred_proc_id(PredId, ProcId)) = - proc(pred_id(PredId), ProcId). - -pred_id_to_int(pred_id(PredId), PredId). -pred_id_to_int(pred_id(PredId)) = PredId. - -proc_id_to_int(ProcId, ProcId). -proc_id_to_int(ProcId) = ProcId. - -initial_pred_id = pred_id(0). -initial_proc_id = 0. - -invalid_pred_id = pred_id(-1). -invalid_proc_id = -1. - -next_pred_id(pred_id(PredId), pred_id(NextPredId)) :- - NextPredId = PredId + 1. - -in_in_unification_proc_id(0). - next_proc_id(ProcTable, ProcId) :- % We could store the next available ModeId rather than recomputing % it on demand, but it is probably more efficient this way. @@ -1279,10 +1172,11 @@ pred_info_will_codegen_proc_ids(PredInfo) = ProcIds :- ; OldImportStatus = status_pseudo_imported, ProcIds0 = pred_info_all_proc_ids(PredInfo), + in_in_unification_proc_id(InInUnifyProcId), % For pseudo_imported preds, proc 0 is imported, but % the code generated for all other procs will be included % in the code generated for the current module. - list.delete_all(ProcIds0, 0, ProcIds) + list.delete_all(ProcIds0, InInUnifyProcId, ProcIds) ; ( OldImportStatus = status_opt_imported ; OldImportStatus = status_exported @@ -1309,7 +1203,8 @@ pred_info_all_exported_proc_ids(PredInfo) = ProcIds :- ProcIds = pred_info_all_proc_ids(PredInfo) ; OldImportStatus = status_pseudo_exported, - ProcIds = [0] + in_in_unification_proc_id(InInUnifyProcId), + ProcIds = [InInUnifyProcId] ; ( OldImportStatus = status_imported(_) ; OldImportStatus = status_opt_imported @@ -1537,289 +1432,9 @@ pred_info_get_sym_name(PredInfo, SymName) :- SymName = qualified(Module, Name). %---------------------------------------------------------------------------% -%---------------------------------------------------------------------------% - - % Various predicates for accessing the proc_info data structure, - % and the types they work with. :- interface. -:- pred proc_info_create(prog_context::in, item_seq_num::in, - var_table::in, list(prog_var)::in, - inst_varset::in, list(mer_mode)::in, - detism_decl::in, determinism::in, hlds_goal::in, - rtti_varmaps::in, is_address_taken::in, has_parallel_conj::in, - map(prog_var, string)::in, proc_info::out) is det. - -%---------------------% - -% proc_prepare_to_clone returns all the fields of an existing proc_info, -% while proc_create constructs a new proc_info putting the supplied values -% to each field. -% -% These predicates exist because we want keep the definition of the proc_info -% type private (to make future changes easier), but we also want to make it -% possible to create slightly modified copies of existing procedures -% with the least amount of programming work. We also want to require -% (a) programmers writing such cloning code to consider what effect -% the modification may have on *all* fields of the proc_info, and -% (b) programmers who add new fields to the proc_info to update -% all the places in the compiler that do such cloning. - -:- pred proc_prepare_to_clone(proc_info::in, list(prog_var)::out, - hlds_goal::out, var_table::out, rtti_varmaps::out, - inst_varset::out, maybe(list(mer_mode))::out, list(mer_mode)::out, - maybe(list(is_live))::out, maybe(determinism)::out, determinism::out, - eval_method::out, prog_context::out, item_seq_num::out, - can_process::out, maybe(mode_constraint)::out, detism_decl::out, - list(prog_context)::out, maybe(untuple_proc_info)::out, - map(prog_var, string)::out, list(warn_spec)::out, set(pred_proc_id)::out, - is_address_taken::out, proc_foreign_exports::out, has_parallel_conj::out, - has_user_event::out, has_tail_rec_call::out, list(oisu_pred_kind_for)::out, - maybe(require_tail_recursion)::out, set_of_progvar::out, - maybe(list(arg_info))::out, maybe(special_proc_return)::out, - liveness_info::out, stack_slots::out, needs_maxfr_slot::out, - maybe(prog_var)::out, maybe(proc_table_io_info)::out, - maybe(table_attributes)::out, maybe(list(sym_name_arity))::out, - maybe(deep_profile_proc_info)::out, maybe(arg_size_info)::out, - maybe(termination_info)::out, termination2_info::out, - maybe(proc_exception_info)::out, maybe(proc_trailing_info)::out, - maybe(proc_mm_tabling_info)::out, structure_sharing_info::out, - structure_reuse_info::out) is det. - -:- pred proc_create(list(prog_var)::in, - hlds_goal::in, var_table::in, rtti_varmaps::in, - inst_varset::in, maybe(list(mer_mode))::in, list(mer_mode)::in, - maybe(list(is_live))::in, maybe(determinism)::in, determinism::in, - eval_method::in, prog_context::in, item_seq_num::in, can_process::in, - maybe(mode_constraint)::in, detism_decl::in, - list(prog_context)::in, maybe(untuple_proc_info)::in, - map(prog_var, string)::in, list(warn_spec)::in, set(pred_proc_id)::in, - is_address_taken::in, proc_foreign_exports::in, has_parallel_conj::in, - has_user_event::in, has_tail_rec_call::in, list(oisu_pred_kind_for)::in, - maybe(require_tail_recursion)::in, set_of_progvar::in, - maybe(list(arg_info))::in, maybe(special_proc_return)::in, - liveness_info::in, stack_slots::in, needs_maxfr_slot::in, - maybe(prog_var)::in, maybe(proc_table_io_info)::in, - maybe(table_attributes)::in, maybe(list(sym_name_arity))::in, - maybe(deep_profile_proc_info)::in, maybe(arg_size_info)::in, - maybe(termination_info)::in, termination2_info::in, - maybe(proc_exception_info)::in, maybe(proc_trailing_info)::in, - maybe(proc_mm_tabling_info)::in, structure_sharing_info::in, - structure_reuse_info::in, proc_info::out) is det. - -%---------------------% - -:- pred proc_info_set_body(var_table::in, - list(prog_var)::in, hlds_goal::in, rtti_varmaps::in, - proc_info::in, proc_info::out) is det. - - % Predicates to get fields of proc_infos. - -:- pred proc_info_get_headvars(proc_info::in, list(prog_var)::out) is det. -:- pred proc_info_get_goal(proc_info::in, hlds_goal::out) is det. -:- pred proc_info_get_var_table(proc_info::in, var_table::out) is det. -:- pred proc_info_get_rtti_varmaps(proc_info::in, rtti_varmaps::out) is det. -:- pred proc_info_get_inst_varset(proc_info::in, inst_varset::out) is det. -:- pred proc_info_get_maybe_declared_argmodes(proc_info::in, - maybe(list(mer_mode))::out) is det. -:- pred proc_info_get_argmodes(proc_info::in, list(mer_mode)::out) is det. -:- pred proc_info_get_maybe_arglives(proc_info::in, - maybe(list(is_live))::out) is det. -:- pred proc_info_get_declared_determinism(proc_info::in, - maybe(determinism)::out) is det. -:- pred proc_info_get_inferred_determinism(proc_info::in, - determinism::out) is det. -:- pred proc_info_get_eval_method(proc_info::in, eval_method::out) is det. - -:- pred proc_info_get_context(proc_info::in, prog_context::out) is det. -:- pred proc_info_get_item_number(proc_info::in, item_seq_num::out) is det. -:- pred proc_info_get_can_process(proc_info::in, can_process::out) is det. -:- pred proc_info_get_maybe_head_modes_constr(proc_info::in, - maybe(mode_constraint)::out) is det. -:- pred proc_info_get_detism_decl(proc_info::in, detism_decl::out) is det. -:- pred proc_info_get_cse_nopull_contexts(proc_info::in, - list(prog_context)::out) is det. -:- pred proc_info_get_maybe_untuple_info(proc_info::in, - maybe(untuple_proc_info)::out) is det. -:- pred proc_info_get_var_name_remap(proc_info::in, - map(prog_var, string)::out) is det. -:- pred proc_info_get_statevar_warnings(proc_info::in, - list(warn_spec)::out) is det. -:- pred proc_info_get_deleted_call_callees(proc_info::in, - set(pred_proc_id)::out) is det. -:- pred proc_info_get_is_address_taken(proc_info::in, - is_address_taken::out) is det. -:- pred proc_info_get_has_any_foreign_exports(proc_info::in, - proc_foreign_exports::out) is det. -:- pred proc_info_get_has_parallel_conj(proc_info::in, - has_parallel_conj::out) is det. -:- pred proc_info_get_has_user_event(proc_info::in, - has_user_event::out) is det. -:- pred proc_info_get_has_tail_rec_call(proc_info::in, - has_tail_rec_call::out) is det. -:- pred proc_info_get_oisu_kind_fors(proc_info::in, - list(oisu_pred_kind_for)::out) is det. -:- pred proc_info_get_maybe_require_tailrec_info(proc_info::in, - maybe(require_tail_recursion)::out) is det. -:- pred proc_info_get_reg_r_headvars(proc_info::in, - set_of_progvar::out) is det. -:- pred proc_info_get_maybe_arg_info(proc_info::in, - maybe(list(arg_info))::out) is det. -:- pred proc_info_get_maybe_special_return(proc_info::in, - maybe(special_proc_return)::out) is det. -:- pred proc_info_get_liveness_info(proc_info::in, liveness_info::out) is det. -:- pred proc_info_get_stack_slots(proc_info::in, stack_slots::out) is det. -:- pred proc_info_get_needs_maxfr_slot(proc_info::in, - needs_maxfr_slot::out) is det. -:- pred proc_info_get_call_table_tip(proc_info::in, - maybe(prog_var)::out) is det. -:- pred proc_info_get_maybe_proc_table_io_info(proc_info::in, - maybe(proc_table_io_info)::out) is det. -:- pred proc_info_get_table_attributes(proc_info::in, - maybe(table_attributes)::out) is det. -:- pred proc_info_get_obsolete_in_favour_of(proc_info::in, - maybe(list(sym_name_arity))::out) is det. -:- pred proc_info_get_maybe_deep_profile_info(proc_info::in, - maybe(deep_profile_proc_info)::out) is det. -:- pred proc_info_get_maybe_arg_size_info(proc_info::in, - maybe(arg_size_info)::out) is det. -:- pred proc_info_get_maybe_termination_info(proc_info::in, - maybe(termination_info)::out) is det. -:- pred proc_info_get_termination2_info(proc_info::in, - termination2_info::out) is det. -:- pred proc_info_get_exception_info(proc_info::in, - maybe(proc_exception_info)::out) is det. -:- pred proc_info_get_trailing_info(proc_info::in, - maybe(proc_trailing_info)::out) is det. -:- pred proc_info_get_mm_tabling_info(proc_info::in, - maybe(proc_mm_tabling_info)::out) is det. - - % Predicates to set fields of proc_infos. - -:- pred proc_info_set_headvars(list(prog_var)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_goal(hlds_goal::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_var_table(var_table::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_rtti_varmaps(rtti_varmaps::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_inst_varset(inst_varset::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_declared_argmodes(maybe(list(mer_mode))::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_argmodes(list(mer_mode)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_arglives(maybe(list(is_live))::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_inferred_determinism(determinism::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_eval_method(eval_method::in, - proc_info::in, proc_info::out) is det. - -:- pred proc_info_set_can_process(can_process::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_head_modes_constraint(mode_constraint::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_detism_decl(detism_decl::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_cse_nopull_contexts(list(prog_context)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_untuple_info(maybe(untuple_proc_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_var_name_remap(map(prog_var, string)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_statevar_warnings(list(warn_spec)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_deleted_call_callees(set(pred_proc_id)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_address_taken(is_address_taken::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_has_any_foreign_exports(proc_foreign_exports::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_has_parallel_conj(has_parallel_conj::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_has_user_event(has_user_event::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_has_tail_rec_call(has_tail_rec_call::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_oisu_kind_fors(list(oisu_pred_kind_for)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_require_tailrec_info(require_tail_recursion::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_reg_r_headvars(set_of_progvar::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_arg_info(list(arg_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_special_return(maybe(special_proc_return)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_liveness_info(liveness_info::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_stack_slots(stack_slots::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_needs_maxfr_slot(needs_maxfr_slot::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_call_table_tip(maybe(prog_var)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_proc_table_io_info(maybe(proc_table_io_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_table_attributes(maybe(table_attributes)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_obsolete_in_favour_of( - maybe(list(sym_name_arity))::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_deep_profile_info( - maybe(deep_profile_proc_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_arg_size_info(maybe(arg_size_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_maybe_termination_info(maybe(termination_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_termination2_info(termination2_info::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_exception_info(maybe(proc_exception_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_trailing_info(maybe(proc_trailing_info)::in, - proc_info::in, proc_info::out) is det. -:- pred proc_info_set_mm_tabling_info(maybe(proc_mm_tabling_info)::in, - proc_info::in, proc_info::out) is det. - -:- pred proc_info_get_structure_sharing(proc_info::in, - maybe(structure_sharing_domain_and_status)::out) is det. - -:- pred proc_info_set_structure_sharing( - structure_sharing_domain_and_status::in, - proc_info::in, proc_info::out) is det. - -:- pred proc_info_get_imported_structure_sharing(proc_info::in, - list(prog_var)::out, list(mer_type)::out, structure_sharing_domain::out) - is semidet. - -:- pred proc_info_set_imported_structure_sharing(list(prog_var)::in, - list(mer_type)::in, structure_sharing_domain::in, proc_info::in, - proc_info::out) is det. - -:- pred proc_info_reset_imported_structure_sharing(proc_info::in, - proc_info::out) is det. - -:- pred proc_info_get_structure_reuse(proc_info::in, - maybe(structure_reuse_domain_and_status)::out) is det. - -:- pred proc_info_set_structure_reuse(structure_reuse_domain_and_status::in, - proc_info::in, proc_info::out) is det. - -:- pred proc_info_get_imported_structure_reuse(proc_info::in, - list(prog_var)::out, list(mer_type)::out, structure_reuse_domain::out) - is semidet. - -:- pred proc_info_set_imported_structure_reuse(list(prog_var)::in, - list(mer_type)::in, structure_reuse_domain::in, - proc_info::in, proc_info::out) is det. - -:- pred proc_info_reset_imported_structure_reuse(proc_info::in, - proc_info::out) is det. - % Return true if the interface of the given procedure must include % typeinfos for all the type variables in the types of the arguments. % @@ -1837,940 +1452,6 @@ pred_info_get_sym_name(PredInfo, SymName) :- :- implementation. - % The information specific to a procedure, as opposed to a predicate. - % - % The proc_info and proc_sub_info types constitute a single logical - % data structure split into two parts for efficiency purposes. - % - % The proc_info type contains the most frequently accessed and/or updated - % pieces of information about the procedure. Everything else is in the - % proc_sub_info type. This arrangement minimizes the amount of memory that - % needs to be allocated, and filled in, when a field is updated. - -:- type proc_info - ---> proc_info( - % The Boehm collector allocates blocks whose sizes are - % multiples (and usually powers) of 2. Ideally, we would want - % the number of fields of proc_info to match one of the Boehm - % block sizes, but as of 2017 march 15, this seemed to be the - % optimal arrangement (zs). - -/* 1 */ proc_head_vars :: list(prog_var), -/* 2 */ proc_body :: hlds_goal, - -/* 3 */ proc_var_table :: var_table, - - % Information about type_infos and typeclass_infos. -/* 4 */ proc_rtti_varmaps :: rtti_varmaps, - -/* 5 */ proc_inst_varset :: inst_varset, - - % The declared modes of arguments. -/* 6 */ proc_maybe_decl_head_modes :: maybe(list(mer_mode)), - -/* 7 */ proc_actual_head_modes :: list(mer_mode), - - % Liveness (in the mode analysis sense) of the arguments - % in the caller; says whether each argument may be used - % after the call. -/* 8 */ proc_headvar_caller_liveness :: maybe(list(is_live)), - - % The _declared_ determinism of the procedure, or `no' - % if there was no detism declaration. -/* 9 */ proc_declared_detism :: maybe(determinism), -/* 10 */ proc_inferred_detism :: determinism, - - % How should the proc be evaluated. -/* 11 */ proc_eval_method :: eval_method, - -/* 12 */ proc_sub_info :: proc_sub_info - ). - -:- type proc_sub_info - ---> proc_sub_info( - % The context of the `:- mode' decl, or the context of the - % first clause if there was no mode declaration. - psi_proc_context :: prog_context, - - % The item number of the mode declaration, if there was one. - psi_item_number :: item_seq_num, - - % Set to cannot_process if we must not process this procedure - % just yet. This is used to delay mode checking etc. for - % complicated modes of unification predicates until the end - % of the unique_modes pass. - psi_can_process :: can_process, - - % XXX The mode of the procedure in the ROBDD based - % constraint system. Whether it represents the declared - % or the actual mode is unclear, but since that constraint - % system is obsolete, this does not much matter :-( - psi_maybe_head_modes_constr :: maybe(mode_constraint), - - % Was the determinism declaration explicit, or was it implicit, - % as for functions? - psi_detism_decl :: detism_decl, - - % A list of all the contexts at which cse_detection.m - % declined to pull out a common deconstruction out of - % a branched control structure due to concerns about - % uniqueness in the inst of the affected variable. - % Determinism analysis wants this information so that - % it knows whether to mention this fact to the user - % as a possible cause of a determinism error. - % See Mantis bug #496. - psi_cse_nopull_contexts :: list(prog_context), - - % If set, it means this procedure was created from another - % procedure by the untupling transformation. This slot records - % which of the procedure's arguments were derived from which - % arguments in the original procedure. - % - % This is effectively a record of the *procedure*'s origin. - % (The pred_origin field records the *predicate*'s origin.) - psi_maybe_untuple_info :: maybe(untuple_proc_info), - - % Remaps the compiler-created variables named HeadVar__N - % to the user-given variable names that actually occupied the - % corresponding argument slots in the procedure's clauses. - % Has an entry for a head variable only if *all* the clauses - % consistently give that argument that name, if they give it - % any name at all. - % This renaming is applied only after semantic analysis, - % although it is recorded earlier. The reason for this is - % to make any error messages about the goals that unify the - % original headvar (e.g. "X") with the introduced headvar - % (e.g. "HeadVar__1") give the goal as HeadVar__1 = X, - % not as X = X, since the latter would be very confusing. - psi_proc_var_name_remap :: map(prog_var, string), - - % Any warnings generated by the state variable transformation - % that we should print only if we find a mode error that could - % be caused by the problem being warned about. - psi_statevar_warnings :: list(warn_spec), - - % The set of procedures that the body of this procedure - % *used* to call, but doesn't anymore. This can happen - % For several reason. These reasons include the call being - % - inside a trace goal scope whose compile-time condition - % turned out to be false, - % - in the then part of an if-then-else whose condition - % never succeeds, - % - in the else part of an if-then-else whose condition - % never fails. - % We record the callees of the deleted calls so that - % dead procedure analysis does not generate warnings - % for these procedures, or the other procedures reachable - % from them. - psi_deleted_call_callees :: set(pred_proc_id), - - %-----------------------------------------------------------% - % Flags that record simple properties of the procedure. - %-----------------------------------------------------------% - - % Is the address of this procedure taken? If yes, we will - % need to use typeinfo liveness for them, so that deep_copy - % and accurate gc have the RTTI they need for copying closures. - % - % Note that any non-local procedure must be considered - % as having its address taken, since it is possible that - % some other module may do so. - psi_is_address_taken :: is_address_taken, - - % Is the procedure mentioned in any foreign_export pragma, - % regardless of what the current supported foreign languages - % are? - psi_has_any_foreign_exports :: proc_foreign_exports, - - % Does this procedure contain parallel conjunction? - % If yes, it should be run through the dependent parallel - % conjunction transformation. - % - % This slot is set by the simplification pass. - % Note that after some optimization passes, this flag - % may be a conservative approximation. - psi_proc_has_parallel_conj :: has_parallel_conj, - - % Does this procedure contain a user event? - % - % This slot is set by the simplification pass. - psi_proc_has_user_event :: has_user_event, - - psi_proc_has_tail_rec_call :: has_tail_rec_call, - - % Is the procedure mentioned in any order-independent-state- - % update pragmas? If yes, list the role of this procedure - % for the each of the types in those pragmas. - psi_oisu_kind_fors :: list(oisu_pred_kind_for), - - % Has the user requested (via a require_tail_recursion - % pragma) that we suppress or enable warnings about tail - % recursion for this procedure? - psi_maybe_require_tailrec :: maybe(require_tail_recursion), - - %-----------------------------------------------------------% - % Information needed by the LLDS code generator. - %-----------------------------------------------------------% - - % The head variables which must be forced to use regular - % registers by the calling convention, despite having type - % float. This is only meaningful with float registers. - psi_reg_r_headvars :: set_of_progvar, - - % The calling convention of each argument: information computed - % by arg_info.m (based on the modes etc.) and used by code - % generation to determine how each argument should be passed. - psi_maybe_arg_info :: maybe(list(arg_info)), - - psi_maybe_special_return :: maybe(special_proc_return), - - % The initial liveness, for code generation. - psi_initial_liveness :: liveness_info, - - % Allocation of variables to stack slots. - psi_stack_slots :: stack_slots, - - % True iff tracing is enabled, this is a procedure that lives - % on the det stack, and the code of this procedure may create - % a frame on the det stack. (Only in these circumstances do we - % need to reserve a stack slot to hold the value of maxfr - % at the call, for use in implementing retry.) This slot - % is used only with the LLDS backend XXX. Its value is set - % during the live_vars pass; it is invalid before then. - psi_needs_maxfr_slot :: needs_maxfr_slot, - - %-----------------------------------------------------------% - % Information needed for tabling. - %-----------------------------------------------------------% - - % If the procedure's evaluation method is memo, loopcheck or - % minimal, this slot identifies the variable that holds the tip - % of the call table. Otherwise, this field will be set to `no'. - % - % Tabled procedures record, in the data structure identified - % by this variable, that the call is active. When performing - % a retry across such a procedure, we must reset the state - % of the call; if we don't, the retried call will find the - % active call and report an infinite loop error. - % - % Such resetting of course requires the debugger to know - % whether the procedure has reached the call table tip yet. - % Therefore when binding this variable, the code generator - % of the relevant backend must record this fact in a place - % accessible to the debugger, if debugging is enabled. - psi_call_table_tip :: maybe(prog_var), - - % If set, it means that procedure has been subject to the I/O - % tabling transformation. The argument will contain all the - % information we need to display I/O actions involving - % this procedure. - % - % (If the procedure has been subject to other kinds of tabling - % transformations, the corresponding information will be - % recorded in a map in the module_info.) - % XXX For now, the compiler fully supports only procedures - % whose arguments are all either ints, floats or strings. - % However, this is still sufficient for debugging most problems - % in the tabling system. - psi_maybe_table_io_info :: maybe(proc_table_io_info), - - psi_table_attributes :: maybe(table_attributes), - - % If this procedure is marked as obsolete, this will be a - % "yes(_)" wrapped around a list of the predicate names that - % the compiler should suggest as possible replacements. - % (Note that the list of possible replacements may be empty.) - % In the usual case where this predicate is NOT marked - % as obsolete, this will be "no". - psi_proc_obsolete_in_favour_of :: maybe(list( - sym_name_arity)), - - %-----------------------------------------------------------% - % Information needed for deep profiling. - %-----------------------------------------------------------% - - psi_maybe_deep_prof_info :: maybe(deep_profile_proc_info), - - %-----------------------------------------------------------% - % The results of program analyses. - %-----------------------------------------------------------% - - % Information about the relative sizes of the input and output - % args of the procedure. Set by termination analysis. - psi_maybe_arg_sizes :: maybe(arg_size_info), - - % The termination properties of the procedure. - % Set by termination analysis. - psi_maybe_termination :: maybe(termination_info), - - % Termination properties and argument size constraints for - % the procedure. Set by termination2 analysis. - psi_termination2 :: termination2_info, - - % The results of the analyses in exception_analysis.m, - % trailing_analysis.m and tabling_analysis, if available. - psi_exception_info :: maybe(proc_exception_info), - psi_trailing_info :: maybe(proc_trailing_info), - psi_mm_tabling_info :: maybe(proc_mm_tabling_info), - - % Structure sharing information as obtained by the structure - % sharing analysis. - psi_structure_sharing :: structure_sharing_info, - - % Structure reuse conditions obtained by the structure reuse - % analysis (CTGC). - psi_structure_reuse :: structure_reuse_info - ). - -%---------------------------------------------------------------------------% - -:- pred proc_info_init(module_info::in, prog_context::in, item_seq_num::in, - list(mer_type)::in, inst_varset::in, maybe(list(mer_mode))::in, - list(mer_mode)::in, maybe(list(is_live))::in, - detism_decl::in, maybe(determinism)::in, is_address_taken::in, - has_parallel_conj::in, map(prog_var, string)::in, proc_info::out) is det. - -proc_info_init(ModuleInfo, MainContext, ItemNumber, Types, InstVarSet, - DeclaredModes, Modes, MaybeArgLives, DetismDecl, MaybeDeclaredDetism, - IsAddressTaken, HasParallelConj, VarNameRemap, ProcInfo) :- - % When this predicate is invoked during the construction of the HLDS, - % some parts of the procedure aren't known yet. In that case, we can - % simply initialize them to any old garbage which we will later throw away. - % - % However, when this predicate is invoked by HLDS transformation passes - % after the front-end has finished, this strategy won't work. We need - % to fill in every field with meaningful, correct information, unless - % we know for sure that before the next pass that needs the correct value - % in a field, we will invoke another pass that fills in the correct value - % in that field. - % - % XXX I (zs) am far from sure that all the field initializations below, - % in this predicate and in proc_info_create_with_declared_detism, - % fulfill this condition. - - % Please use a variable for every field of the proc_info and proc_sub_info, - % and please keep the definitions of those variables in the same order - % as the fields themselves. - - % argument MainContext - % argument ItemNumber - CanProcess = can_process_now, - % argument DetismDecl - CseNopullContexts = [], - MaybeUntupleInfo = no `with_type` maybe(untuple_proc_info), - % argument VarNameRemap - StateVarWarnings = [], - set.init(DeletedCallees), - % argument IsAddressTaken - HasForeignProcExports = no_foreign_exports, - % argument HasParallelConj - HasUserEvent = has_no_user_event, - HasTailCallEvent = has_tail_rec_call(has_no_self_tail_rec_call, - has_no_mutual_tail_rec_call), - OisuKinds = [], - MaybeRequireTailRecursion = no, - set_of_var.init(RegR_HeadVars), - MaybeArgPassInfo = no `with_type` maybe(list(arg_info)), - MaybeSpecialReturn = no `with_type` maybe(special_proc_return), - set_of_var.init(InitialLiveness), - map.init(StackSlots), - NeedsMaxfrSlot = does_not_need_maxfr_slot, - MaybeCallTableTip = no `with_type` maybe(prog_var), - MaybeTableIOInfo = no `with_type` maybe(proc_table_io_info), - MaybeTableAttrs = no `with_type` maybe(table_attributes), - MaybeObsoleteInFavourOf = no `with_type` maybe(list(sym_name_arity)), - MaybeDeepProfProcInfo = no `with_type` maybe(deep_profile_proc_info), - MaybeArgSizes = no `with_type` maybe(arg_size_info), - MaybeTermInfo = no `with_type` maybe(termination_info), - Term2Info = term_constr_main_types.term2_info_init, - MaybeExceptionInfo = no `with_type` maybe(proc_exception_info), - MaybeTrailingInfo = no `with_type` maybe(proc_trailing_info), - MaybeMMTablingInfo = no `with_type` maybe(proc_mm_tabling_info), - SharingInfo = structure_sharing_info_init, - ReuseInfo = structure_reuse_info_init, - - ProcSubInfo = proc_sub_info( - MainContext, - ItemNumber, - CanProcess, - MaybeHeadModesConstr, - DetismDecl, - CseNopullContexts, - MaybeUntupleInfo, - VarNameRemap, - StateVarWarnings, - DeletedCallees, - IsAddressTaken, - HasForeignProcExports, - HasParallelConj, - HasUserEvent, - HasTailCallEvent, - OisuKinds, - MaybeRequireTailRecursion, - RegR_HeadVars, - MaybeArgPassInfo, - MaybeSpecialReturn, - InitialLiveness, - StackSlots, - NeedsMaxfrSlot, - MaybeCallTableTip, - MaybeTableIOInfo, - MaybeTableAttrs, - MaybeObsoleteInFavourOf, - MaybeDeepProfProcInfo, - MaybeArgSizes, - MaybeTermInfo, - Term2Info, - MaybeExceptionInfo, - MaybeTrailingInfo, - MaybeMMTablingInfo, - SharingInfo, - ReuseInfo), - - init_var_table(VarTable0), - make_fresh_prefix_named_vars_from_types(ModuleInfo, "HeadVar__", 1, - Types, HeadVars, VarTable0, VarTable), - goal_info_init(GoalInfo), - BodyGoal = hlds_goal(conj(plain_conj, []), GoalInfo), - rtti_varmaps_init(RttiVarMaps), - % argument InstVarSet - % argument DeclaredModes - % argument Modes - MaybeHeadModesConstr = no `with_type` maybe(mode_constraint), - % argument MaybeArgLives - % argument MaybeDeclaredDetism - % Inferred determinism gets initialized to `erroneous'. - % This is what `det_analysis.m' wants. det_analysis.m - % will later provide the correct inferred determinism for it. - InferredDetism = detism_erroneous, - EvalMethod = eval_normal, - - ProcInfo = proc_info( - HeadVars, - BodyGoal, - VarTable, - RttiVarMaps, - InstVarSet, - DeclaredModes, - Modes, - MaybeArgLives, - MaybeDeclaredDetism, - InferredDetism, - EvalMethod, - ProcSubInfo). - -:- pred make_fresh_prefix_named_vars_from_types(module_info::in, - string::in, int::in, list(mer_type)::in, list(prog_var)::out, - var_table::in, var_table::out) is det. - -make_fresh_prefix_named_vars_from_types(_, _, _, [], [], !Info). -make_fresh_prefix_named_vars_from_types(ModuleInfo, BaseName, Num, - [Type | Types], [Var | Vars], !VarTable) :- - make_fresh_prefix_named_var_from_type(ModuleInfo, BaseName, Num, - Type, Var, !VarTable), - make_fresh_prefix_named_vars_from_types(ModuleInfo, BaseName, Num + 1, - Types, Vars, !VarTable). - -:- pred make_fresh_prefix_named_var_from_type(module_info::in, - string::in, int::in, mer_type::in, prog_var::out, - var_table::in, var_table::out) is det. - -make_fresh_prefix_named_var_from_type(ModuleInfo, BaseName, Num, Type, Var, - !VarTable) :- - string.format("%s%d", [s(BaseName), i(Num)], Name), - IsDummy = is_type_a_dummy(ModuleInfo, Type), - Entry = vte(Name, Type, IsDummy), - add_var_entry(Entry, Var, !VarTable). - -%---------------------------------------------------------------------------% - -proc_info_create(Context, ItemNumber, VarTable, HeadVars, - InstVarSet, HeadModes, DetismDecl, Detism, Goal, RttiVarMaps, - IsAddressTaken, HasParallelConj, VarNameRemap, ProcInfo) :- - proc_info_create_with_declared_detism(Context, ItemNumber, - VarTable, HeadVars, InstVarSet, HeadModes, - DetismDecl, yes(Detism), Detism, Goal, RttiVarMaps, IsAddressTaken, - HasParallelConj, VarNameRemap, ProcInfo). - -:- pred proc_info_create_with_declared_detism(prog_context::in, - item_seq_num::in, var_table::in, list(prog_var)::in, - inst_varset::in, list(mer_mode)::in, - detism_decl::in, maybe(determinism)::in, determinism::in, hlds_goal::in, - rtti_varmaps::in, is_address_taken::in, has_parallel_conj::in, - map(prog_var, string)::in, proc_info::out) is det. - -proc_info_create_with_declared_detism(MainContext, ItemNumber, - VarTable, HeadVars, InstVarSet, Modes, - DetismDecl, MaybeDeclaredDetism, Detism, Goal, RttiVarMaps, - IsAddressTaken, HasParallelConj, VarNameRemap, ProcInfo) :- - % See the comment at the top of proc_info_init; it applies here as well. - - % Please use a variable for every field of the proc_info and proc_sub_info, - % and please keep the definitions of those variables in the same order - % as the fields themselves. - - % argument MainContext - % argument ItemNumber - CanProcess = can_process_now, - % argument DetismDecl - CseNopullContexts = [], - MaybeUntupleInfo = no `with_type` maybe(untuple_proc_info), - % argument VarNameRemap - StateVarWarnings = [], - set.init(DeletedCallees), - % argument IsAddressTaken - HasForeignProcExports = no_foreign_exports, - % argument HasParallelConj - HasUserEvent = has_no_user_event, - HasTailCallEvent = has_tail_rec_call(has_no_self_tail_rec_call, - has_no_mutual_tail_rec_call), - OisuKinds = [], - MaybeRequireTailRecursion = no, - set_of_var.init(RegR_HeadVars), - MaybeArgPassInfo = no `with_type` maybe(list(arg_info)), - MaybeSpecialReturn = no `with_type` maybe(special_proc_return), - set_of_var.init(InitialLiveness), - map.init(StackSlots), - NeedsMaxfrSlot = does_not_need_maxfr_slot, - MaybeCallTableTip = no `with_type` maybe(prog_var), - MaybeTableIOInfo = no `with_type` maybe(proc_table_io_info), - MaybeTableAttrs = no `with_type` maybe(table_attributes), - MaybeObsoleteInFavourOf = no `with_type` maybe(list(sym_name_arity)), - MaybeDeepProfProcInfo = no `with_type` maybe(deep_profile_proc_info), - MaybeArgSizes = no `with_type` maybe(arg_size_info), - MaybeTermInfo = no `with_type` maybe(termination_info), - Term2Info = term_constr_main_types.term2_info_init, - MaybeExceptionInfo = no `with_type` maybe(proc_exception_info), - MaybeTrailingInfo = no `with_type` maybe(proc_trailing_info), - MaybeMMTablingInfo = no `with_type` maybe(proc_mm_tabling_info), - SharingInfo = structure_sharing_info_init, - ReuseInfo = structure_reuse_info_init, - - ProcSubInfo = proc_sub_info( - MainContext, - ItemNumber, - CanProcess, - MaybeHeadModesConstr, - DetismDecl, - CseNopullContexts, - MaybeUntupleInfo, - VarNameRemap, - StateVarWarnings, - DeletedCallees, - IsAddressTaken, - HasForeignProcExports, - HasParallelConj, - HasUserEvent, - HasTailCallEvent, - OisuKinds, - MaybeRequireTailRecursion, - RegR_HeadVars, - MaybeArgPassInfo, - MaybeSpecialReturn, - InitialLiveness, - StackSlots, - NeedsMaxfrSlot, - MaybeCallTableTip, - MaybeTableIOInfo, - MaybeTableAttrs, - MaybeObsoleteInFavourOf, - MaybeDeepProfProcInfo, - MaybeArgSizes, - MaybeTermInfo, - Term2Info, - MaybeExceptionInfo, - MaybeTrailingInfo, - MaybeMMTablingInfo, - SharingInfo, - ReuseInfo), - - % argument HeadVars - % argument Goal - % argument VarSet - % argument VarTypes - % argument RttiVarMaps - % argument InstVarSet - DeclaredModes = no, - % argument Modes - MaybeHeadModesConstr = no `with_type` maybe(mode_constraint), - MaybeArgLives = no, - % argument MaybeDeclaredDetism - % argument Detism - EvalMethod = eval_normal, - - ProcInfo = proc_info( - HeadVars, - Goal, - VarTable, - RttiVarMaps, - InstVarSet, - DeclaredModes, - Modes, - MaybeArgLives, - MaybeDeclaredDetism, - Detism, - EvalMethod, - ProcSubInfo). - -proc_prepare_to_clone(ProcInfo, HeadVars, Goal, VarTable, RttiVarMaps, - InstVarSet, DeclaredModes, Modes, MaybeArgLives, - MaybeDeclaredDetism, Detism, EvalMethod, - MainContext, ItemNumber, CanProcess, MaybeHeadModesConstr, DetismDecl, - CseNopullContexts, MaybeUntupleInfo, VarNameRemap, StateVarWarnings, - DeletedCallees, IsAddressTaken, HasForeignProcExports, HasParallelConj, - HasUserEvent, HasTailCallEvent, OisuKinds, MaybeRequireTailRecursion, - RegR_HeadVars, MaybeArgPassInfo, MaybeSpecialReturn, InitialLiveness, - StackSlots, NeedsMaxfrSlot, MaybeCallTableTip, MaybeTableIOInfo, - MaybeTableAttrs, MaybeObsoleteInFavourOf, MaybeDeepProfProcInfo, - MaybeArgSizes, MaybeTermInfo, Term2Info, MaybeExceptionInfo, - MaybeTrailingInfo, MaybeMMTablingInfo, SharingInfo, ReuseInfo) :- - ProcInfo = proc_info( - HeadVars, - Goal, - VarTable, - RttiVarMaps, - InstVarSet, - DeclaredModes, - Modes, - MaybeArgLives, - MaybeDeclaredDetism, - Detism, - EvalMethod, - ProcSubInfo), - ProcSubInfo = proc_sub_info( - MainContext, - ItemNumber, - CanProcess, - MaybeHeadModesConstr, - DetismDecl, - CseNopullContexts, - MaybeUntupleInfo, - VarNameRemap, - StateVarWarnings, - DeletedCallees, - IsAddressTaken, - HasForeignProcExports, - HasParallelConj, - HasUserEvent, - HasTailCallEvent, - OisuKinds, - MaybeRequireTailRecursion, - RegR_HeadVars, - MaybeArgPassInfo, - MaybeSpecialReturn, - InitialLiveness, - StackSlots, - NeedsMaxfrSlot, - MaybeCallTableTip, - MaybeTableIOInfo, - MaybeTableAttrs, - MaybeObsoleteInFavourOf, - MaybeDeepProfProcInfo, - MaybeArgSizes, - MaybeTermInfo, - Term2Info, - MaybeExceptionInfo, - MaybeTrailingInfo, - MaybeMMTablingInfo, - SharingInfo, - ReuseInfo). - -proc_create(HeadVars, Goal, VarTable, RttiVarMaps, - InstVarSet, DeclaredModes, Modes, MaybeArgLives, - MaybeDeclaredDetism, Detism, EvalMethod, - MainContext, ItemNumber, CanProcess, MaybeHeadModesConstr, DetismDecl, - CseNopullContexts, MaybeUntupleInfo, VarNameRemap, StateVarWarnings, - DeletedCallees, IsAddressTaken, HasForeignProcExports, HasParallelConj, - HasUserEvent, HasTailCallEvent, OisuKinds, MaybeRequireTailRecursion, - RegR_HeadVars, MaybeArgPassInfo, MaybeSpecialReturn, InitialLiveness, - StackSlots, NeedsMaxfrSlot, MaybeCallTableTip, MaybeTableIOInfo, - MaybeTableAttrs, MaybeObsoleteInFavourOf, MaybeDeepProfProcInfo, - MaybeArgSizes, MaybeTermInfo, Term2Info, MaybeExceptionInfo, - MaybeTrailingInfo, MaybeMMTablingInfo, SharingInfo, ReuseInfo, - ProcInfo) :- - ProcSubInfo = proc_sub_info( - MainContext, - ItemNumber, - CanProcess, - MaybeHeadModesConstr, - DetismDecl, - CseNopullContexts, - MaybeUntupleInfo, - VarNameRemap, - StateVarWarnings, - DeletedCallees, - IsAddressTaken, - HasForeignProcExports, - HasParallelConj, - HasUserEvent, - HasTailCallEvent, - OisuKinds, - MaybeRequireTailRecursion, - RegR_HeadVars, - MaybeArgPassInfo, - MaybeSpecialReturn, - InitialLiveness, - StackSlots, - NeedsMaxfrSlot, - MaybeCallTableTip, - MaybeTableIOInfo, - MaybeTableAttrs, - MaybeObsoleteInFavourOf, - MaybeDeepProfProcInfo, - MaybeArgSizes, - MaybeTermInfo, - Term2Info, - MaybeExceptionInfo, - MaybeTrailingInfo, - MaybeMMTablingInfo, - SharingInfo, - ReuseInfo), - ProcInfo = proc_info( - HeadVars, - Goal, - VarTable, - RttiVarMaps, - InstVarSet, - DeclaredModes, - Modes, - MaybeArgLives, - MaybeDeclaredDetism, - Detism, - EvalMethod, - ProcSubInfo). - -proc_info_set_body(VarTable, HeadVars, Goal, RttiVarMaps, !ProcInfo) :- - !ProcInfo ^ proc_var_table := VarTable, - !ProcInfo ^ proc_head_vars := HeadVars, - !ProcInfo ^ proc_body := Goal, - !ProcInfo ^ proc_rtti_varmaps := RttiVarMaps. - -proc_info_get_headvars(PI, X) :- - X = PI ^ proc_head_vars. -proc_info_get_goal(PI, X) :- - X = PI ^ proc_body. -proc_info_get_var_table(PI, X) :- - X = PI ^ proc_var_table. -proc_info_get_rtti_varmaps(PI, X) :- - X = PI ^ proc_rtti_varmaps. -proc_info_get_inst_varset(PI, X) :- - X = PI ^ proc_inst_varset. -proc_info_get_maybe_declared_argmodes(PI, X) :- - X = PI ^ proc_maybe_decl_head_modes. -proc_info_get_argmodes(PI, X) :- - X = PI ^ proc_actual_head_modes. -proc_info_get_maybe_arglives(PI, X) :- - X = PI ^ proc_headvar_caller_liveness. -proc_info_get_declared_determinism(PI, X) :- - X = PI ^ proc_declared_detism. -proc_info_get_inferred_determinism(PI, X) :- - X = PI ^ proc_inferred_detism. -proc_info_get_eval_method(PI, X) :- - X = PI ^ proc_eval_method. - -proc_info_get_context(PI, X) :- - X = PI ^ proc_sub_info ^ psi_proc_context. -proc_info_get_item_number(PI, X) :- - X = PI ^ proc_sub_info ^ psi_item_number. -proc_info_get_can_process(PI, X) :- - X = PI ^ proc_sub_info ^ psi_can_process. -proc_info_get_maybe_head_modes_constr(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_head_modes_constr. -proc_info_get_detism_decl(PI, X) :- - X = PI ^ proc_sub_info ^ psi_detism_decl. -proc_info_get_cse_nopull_contexts(PI, X) :- - X = PI ^ proc_sub_info ^ psi_cse_nopull_contexts. -proc_info_get_maybe_untuple_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_untuple_info. -proc_info_get_var_name_remap(PI, X) :- - X = PI ^ proc_sub_info ^ psi_proc_var_name_remap. -proc_info_get_statevar_warnings(PI, X) :- - X = PI ^ proc_sub_info ^ psi_statevar_warnings. -proc_info_get_deleted_call_callees(PI, X) :- - X = PI ^ proc_sub_info ^ psi_deleted_call_callees. -proc_info_get_is_address_taken(PI, X) :- - X = PI ^ proc_sub_info ^ psi_is_address_taken. -proc_info_get_has_any_foreign_exports(PI, X) :- - X = PI ^ proc_sub_info ^ psi_has_any_foreign_exports. -proc_info_get_has_parallel_conj(PI, X) :- - X = PI ^ proc_sub_info ^ psi_proc_has_parallel_conj. -proc_info_get_has_user_event(PI, X) :- - X = PI ^ proc_sub_info ^ psi_proc_has_user_event. -proc_info_get_has_tail_rec_call(PI, X) :- - X = PI ^ proc_sub_info ^ psi_proc_has_tail_rec_call. -proc_info_get_oisu_kind_fors(PI, X) :- - X = PI ^ proc_sub_info ^ psi_oisu_kind_fors. -proc_info_get_maybe_require_tailrec_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_require_tailrec. -proc_info_get_reg_r_headvars(PI, X) :- - X = PI ^ proc_sub_info ^ psi_reg_r_headvars. -proc_info_get_maybe_arg_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_arg_info. -proc_info_get_maybe_special_return(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_special_return. -proc_info_get_liveness_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_initial_liveness. -proc_info_get_stack_slots(PI, X) :- - X = PI ^ proc_sub_info ^ psi_stack_slots. -proc_info_get_needs_maxfr_slot(PI, X) :- - X = PI ^ proc_sub_info ^ psi_needs_maxfr_slot. -proc_info_get_call_table_tip(PI, X) :- - X = PI ^ proc_sub_info ^ psi_call_table_tip. -proc_info_get_maybe_proc_table_io_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_table_io_info. -proc_info_get_table_attributes(PI, X) :- - X = PI ^ proc_sub_info ^ psi_table_attributes. -proc_info_get_obsolete_in_favour_of(PI, X) :- - X = PI ^ proc_sub_info ^ psi_proc_obsolete_in_favour_of. -proc_info_get_maybe_deep_profile_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_deep_prof_info. -proc_info_get_maybe_arg_size_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_arg_sizes. -proc_info_get_maybe_termination_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_maybe_termination. -proc_info_get_termination2_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_termination2. -proc_info_get_exception_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_exception_info. -proc_info_get_trailing_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_trailing_info. -proc_info_get_mm_tabling_info(PI, X) :- - X = PI ^ proc_sub_info ^ psi_mm_tabling_info. - -proc_info_set_headvars(X, !PI) :- - !PI ^ proc_head_vars := X. -proc_info_set_goal(X, !PI) :- - !PI ^ proc_body := X. -proc_info_set_var_table(X, !PI) :- - !PI ^ proc_var_table := X. -proc_info_set_rtti_varmaps(X, !PI) :- - !PI ^ proc_rtti_varmaps := X. -proc_info_set_inst_varset(X, !PI) :- - !PI ^ proc_inst_varset := X. -proc_info_set_maybe_declared_argmodes(X, !PI) :- - !PI ^ proc_maybe_decl_head_modes := X. -proc_info_set_argmodes(X, !PI) :- - !PI ^ proc_actual_head_modes := X. -proc_info_set_maybe_arglives(X, !PI) :- - !PI ^ proc_headvar_caller_liveness := X. -proc_info_set_inferred_determinism(X, !PI) :- - !PI ^ proc_inferred_detism := X. -proc_info_set_eval_method(X, !PI) :- - !PI ^ proc_eval_method := X. - -proc_info_set_can_process(X, !PI) :- - !PI ^ proc_sub_info ^ psi_can_process := X. -proc_info_set_head_modes_constraint(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_head_modes_constr := yes(X). -proc_info_set_detism_decl(X, !PI) :- - !PI ^ proc_sub_info ^ psi_detism_decl := X. -proc_info_set_cse_nopull_contexts(X, !PI) :- - !PI ^ proc_sub_info ^ psi_cse_nopull_contexts := X. -proc_info_set_maybe_untuple_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_untuple_info := X. -proc_info_set_var_name_remap(X, !PI) :- - !PI ^ proc_sub_info ^ psi_proc_var_name_remap := X. -proc_info_set_statevar_warnings(X, !PI) :- - !PI ^ proc_sub_info ^ psi_statevar_warnings := X. -proc_info_set_deleted_call_callees(X, !PI) :- - !PI ^ proc_sub_info ^ psi_deleted_call_callees := X. -proc_info_set_address_taken(X, !PI) :- - !PI ^ proc_sub_info ^ psi_is_address_taken := X. -proc_info_set_has_any_foreign_exports(X, !PI) :- - !PI ^ proc_sub_info ^ psi_has_any_foreign_exports := X. -proc_info_set_has_parallel_conj(X, !PI) :- - !PI ^ proc_sub_info ^ psi_proc_has_parallel_conj := X. -proc_info_set_has_user_event(X, !PI) :- - !PI ^ proc_sub_info ^ psi_proc_has_user_event := X. -proc_info_set_has_tail_rec_call(X, !PI) :- - !PI ^ proc_sub_info ^ psi_proc_has_tail_rec_call := X. -proc_info_set_oisu_kind_fors(X, !PI) :- - !PI ^ proc_sub_info ^ psi_oisu_kind_fors := X. -proc_info_set_require_tailrec_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_require_tailrec := yes(X). -proc_info_set_reg_r_headvars(X, !PI) :- - !PI ^ proc_sub_info ^ psi_reg_r_headvars := X. -proc_info_set_arg_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_arg_info := yes(X). -proc_info_set_maybe_special_return(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_special_return := X. -proc_info_set_liveness_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_initial_liveness := X. -proc_info_set_stack_slots(X, !PI) :- - !PI ^ proc_sub_info ^ psi_stack_slots := X. -proc_info_set_needs_maxfr_slot(X, !PI) :- - !PI ^ proc_sub_info ^ psi_needs_maxfr_slot := X. -proc_info_set_call_table_tip(X, !PI) :- - !PI ^ proc_sub_info ^ psi_call_table_tip := X. -proc_info_set_maybe_proc_table_io_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_table_io_info := X. -proc_info_set_table_attributes(X, !PI) :- - !PI ^ proc_sub_info ^ psi_table_attributes := X. -proc_info_set_obsolete_in_favour_of(X, !PI) :- - !PI ^ proc_sub_info ^ psi_proc_obsolete_in_favour_of := X. -proc_info_set_maybe_deep_profile_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_deep_prof_info := X. -proc_info_set_maybe_arg_size_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_arg_sizes := X. -proc_info_set_maybe_termination_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_maybe_termination := X. -proc_info_set_termination2_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_termination2 := X. -proc_info_set_exception_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_exception_info := X. -proc_info_set_trailing_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_trailing_info := X. -proc_info_set_mm_tabling_info(X, !PI) :- - !PI ^ proc_sub_info ^ psi_mm_tabling_info := X. - -proc_info_get_structure_sharing(ProcInfo, MaybeSharing) :- - MaybeSharing = ProcInfo ^ proc_sub_info ^ psi_structure_sharing - ^ maybe_sharing. - -proc_info_set_structure_sharing(Sharing, !ProcInfo) :- - !ProcInfo ^ proc_sub_info ^ psi_structure_sharing ^ maybe_sharing := - yes(Sharing). - -proc_info_get_imported_structure_sharing(ProcInfo, HeadVars, Types, Sharing) :- - MaybeImportedSharing = ProcInfo ^ proc_sub_info ^ psi_structure_sharing - ^ maybe_imported_sharing, - MaybeImportedSharing = yes(ImportedSharing), - ImportedSharing = imported_sharing(HeadVars, Types, Sharing). - -proc_info_set_imported_structure_sharing(HeadVars, Types, Sharing, - !ProcInfo) :- - ImportedSharing = imported_sharing(HeadVars, Types, Sharing), - MaybeImportedSharing = yes(ImportedSharing), - !ProcInfo ^ proc_sub_info ^ psi_structure_sharing - ^ maybe_imported_sharing := MaybeImportedSharing. - -proc_info_reset_imported_structure_sharing(!ProcInfo) :- - !ProcInfo ^ proc_sub_info ^ psi_structure_sharing - ^ maybe_imported_sharing := no. - -proc_info_get_structure_reuse(ProcInfo, MaybeReuse) :- - MaybeReuse = ProcInfo ^ proc_sub_info ^ psi_structure_reuse ^ maybe_reuse. - -proc_info_set_structure_reuse(Reuse, !ProcInfo) :- - !ProcInfo ^ proc_sub_info ^ psi_structure_reuse ^ maybe_reuse - := yes(Reuse). - -proc_info_get_imported_structure_reuse(ProcInfo, HeadVars, Types, Reuse) :- - MaybeImportedReuse = ProcInfo ^ proc_sub_info ^ psi_structure_reuse - ^ maybe_imported_reuse, - MaybeImportedReuse = yes(ImportedReuse), - ImportedReuse = imported_reuse(HeadVars, Types, Reuse). - -proc_info_set_imported_structure_reuse(HeadVars, Types, Reuse, !ProcInfo) :- - ImportedReuse = imported_reuse(HeadVars, Types, Reuse), - MaybeImportedReuse = yes(ImportedReuse), - !ProcInfo ^ proc_sub_info ^ psi_structure_reuse ^ maybe_imported_reuse := - MaybeImportedReuse. - -proc_info_reset_imported_structure_reuse(!ProcInfo) :- - !ProcInfo ^ proc_sub_info ^ psi_structure_reuse - ^ maybe_imported_reuse := no. - proc_interface_should_use_typeinfo_liveness(PredInfo, ProcId, Globals, InterfaceTypeInfoLiveness) :- PredModule = pred_info_module(PredInfo), diff --git a/compiler/hlds_proc.m b/compiler/hlds_proc.m new file mode 100644 index 000000000..8e487e8e1 --- /dev/null +++ b/compiler/hlds_proc.m @@ -0,0 +1,1292 @@ +%---------------------------------------------------------------------------% +% vim: ft=mercury ts=4 sw=4 et +%---------------------------------------------------------------------------% +% Copyright (C) 1996-2012 The University of Melbourne. +% Copyright (C) 2013-2026 The Mercury team. +% This file may only be copied under the terms of the GNU General +% Public License - see the file COPYING in the Mercury distribution. +%---------------------------------------------------------------------------% +% +% File: hlds_pred.m. +% Main authors: fjh, conway. +% +% This module defines the part of the HLDS that deals with procedures. +% +%---------------------------------------------------------------------------% + +:- module hlds.hlds_proc. +:- interface. + +:- import_module check_hlds. +:- import_module check_hlds.mode_constraint_robdd. +:- import_module hlds.hlds_goal. +:- import_module hlds.hlds_llds. +:- import_module hlds.hlds_module. +:- import_module hlds.hlds_rtti. +:- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. +:- import_module hlds.proc_info_types. +:- import_module parse_tree. +:- import_module parse_tree.error_spec. +:- import_module parse_tree.prog_data. +:- import_module parse_tree.prog_data_pragma. +:- import_module parse_tree.set_of_var. +:- import_module parse_tree.var_table. +:- import_module transform_hlds. +:- import_module transform_hlds.term_constr_main_types. +:- import_module transform_hlds.term_util. + +:- import_module list. +:- import_module map. +:- import_module maybe. +:- import_module set. + +:- implementation. + +:- import_module hlds.type_util. +:- import_module parse_tree.prog_type. + +:- import_module int. +:- import_module string. +:- import_module term. +:- import_module unit. +:- import_module varset. + +%---------------------------------------------------------------------------% + +:- interface. + +:- type proc_info. + +%---------------------------------------------------------------------------% +%---------------------------------------------------------------------------% + +:- implementation. + +%---------------------------------------------------------------------------% +%---------------------------------------------------------------------------% + + % Various predicates for accessing the proc_info data structure, + % and the types they work with. + +:- interface. + + % Exported to hlds_pred.m only. + % +:- pred proc_info_init(module_info::in, prog_context::in, item_seq_num::in, + list(mer_type)::in, inst_varset::in, maybe(list(mer_mode))::in, + list(mer_mode)::in, maybe(list(is_live))::in, + detism_decl::in, maybe(determinism)::in, is_address_taken::in, + has_parallel_conj::in, map(prog_var, string)::in, proc_info::out) is det. + +:- pred proc_info_create(prog_context::in, item_seq_num::in, + var_table::in, list(prog_var)::in, + inst_varset::in, list(mer_mode)::in, + detism_decl::in, determinism::in, hlds_goal::in, + rtti_varmaps::in, is_address_taken::in, has_parallel_conj::in, + map(prog_var, string)::in, proc_info::out) is det. + + % Exported to hlds_pred.m only. + % +:- pred proc_info_create_with_declared_detism(prog_context::in, + item_seq_num::in, var_table::in, list(prog_var)::in, + inst_varset::in, list(mer_mode)::in, + detism_decl::in, maybe(determinism)::in, determinism::in, hlds_goal::in, + rtti_varmaps::in, is_address_taken::in, has_parallel_conj::in, + map(prog_var, string)::in, proc_info::out) is det. + +%---------------------% + +% proc_prepare_to_clone returns all the fields of an existing proc_info, +% while proc_create constructs a new proc_info putting the supplied values +% to each field. +% +% These predicates exist because we want keep the definition of the proc_info +% type private (to make future changes easier), but we also want to make it +% possible to create slightly modified copies of existing procedures +% with the least amount of programming work. We also want to require +% (a) programmers writing such cloning code to consider what effect +% the modification may have on *all* fields of the proc_info, and +% (b) programmers who add new fields to the proc_info to update +% all the places in the compiler that do such cloning. + +:- pred proc_prepare_to_clone(proc_info::in, list(prog_var)::out, + hlds_goal::out, var_table::out, rtti_varmaps::out, + inst_varset::out, maybe(list(mer_mode))::out, list(mer_mode)::out, + maybe(list(is_live))::out, maybe(determinism)::out, determinism::out, + eval_method::out, prog_context::out, item_seq_num::out, + can_process::out, maybe(mode_constraint)::out, detism_decl::out, + list(prog_context)::out, maybe(untuple_proc_info)::out, + map(prog_var, string)::out, list(warn_spec)::out, set(pred_proc_id)::out, + is_address_taken::out, proc_foreign_exports::out, has_parallel_conj::out, + has_user_event::out, has_tail_rec_call::out, list(oisu_pred_kind_for)::out, + maybe(require_tail_recursion)::out, set_of_progvar::out, + maybe(list(arg_info))::out, maybe(special_proc_return)::out, + liveness_info::out, stack_slots::out, needs_maxfr_slot::out, + maybe(prog_var)::out, maybe(proc_table_io_info)::out, + maybe(table_attributes)::out, maybe(list(sym_name_arity))::out, + maybe(deep_profile_proc_info)::out, maybe(arg_size_info)::out, + maybe(termination_info)::out, termination2_info::out, + maybe(proc_exception_info)::out, maybe(proc_trailing_info)::out, + maybe(proc_mm_tabling_info)::out, structure_sharing_info::out, + structure_reuse_info::out) is det. + +:- pred proc_create(list(prog_var)::in, + hlds_goal::in, var_table::in, rtti_varmaps::in, + inst_varset::in, maybe(list(mer_mode))::in, list(mer_mode)::in, + maybe(list(is_live))::in, maybe(determinism)::in, determinism::in, + eval_method::in, prog_context::in, item_seq_num::in, can_process::in, + maybe(mode_constraint)::in, detism_decl::in, + list(prog_context)::in, maybe(untuple_proc_info)::in, + map(prog_var, string)::in, list(warn_spec)::in, set(pred_proc_id)::in, + is_address_taken::in, proc_foreign_exports::in, has_parallel_conj::in, + has_user_event::in, has_tail_rec_call::in, list(oisu_pred_kind_for)::in, + maybe(require_tail_recursion)::in, set_of_progvar::in, + maybe(list(arg_info))::in, maybe(special_proc_return)::in, + liveness_info::in, stack_slots::in, needs_maxfr_slot::in, + maybe(prog_var)::in, maybe(proc_table_io_info)::in, + maybe(table_attributes)::in, maybe(list(sym_name_arity))::in, + maybe(deep_profile_proc_info)::in, maybe(arg_size_info)::in, + maybe(termination_info)::in, termination2_info::in, + maybe(proc_exception_info)::in, maybe(proc_trailing_info)::in, + maybe(proc_mm_tabling_info)::in, structure_sharing_info::in, + structure_reuse_info::in, proc_info::out) is det. + +%---------------------% + +:- pred proc_info_set_body(var_table::in, + list(prog_var)::in, hlds_goal::in, rtti_varmaps::in, + proc_info::in, proc_info::out) is det. + + % Predicates to get fields of proc_infos. + +:- pred proc_info_get_headvars(proc_info::in, list(prog_var)::out) is det. +:- pred proc_info_get_goal(proc_info::in, hlds_goal::out) is det. +:- pred proc_info_get_var_table(proc_info::in, var_table::out) is det. +:- pred proc_info_get_rtti_varmaps(proc_info::in, rtti_varmaps::out) is det. +:- pred proc_info_get_inst_varset(proc_info::in, inst_varset::out) is det. +:- pred proc_info_get_maybe_declared_argmodes(proc_info::in, + maybe(list(mer_mode))::out) is det. +:- pred proc_info_get_argmodes(proc_info::in, list(mer_mode)::out) is det. +:- pred proc_info_get_maybe_arglives(proc_info::in, + maybe(list(is_live))::out) is det. +:- pred proc_info_get_declared_determinism(proc_info::in, + maybe(determinism)::out) is det. +:- pred proc_info_get_inferred_determinism(proc_info::in, + determinism::out) is det. +:- pred proc_info_get_eval_method(proc_info::in, eval_method::out) is det. + +:- pred proc_info_get_context(proc_info::in, prog_context::out) is det. +:- pred proc_info_get_item_number(proc_info::in, item_seq_num::out) is det. +:- pred proc_info_get_can_process(proc_info::in, can_process::out) is det. +:- pred proc_info_get_maybe_head_modes_constr(proc_info::in, + maybe(mode_constraint)::out) is det. +:- pred proc_info_get_detism_decl(proc_info::in, detism_decl::out) is det. +:- pred proc_info_get_cse_nopull_contexts(proc_info::in, + list(prog_context)::out) is det. +:- pred proc_info_get_maybe_untuple_info(proc_info::in, + maybe(untuple_proc_info)::out) is det. +:- pred proc_info_get_var_name_remap(proc_info::in, + map(prog_var, string)::out) is det. +:- pred proc_info_get_statevar_warnings(proc_info::in, + list(warn_spec)::out) is det. +:- pred proc_info_get_deleted_call_callees(proc_info::in, + set(pred_proc_id)::out) is det. +:- pred proc_info_get_is_address_taken(proc_info::in, + is_address_taken::out) is det. +:- pred proc_info_get_has_any_foreign_exports(proc_info::in, + proc_foreign_exports::out) is det. +:- pred proc_info_get_has_parallel_conj(proc_info::in, + has_parallel_conj::out) is det. +:- pred proc_info_get_has_user_event(proc_info::in, + has_user_event::out) is det. +:- pred proc_info_get_has_tail_rec_call(proc_info::in, + has_tail_rec_call::out) is det. +:- pred proc_info_get_oisu_kind_fors(proc_info::in, + list(oisu_pred_kind_for)::out) is det. +:- pred proc_info_get_maybe_require_tailrec_info(proc_info::in, + maybe(require_tail_recursion)::out) is det. +:- pred proc_info_get_reg_r_headvars(proc_info::in, + set_of_progvar::out) is det. +:- pred proc_info_get_maybe_arg_info(proc_info::in, + maybe(list(arg_info))::out) is det. +:- pred proc_info_get_maybe_special_return(proc_info::in, + maybe(special_proc_return)::out) is det. +:- pred proc_info_get_liveness_info(proc_info::in, liveness_info::out) is det. +:- pred proc_info_get_stack_slots(proc_info::in, stack_slots::out) is det. +:- pred proc_info_get_needs_maxfr_slot(proc_info::in, + needs_maxfr_slot::out) is det. +:- pred proc_info_get_call_table_tip(proc_info::in, + maybe(prog_var)::out) is det. +:- pred proc_info_get_maybe_proc_table_io_info(proc_info::in, + maybe(proc_table_io_info)::out) is det. +:- pred proc_info_get_table_attributes(proc_info::in, + maybe(table_attributes)::out) is det. +:- pred proc_info_get_obsolete_in_favour_of(proc_info::in, + maybe(list(sym_name_arity))::out) is det. +:- pred proc_info_get_maybe_deep_profile_info(proc_info::in, + maybe(deep_profile_proc_info)::out) is det. +:- pred proc_info_get_maybe_arg_size_info(proc_info::in, + maybe(arg_size_info)::out) is det. +:- pred proc_info_get_maybe_termination_info(proc_info::in, + maybe(termination_info)::out) is det. +:- pred proc_info_get_termination2_info(proc_info::in, + termination2_info::out) is det. +:- pred proc_info_get_exception_info(proc_info::in, + maybe(proc_exception_info)::out) is det. +:- pred proc_info_get_trailing_info(proc_info::in, + maybe(proc_trailing_info)::out) is det. +:- pred proc_info_get_mm_tabling_info(proc_info::in, + maybe(proc_mm_tabling_info)::out) is det. + + % Predicates to set fields of proc_infos. + +:- pred proc_info_set_headvars(list(prog_var)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_goal(hlds_goal::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_var_table(var_table::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_rtti_varmaps(rtti_varmaps::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_inst_varset(inst_varset::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_declared_argmodes(maybe(list(mer_mode))::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_argmodes(list(mer_mode)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_arglives(maybe(list(is_live))::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_inferred_determinism(determinism::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_eval_method(eval_method::in, + proc_info::in, proc_info::out) is det. + +:- pred proc_info_set_can_process(can_process::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_head_modes_constraint(mode_constraint::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_detism_decl(detism_decl::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_cse_nopull_contexts(list(prog_context)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_untuple_info(maybe(untuple_proc_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_var_name_remap(map(prog_var, string)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_statevar_warnings(list(warn_spec)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_deleted_call_callees(set(pred_proc_id)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_address_taken(is_address_taken::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_has_any_foreign_exports(proc_foreign_exports::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_has_parallel_conj(has_parallel_conj::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_has_user_event(has_user_event::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_has_tail_rec_call(has_tail_rec_call::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_oisu_kind_fors(list(oisu_pred_kind_for)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_require_tailrec_info(require_tail_recursion::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_reg_r_headvars(set_of_progvar::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_arg_info(list(arg_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_special_return(maybe(special_proc_return)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_liveness_info(liveness_info::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_stack_slots(stack_slots::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_needs_maxfr_slot(needs_maxfr_slot::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_call_table_tip(maybe(prog_var)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_proc_table_io_info(maybe(proc_table_io_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_table_attributes(maybe(table_attributes)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_obsolete_in_favour_of( + maybe(list(sym_name_arity))::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_deep_profile_info( + maybe(deep_profile_proc_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_arg_size_info(maybe(arg_size_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_maybe_termination_info(maybe(termination_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_termination2_info(termination2_info::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_exception_info(maybe(proc_exception_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_trailing_info(maybe(proc_trailing_info)::in, + proc_info::in, proc_info::out) is det. +:- pred proc_info_set_mm_tabling_info(maybe(proc_mm_tabling_info)::in, + proc_info::in, proc_info::out) is det. + +:- pred proc_info_get_structure_sharing(proc_info::in, + maybe(structure_sharing_domain_and_status)::out) is det. + +:- pred proc_info_set_structure_sharing( + structure_sharing_domain_and_status::in, + proc_info::in, proc_info::out) is det. + +:- pred proc_info_get_imported_structure_sharing(proc_info::in, + list(prog_var)::out, list(mer_type)::out, structure_sharing_domain::out) + is semidet. + +:- pred proc_info_set_imported_structure_sharing(list(prog_var)::in, + list(mer_type)::in, structure_sharing_domain::in, proc_info::in, + proc_info::out) is det. + +:- pred proc_info_reset_imported_structure_sharing(proc_info::in, + proc_info::out) is det. + +:- pred proc_info_get_structure_reuse(proc_info::in, + maybe(structure_reuse_domain_and_status)::out) is det. + +:- pred proc_info_set_structure_reuse(structure_reuse_domain_and_status::in, + proc_info::in, proc_info::out) is det. + +:- pred proc_info_get_imported_structure_reuse(proc_info::in, + list(prog_var)::out, list(mer_type)::out, structure_reuse_domain::out) + is semidet. + +:- pred proc_info_set_imported_structure_reuse(list(prog_var)::in, + list(mer_type)::in, structure_reuse_domain::in, + proc_info::in, proc_info::out) is det. + +:- pred proc_info_reset_imported_structure_reuse(proc_info::in, + proc_info::out) is det. + +:- implementation. + + % The information specific to a procedure, as opposed to a predicate. + % + % The proc_info and proc_sub_info types constitute a single logical + % data structure split into two parts for efficiency purposes. + % + % The proc_info type contains the most frequently accessed and/or updated + % pieces of information about the procedure. Everything else is in the + % proc_sub_info type. This arrangement minimizes the amount of memory that + % needs to be allocated, and filled in, when a field is updated. + +:- type proc_info + ---> proc_info( + % The Boehm collector allocates blocks whose sizes are + % multiples (and usually powers) of 2. Ideally, we would want + % the number of fields of proc_info to match one of the Boehm + % block sizes, but as of 2017 march 15, this seemed to be the + % optimal arrangement (zs). + +/* 1 */ proc_head_vars :: list(prog_var), +/* 2 */ proc_body :: hlds_goal, + +/* 3 */ proc_var_table :: var_table, + + % Information about type_infos and typeclass_infos. +/* 4 */ proc_rtti_varmaps :: rtti_varmaps, + +/* 5 */ proc_inst_varset :: inst_varset, + + % The declared modes of arguments. +/* 6 */ proc_maybe_decl_head_modes :: maybe(list(mer_mode)), + +/* 7 */ proc_actual_head_modes :: list(mer_mode), + + % Liveness (in the mode analysis sense) of the arguments + % in the caller; says whether each argument may be used + % after the call. +/* 8 */ proc_headvar_caller_liveness :: maybe(list(is_live)), + + % The _declared_ determinism of the procedure, or `no' + % if there was no detism declaration. +/* 9 */ proc_declared_detism :: maybe(determinism), +/* 10 */ proc_inferred_detism :: determinism, + + % How should the proc be evaluated. +/* 11 */ proc_eval_method :: eval_method, + +/* 12 */ proc_sub_info :: proc_sub_info + ). + +:- type proc_sub_info + ---> proc_sub_info( + % The context of the `:- mode' decl, or the context of the + % first clause if there was no mode declaration. + psi_proc_context :: prog_context, + + % The item number of the mode declaration, if there was one. + psi_item_number :: item_seq_num, + + % Set to cannot_process if we must not process this procedure + % just yet. This is used to delay mode checking etc. for + % complicated modes of unification predicates until the end + % of the unique_modes pass. + psi_can_process :: can_process, + + % XXX The mode of the procedure in the ROBDD based + % constraint system. Whether it represents the declared + % or the actual mode is unclear, but since that constraint + % system is obsolete, this does not much matter :-( + psi_maybe_head_modes_constr :: maybe(mode_constraint), + + % Was the determinism declaration explicit, or was it implicit, + % as for functions? + psi_detism_decl :: detism_decl, + + % A list of all the contexts at which cse_detection.m + % declined to pull out a common deconstruction out of + % a branched control structure due to concerns about + % uniqueness in the inst of the affected variable. + % Determinism analysis wants this information so that + % it knows whether to mention this fact to the user + % as a possible cause of a determinism error. + % See Mantis bug #496. + psi_cse_nopull_contexts :: list(prog_context), + + % If set, it means this procedure was created from another + % procedure by the untupling transformation. This slot records + % which of the procedure's arguments were derived from which + % arguments in the original procedure. + % + % This is effectively a record of the *procedure*'s origin. + % (The pred_origin field records the *predicate*'s origin.) + psi_maybe_untuple_info :: maybe(untuple_proc_info), + + % Remaps the compiler-created variables named HeadVar__N + % to the user-given variable names that actually occupied the + % corresponding argument slots in the procedure's clauses. + % Has an entry for a head variable only if *all* the clauses + % consistently give that argument that name, if they give it + % any name at all. + % This renaming is applied only after semantic analysis, + % although it is recorded earlier. The reason for this is + % to make any error messages about the goals that unify the + % original headvar (e.g. "X") with the introduced headvar + % (e.g. "HeadVar__1") give the goal as HeadVar__1 = X, + % not as X = X, since the latter would be very confusing. + psi_proc_var_name_remap :: map(prog_var, string), + + % Any warnings generated by the state variable transformation + % that we should print only if we find a mode error that could + % be caused by the problem being warned about. + psi_statevar_warnings :: list(warn_spec), + + % The set of procedures that the body of this procedure + % *used* to call, but doesn't anymore. This can happen + % For several reason. These reasons include the call being + % - inside a trace goal scope whose compile-time condition + % turned out to be false, + % - in the then part of an if-then-else whose condition + % never succeeds, + % - in the else part of an if-then-else whose condition + % never fails. + % We record the callees of the deleted calls so that + % dead procedure analysis does not generate warnings + % for these procedures, or the other procedures reachable + % from them. + psi_deleted_call_callees :: set(pred_proc_id), + + %-----------------------------------------------------------% + % Flags that record simple properties of the procedure. + %-----------------------------------------------------------% + + % Is the address of this procedure taken? If yes, we will + % need to use typeinfo liveness for them, so that deep_copy + % and accurate gc have the RTTI they need for copying closures. + % + % Note that any non-local procedure must be considered + % as having its address taken, since it is possible that + % some other module may do so. + psi_is_address_taken :: is_address_taken, + + % Is the procedure mentioned in any foreign_export pragma, + % regardless of what the current supported foreign languages + % are? + psi_has_any_foreign_exports :: proc_foreign_exports, + + % Does this procedure contain parallel conjunction? + % If yes, it should be run through the dependent parallel + % conjunction transformation. + % + % This slot is set by the simplification pass. + % Note that after some optimization passes, this flag + % may be a conservative approximation. + psi_proc_has_parallel_conj :: has_parallel_conj, + + % Does this procedure contain a user event? + % + % This slot is set by the simplification pass. + psi_proc_has_user_event :: has_user_event, + + psi_proc_has_tail_rec_call :: has_tail_rec_call, + + % Is the procedure mentioned in any order-independent-state- + % update pragmas? If yes, list the role of this procedure + % for the each of the types in those pragmas. + psi_oisu_kind_fors :: list(oisu_pred_kind_for), + + % Has the user requested (via a require_tail_recursion + % pragma) that we suppress or enable warnings about tail + % recursion for this procedure? + psi_maybe_require_tailrec :: maybe(require_tail_recursion), + + %-----------------------------------------------------------% + % Information needed by the LLDS code generator. + %-----------------------------------------------------------% + + % The head variables which must be forced to use regular + % registers by the calling convention, despite having type + % float. This is only meaningful with float registers. + psi_reg_r_headvars :: set_of_progvar, + + % The calling convention of each argument: information computed + % by arg_info.m (based on the modes etc.) and used by code + % generation to determine how each argument should be passed. + psi_maybe_arg_info :: maybe(list(arg_info)), + + psi_maybe_special_return :: maybe(special_proc_return), + + % The initial liveness, for code generation. + psi_initial_liveness :: liveness_info, + + % Allocation of variables to stack slots. + psi_stack_slots :: stack_slots, + + % True iff tracing is enabled, this is a procedure that lives + % on the det stack, and the code of this procedure may create + % a frame on the det stack. (Only in these circumstances do we + % need to reserve a stack slot to hold the value of maxfr + % at the call, for use in implementing retry.) This slot + % is used only with the LLDS backend XXX. Its value is set + % during the live_vars pass; it is invalid before then. + psi_needs_maxfr_slot :: needs_maxfr_slot, + + %-----------------------------------------------------------% + % Information needed for tabling. + %-----------------------------------------------------------% + + % If the procedure's evaluation method is memo, loopcheck or + % minimal, this slot identifies the variable that holds the tip + % of the call table. Otherwise, this field will be set to `no'. + % + % Tabled procedures record, in the data structure identified + % by this variable, that the call is active. When performing + % a retry across such a procedure, we must reset the state + % of the call; if we don't, the retried call will find the + % active call and report an infinite loop error. + % + % Such resetting of course requires the debugger to know + % whether the procedure has reached the call table tip yet. + % Therefore when binding this variable, the code generator + % of the relevant backend must record this fact in a place + % accessible to the debugger, if debugging is enabled. + psi_call_table_tip :: maybe(prog_var), + + % If set, it means that procedure has been subject to the I/O + % tabling transformation. The argument will contain all the + % information we need to display I/O actions involving + % this procedure. + % + % (If the procedure has been subject to other kinds of tabling + % transformations, the corresponding information will be + % recorded in a map in the module_info.) + % XXX For now, the compiler fully supports only procedures + % whose arguments are all either ints, floats or strings. + % However, this is still sufficient for debugging most problems + % in the tabling system. + psi_maybe_table_io_info :: maybe(proc_table_io_info), + + psi_table_attributes :: maybe(table_attributes), + + % If this procedure is marked as obsolete, this will be a + % "yes(_)" wrapped around a list of the predicate names that + % the compiler should suggest as possible replacements. + % (Note that the list of possible replacements may be empty.) + % In the usual case where this predicate is NOT marked + % as obsolete, this will be "no". + psi_proc_obsolete_in_favour_of :: maybe(list( + sym_name_arity)), + + %-----------------------------------------------------------% + % Information needed for deep profiling. + %-----------------------------------------------------------% + + psi_maybe_deep_prof_info :: maybe(deep_profile_proc_info), + + %-----------------------------------------------------------% + % The results of program analyses. + %-----------------------------------------------------------% + + % Information about the relative sizes of the input and output + % args of the procedure. Set by termination analysis. + psi_maybe_arg_sizes :: maybe(arg_size_info), + + % The termination properties of the procedure. + % Set by termination analysis. + psi_maybe_termination :: maybe(termination_info), + + % Termination properties and argument size constraints for + % the procedure. Set by termination2 analysis. + psi_termination2 :: termination2_info, + + % The results of the analyses in exception_analysis.m, + % trailing_analysis.m and tabling_analysis, if available. + psi_exception_info :: maybe(proc_exception_info), + psi_trailing_info :: maybe(proc_trailing_info), + psi_mm_tabling_info :: maybe(proc_mm_tabling_info), + + % Structure sharing information as obtained by the structure + % sharing analysis. + psi_structure_sharing :: structure_sharing_info, + + % Structure reuse conditions obtained by the structure reuse + % analysis (CTGC). + psi_structure_reuse :: structure_reuse_info + ). + +%---------------------------------------------------------------------------% + +proc_info_init(ModuleInfo, MainContext, ItemNumber, Types, InstVarSet, + DeclaredModes, Modes, MaybeArgLives, DetismDecl, MaybeDeclaredDetism, + IsAddressTaken, HasParallelConj, VarNameRemap, ProcInfo) :- + % When this predicate is invoked during the construction of the HLDS, + % some parts of the procedure aren't known yet. In that case, we can + % simply initialize them to any old garbage which we will later throw away. + % + % However, when this predicate is invoked by HLDS transformation passes + % after the front-end has finished, this strategy won't work. We need + % to fill in every field with meaningful, correct information, unless + % we know for sure that before the next pass that needs the correct value + % in a field, we will invoke another pass that fills in the correct value + % in that field. + % + % XXX I (zs) am far from sure that all the field initializations below, + % in this predicate and in proc_info_create_with_declared_detism, + % fulfill this condition. + + % Please use a variable for every field of the proc_info and proc_sub_info, + % and please keep the definitions of those variables in the same order + % as the fields themselves. + + % argument MainContext + % argument ItemNumber + CanProcess = can_process_now, + % argument DetismDecl + CseNopullContexts = [], + MaybeUntupleInfo = no `with_type` maybe(untuple_proc_info), + % argument VarNameRemap + StateVarWarnings = [], + set.init(DeletedCallees), + % argument IsAddressTaken + HasForeignProcExports = no_foreign_exports, + % argument HasParallelConj + HasUserEvent = has_no_user_event, + HasTailCallEvent = has_tail_rec_call(has_no_self_tail_rec_call, + has_no_mutual_tail_rec_call), + OisuKinds = [], + MaybeRequireTailRecursion = no, + set_of_var.init(RegR_HeadVars), + MaybeArgPassInfo = no `with_type` maybe(list(arg_info)), + MaybeSpecialReturn = no `with_type` maybe(special_proc_return), + set_of_var.init(InitialLiveness), + map.init(StackSlots), + NeedsMaxfrSlot = does_not_need_maxfr_slot, + MaybeCallTableTip = no `with_type` maybe(prog_var), + MaybeTableIOInfo = no `with_type` maybe(proc_table_io_info), + MaybeTableAttrs = no `with_type` maybe(table_attributes), + MaybeObsoleteInFavourOf = no `with_type` maybe(list(sym_name_arity)), + MaybeDeepProfProcInfo = no `with_type` maybe(deep_profile_proc_info), + MaybeArgSizes = no `with_type` maybe(arg_size_info), + MaybeTermInfo = no `with_type` maybe(termination_info), + Term2Info = term_constr_main_types.term2_info_init, + MaybeExceptionInfo = no `with_type` maybe(proc_exception_info), + MaybeTrailingInfo = no `with_type` maybe(proc_trailing_info), + MaybeMMTablingInfo = no `with_type` maybe(proc_mm_tabling_info), + SharingInfo = structure_sharing_info_init, + ReuseInfo = structure_reuse_info_init, + + ProcSubInfo = proc_sub_info( + MainContext, + ItemNumber, + CanProcess, + MaybeHeadModesConstr, + DetismDecl, + CseNopullContexts, + MaybeUntupleInfo, + VarNameRemap, + StateVarWarnings, + DeletedCallees, + IsAddressTaken, + HasForeignProcExports, + HasParallelConj, + HasUserEvent, + HasTailCallEvent, + OisuKinds, + MaybeRequireTailRecursion, + RegR_HeadVars, + MaybeArgPassInfo, + MaybeSpecialReturn, + InitialLiveness, + StackSlots, + NeedsMaxfrSlot, + MaybeCallTableTip, + MaybeTableIOInfo, + MaybeTableAttrs, + MaybeObsoleteInFavourOf, + MaybeDeepProfProcInfo, + MaybeArgSizes, + MaybeTermInfo, + Term2Info, + MaybeExceptionInfo, + MaybeTrailingInfo, + MaybeMMTablingInfo, + SharingInfo, + ReuseInfo), + + init_var_table(VarTable0), + make_fresh_prefix_named_vars_from_types(ModuleInfo, "HeadVar__", 1, + Types, HeadVars, VarTable0, VarTable), + goal_info_init(GoalInfo), + BodyGoal = hlds_goal(conj(plain_conj, []), GoalInfo), + rtti_varmaps_init(RttiVarMaps), + % argument InstVarSet + % argument DeclaredModes + % argument Modes + MaybeHeadModesConstr = no `with_type` maybe(mode_constraint), + % argument MaybeArgLives + % argument MaybeDeclaredDetism + % Inferred determinism gets initialized to `erroneous'. + % This is what `det_analysis.m' wants. det_analysis.m + % will later provide the correct inferred determinism for it. + InferredDetism = detism_erroneous, + EvalMethod = eval_normal, + + ProcInfo = proc_info( + HeadVars, + BodyGoal, + VarTable, + RttiVarMaps, + InstVarSet, + DeclaredModes, + Modes, + MaybeArgLives, + MaybeDeclaredDetism, + InferredDetism, + EvalMethod, + ProcSubInfo). + +:- pred make_fresh_prefix_named_vars_from_types(module_info::in, + string::in, int::in, list(mer_type)::in, list(prog_var)::out, + var_table::in, var_table::out) is det. + +make_fresh_prefix_named_vars_from_types(_, _, _, [], [], !Info). +make_fresh_prefix_named_vars_from_types(ModuleInfo, BaseName, Num, + [Type | Types], [Var | Vars], !VarTable) :- + make_fresh_prefix_named_var_from_type(ModuleInfo, BaseName, Num, + Type, Var, !VarTable), + make_fresh_prefix_named_vars_from_types(ModuleInfo, BaseName, Num + 1, + Types, Vars, !VarTable). + +:- pred make_fresh_prefix_named_var_from_type(module_info::in, + string::in, int::in, mer_type::in, prog_var::out, + var_table::in, var_table::out) is det. + +make_fresh_prefix_named_var_from_type(ModuleInfo, BaseName, Num, Type, Var, + !VarTable) :- + string.format("%s%d", [s(BaseName), i(Num)], Name), + IsDummy = is_type_a_dummy(ModuleInfo, Type), + Entry = vte(Name, Type, IsDummy), + add_var_entry(Entry, Var, !VarTable). + +%---------------------------------------------------------------------------% + +proc_info_create(Context, ItemNumber, VarTable, HeadVars, + InstVarSet, HeadModes, DetismDecl, Detism, Goal, RttiVarMaps, + IsAddressTaken, HasParallelConj, VarNameRemap, ProcInfo) :- + proc_info_create_with_declared_detism(Context, ItemNumber, + VarTable, HeadVars, InstVarSet, HeadModes, + DetismDecl, yes(Detism), Detism, Goal, RttiVarMaps, IsAddressTaken, + HasParallelConj, VarNameRemap, ProcInfo). + +proc_info_create_with_declared_detism(MainContext, ItemNumber, + VarTable, HeadVars, InstVarSet, Modes, + DetismDecl, MaybeDeclaredDetism, Detism, Goal, RttiVarMaps, + IsAddressTaken, HasParallelConj, VarNameRemap, ProcInfo) :- + % See the comment at the top of proc_info_init; it applies here as well. + + % Please use a variable for every field of the proc_info and proc_sub_info, + % and please keep the definitions of those variables in the same order + % as the fields themselves. + + % argument MainContext + % argument ItemNumber + CanProcess = can_process_now, + % argument DetismDecl + CseNopullContexts = [], + MaybeUntupleInfo = no `with_type` maybe(untuple_proc_info), + % argument VarNameRemap + StateVarWarnings = [], + set.init(DeletedCallees), + % argument IsAddressTaken + HasForeignProcExports = no_foreign_exports, + % argument HasParallelConj + HasUserEvent = has_no_user_event, + HasTailCallEvent = has_tail_rec_call(has_no_self_tail_rec_call, + has_no_mutual_tail_rec_call), + OisuKinds = [], + MaybeRequireTailRecursion = no, + set_of_var.init(RegR_HeadVars), + MaybeArgPassInfo = no `with_type` maybe(list(arg_info)), + MaybeSpecialReturn = no `with_type` maybe(special_proc_return), + set_of_var.init(InitialLiveness), + map.init(StackSlots), + NeedsMaxfrSlot = does_not_need_maxfr_slot, + MaybeCallTableTip = no `with_type` maybe(prog_var), + MaybeTableIOInfo = no `with_type` maybe(proc_table_io_info), + MaybeTableAttrs = no `with_type` maybe(table_attributes), + MaybeObsoleteInFavourOf = no `with_type` maybe(list(sym_name_arity)), + MaybeDeepProfProcInfo = no `with_type` maybe(deep_profile_proc_info), + MaybeArgSizes = no `with_type` maybe(arg_size_info), + MaybeTermInfo = no `with_type` maybe(termination_info), + Term2Info = term_constr_main_types.term2_info_init, + MaybeExceptionInfo = no `with_type` maybe(proc_exception_info), + MaybeTrailingInfo = no `with_type` maybe(proc_trailing_info), + MaybeMMTablingInfo = no `with_type` maybe(proc_mm_tabling_info), + SharingInfo = structure_sharing_info_init, + ReuseInfo = structure_reuse_info_init, + + ProcSubInfo = proc_sub_info( + MainContext, + ItemNumber, + CanProcess, + MaybeHeadModesConstr, + DetismDecl, + CseNopullContexts, + MaybeUntupleInfo, + VarNameRemap, + StateVarWarnings, + DeletedCallees, + IsAddressTaken, + HasForeignProcExports, + HasParallelConj, + HasUserEvent, + HasTailCallEvent, + OisuKinds, + MaybeRequireTailRecursion, + RegR_HeadVars, + MaybeArgPassInfo, + MaybeSpecialReturn, + InitialLiveness, + StackSlots, + NeedsMaxfrSlot, + MaybeCallTableTip, + MaybeTableIOInfo, + MaybeTableAttrs, + MaybeObsoleteInFavourOf, + MaybeDeepProfProcInfo, + MaybeArgSizes, + MaybeTermInfo, + Term2Info, + MaybeExceptionInfo, + MaybeTrailingInfo, + MaybeMMTablingInfo, + SharingInfo, + ReuseInfo), + + % argument HeadVars + % argument Goal + % argument VarSet + % argument VarTypes + % argument RttiVarMaps + % argument InstVarSet + DeclaredModes = no, + % argument Modes + MaybeHeadModesConstr = no `with_type` maybe(mode_constraint), + MaybeArgLives = no, + % argument MaybeDeclaredDetism + % argument Detism + EvalMethod = eval_normal, + + ProcInfo = proc_info( + HeadVars, + Goal, + VarTable, + RttiVarMaps, + InstVarSet, + DeclaredModes, + Modes, + MaybeArgLives, + MaybeDeclaredDetism, + Detism, + EvalMethod, + ProcSubInfo). + +proc_prepare_to_clone(ProcInfo, HeadVars, Goal, VarTable, RttiVarMaps, + InstVarSet, DeclaredModes, Modes, MaybeArgLives, + MaybeDeclaredDetism, Detism, EvalMethod, + MainContext, ItemNumber, CanProcess, MaybeHeadModesConstr, DetismDecl, + CseNopullContexts, MaybeUntupleInfo, VarNameRemap, StateVarWarnings, + DeletedCallees, IsAddressTaken, HasForeignProcExports, HasParallelConj, + HasUserEvent, HasTailCallEvent, OisuKinds, MaybeRequireTailRecursion, + RegR_HeadVars, MaybeArgPassInfo, MaybeSpecialReturn, InitialLiveness, + StackSlots, NeedsMaxfrSlot, MaybeCallTableTip, MaybeTableIOInfo, + MaybeTableAttrs, MaybeObsoleteInFavourOf, MaybeDeepProfProcInfo, + MaybeArgSizes, MaybeTermInfo, Term2Info, MaybeExceptionInfo, + MaybeTrailingInfo, MaybeMMTablingInfo, SharingInfo, ReuseInfo) :- + ProcInfo = proc_info( + HeadVars, + Goal, + VarTable, + RttiVarMaps, + InstVarSet, + DeclaredModes, + Modes, + MaybeArgLives, + MaybeDeclaredDetism, + Detism, + EvalMethod, + ProcSubInfo), + ProcSubInfo = proc_sub_info( + MainContext, + ItemNumber, + CanProcess, + MaybeHeadModesConstr, + DetismDecl, + CseNopullContexts, + MaybeUntupleInfo, + VarNameRemap, + StateVarWarnings, + DeletedCallees, + IsAddressTaken, + HasForeignProcExports, + HasParallelConj, + HasUserEvent, + HasTailCallEvent, + OisuKinds, + MaybeRequireTailRecursion, + RegR_HeadVars, + MaybeArgPassInfo, + MaybeSpecialReturn, + InitialLiveness, + StackSlots, + NeedsMaxfrSlot, + MaybeCallTableTip, + MaybeTableIOInfo, + MaybeTableAttrs, + MaybeObsoleteInFavourOf, + MaybeDeepProfProcInfo, + MaybeArgSizes, + MaybeTermInfo, + Term2Info, + MaybeExceptionInfo, + MaybeTrailingInfo, + MaybeMMTablingInfo, + SharingInfo, + ReuseInfo). + +proc_create(HeadVars, Goal, VarTable, RttiVarMaps, + InstVarSet, DeclaredModes, Modes, MaybeArgLives, + MaybeDeclaredDetism, Detism, EvalMethod, + MainContext, ItemNumber, CanProcess, MaybeHeadModesConstr, DetismDecl, + CseNopullContexts, MaybeUntupleInfo, VarNameRemap, StateVarWarnings, + DeletedCallees, IsAddressTaken, HasForeignProcExports, HasParallelConj, + HasUserEvent, HasTailCallEvent, OisuKinds, MaybeRequireTailRecursion, + RegR_HeadVars, MaybeArgPassInfo, MaybeSpecialReturn, InitialLiveness, + StackSlots, NeedsMaxfrSlot, MaybeCallTableTip, MaybeTableIOInfo, + MaybeTableAttrs, MaybeObsoleteInFavourOf, MaybeDeepProfProcInfo, + MaybeArgSizes, MaybeTermInfo, Term2Info, MaybeExceptionInfo, + MaybeTrailingInfo, MaybeMMTablingInfo, SharingInfo, ReuseInfo, + ProcInfo) :- + ProcSubInfo = proc_sub_info( + MainContext, + ItemNumber, + CanProcess, + MaybeHeadModesConstr, + DetismDecl, + CseNopullContexts, + MaybeUntupleInfo, + VarNameRemap, + StateVarWarnings, + DeletedCallees, + IsAddressTaken, + HasForeignProcExports, + HasParallelConj, + HasUserEvent, + HasTailCallEvent, + OisuKinds, + MaybeRequireTailRecursion, + RegR_HeadVars, + MaybeArgPassInfo, + MaybeSpecialReturn, + InitialLiveness, + StackSlots, + NeedsMaxfrSlot, + MaybeCallTableTip, + MaybeTableIOInfo, + MaybeTableAttrs, + MaybeObsoleteInFavourOf, + MaybeDeepProfProcInfo, + MaybeArgSizes, + MaybeTermInfo, + Term2Info, + MaybeExceptionInfo, + MaybeTrailingInfo, + MaybeMMTablingInfo, + SharingInfo, + ReuseInfo), + ProcInfo = proc_info( + HeadVars, + Goal, + VarTable, + RttiVarMaps, + InstVarSet, + DeclaredModes, + Modes, + MaybeArgLives, + MaybeDeclaredDetism, + Detism, + EvalMethod, + ProcSubInfo). + +proc_info_set_body(VarTable, HeadVars, Goal, RttiVarMaps, !ProcInfo) :- + !ProcInfo ^ proc_var_table := VarTable, + !ProcInfo ^ proc_head_vars := HeadVars, + !ProcInfo ^ proc_body := Goal, + !ProcInfo ^ proc_rtti_varmaps := RttiVarMaps. + +proc_info_get_headvars(PI, X) :- + X = PI ^ proc_head_vars. +proc_info_get_goal(PI, X) :- + X = PI ^ proc_body. +proc_info_get_var_table(PI, X) :- + X = PI ^ proc_var_table. +proc_info_get_rtti_varmaps(PI, X) :- + X = PI ^ proc_rtti_varmaps. +proc_info_get_inst_varset(PI, X) :- + X = PI ^ proc_inst_varset. +proc_info_get_maybe_declared_argmodes(PI, X) :- + X = PI ^ proc_maybe_decl_head_modes. +proc_info_get_argmodes(PI, X) :- + X = PI ^ proc_actual_head_modes. +proc_info_get_maybe_arglives(PI, X) :- + X = PI ^ proc_headvar_caller_liveness. +proc_info_get_declared_determinism(PI, X) :- + X = PI ^ proc_declared_detism. +proc_info_get_inferred_determinism(PI, X) :- + X = PI ^ proc_inferred_detism. +proc_info_get_eval_method(PI, X) :- + X = PI ^ proc_eval_method. + +proc_info_get_context(PI, X) :- + X = PI ^ proc_sub_info ^ psi_proc_context. +proc_info_get_item_number(PI, X) :- + X = PI ^ proc_sub_info ^ psi_item_number. +proc_info_get_can_process(PI, X) :- + X = PI ^ proc_sub_info ^ psi_can_process. +proc_info_get_maybe_head_modes_constr(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_head_modes_constr. +proc_info_get_detism_decl(PI, X) :- + X = PI ^ proc_sub_info ^ psi_detism_decl. +proc_info_get_cse_nopull_contexts(PI, X) :- + X = PI ^ proc_sub_info ^ psi_cse_nopull_contexts. +proc_info_get_maybe_untuple_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_untuple_info. +proc_info_get_var_name_remap(PI, X) :- + X = PI ^ proc_sub_info ^ psi_proc_var_name_remap. +proc_info_get_statevar_warnings(PI, X) :- + X = PI ^ proc_sub_info ^ psi_statevar_warnings. +proc_info_get_deleted_call_callees(PI, X) :- + X = PI ^ proc_sub_info ^ psi_deleted_call_callees. +proc_info_get_is_address_taken(PI, X) :- + X = PI ^ proc_sub_info ^ psi_is_address_taken. +proc_info_get_has_any_foreign_exports(PI, X) :- + X = PI ^ proc_sub_info ^ psi_has_any_foreign_exports. +proc_info_get_has_parallel_conj(PI, X) :- + X = PI ^ proc_sub_info ^ psi_proc_has_parallel_conj. +proc_info_get_has_user_event(PI, X) :- + X = PI ^ proc_sub_info ^ psi_proc_has_user_event. +proc_info_get_has_tail_rec_call(PI, X) :- + X = PI ^ proc_sub_info ^ psi_proc_has_tail_rec_call. +proc_info_get_oisu_kind_fors(PI, X) :- + X = PI ^ proc_sub_info ^ psi_oisu_kind_fors. +proc_info_get_maybe_require_tailrec_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_require_tailrec. +proc_info_get_reg_r_headvars(PI, X) :- + X = PI ^ proc_sub_info ^ psi_reg_r_headvars. +proc_info_get_maybe_arg_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_arg_info. +proc_info_get_maybe_special_return(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_special_return. +proc_info_get_liveness_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_initial_liveness. +proc_info_get_stack_slots(PI, X) :- + X = PI ^ proc_sub_info ^ psi_stack_slots. +proc_info_get_needs_maxfr_slot(PI, X) :- + X = PI ^ proc_sub_info ^ psi_needs_maxfr_slot. +proc_info_get_call_table_tip(PI, X) :- + X = PI ^ proc_sub_info ^ psi_call_table_tip. +proc_info_get_maybe_proc_table_io_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_table_io_info. +proc_info_get_table_attributes(PI, X) :- + X = PI ^ proc_sub_info ^ psi_table_attributes. +proc_info_get_obsolete_in_favour_of(PI, X) :- + X = PI ^ proc_sub_info ^ psi_proc_obsolete_in_favour_of. +proc_info_get_maybe_deep_profile_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_deep_prof_info. +proc_info_get_maybe_arg_size_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_arg_sizes. +proc_info_get_maybe_termination_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_maybe_termination. +proc_info_get_termination2_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_termination2. +proc_info_get_exception_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_exception_info. +proc_info_get_trailing_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_trailing_info. +proc_info_get_mm_tabling_info(PI, X) :- + X = PI ^ proc_sub_info ^ psi_mm_tabling_info. + +proc_info_set_headvars(X, !PI) :- + !PI ^ proc_head_vars := X. +proc_info_set_goal(X, !PI) :- + !PI ^ proc_body := X. +proc_info_set_var_table(X, !PI) :- + !PI ^ proc_var_table := X. +proc_info_set_rtti_varmaps(X, !PI) :- + !PI ^ proc_rtti_varmaps := X. +proc_info_set_inst_varset(X, !PI) :- + !PI ^ proc_inst_varset := X. +proc_info_set_maybe_declared_argmodes(X, !PI) :- + !PI ^ proc_maybe_decl_head_modes := X. +proc_info_set_argmodes(X, !PI) :- + !PI ^ proc_actual_head_modes := X. +proc_info_set_maybe_arglives(X, !PI) :- + !PI ^ proc_headvar_caller_liveness := X. +proc_info_set_inferred_determinism(X, !PI) :- + !PI ^ proc_inferred_detism := X. +proc_info_set_eval_method(X, !PI) :- + !PI ^ proc_eval_method := X. + +proc_info_set_can_process(X, !PI) :- + !PI ^ proc_sub_info ^ psi_can_process := X. +proc_info_set_head_modes_constraint(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_head_modes_constr := yes(X). +proc_info_set_detism_decl(X, !PI) :- + !PI ^ proc_sub_info ^ psi_detism_decl := X. +proc_info_set_cse_nopull_contexts(X, !PI) :- + !PI ^ proc_sub_info ^ psi_cse_nopull_contexts := X. +proc_info_set_maybe_untuple_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_untuple_info := X. +proc_info_set_var_name_remap(X, !PI) :- + !PI ^ proc_sub_info ^ psi_proc_var_name_remap := X. +proc_info_set_statevar_warnings(X, !PI) :- + !PI ^ proc_sub_info ^ psi_statevar_warnings := X. +proc_info_set_deleted_call_callees(X, !PI) :- + !PI ^ proc_sub_info ^ psi_deleted_call_callees := X. +proc_info_set_address_taken(X, !PI) :- + !PI ^ proc_sub_info ^ psi_is_address_taken := X. +proc_info_set_has_any_foreign_exports(X, !PI) :- + !PI ^ proc_sub_info ^ psi_has_any_foreign_exports := X. +proc_info_set_has_parallel_conj(X, !PI) :- + !PI ^ proc_sub_info ^ psi_proc_has_parallel_conj := X. +proc_info_set_has_user_event(X, !PI) :- + !PI ^ proc_sub_info ^ psi_proc_has_user_event := X. +proc_info_set_has_tail_rec_call(X, !PI) :- + !PI ^ proc_sub_info ^ psi_proc_has_tail_rec_call := X. +proc_info_set_oisu_kind_fors(X, !PI) :- + !PI ^ proc_sub_info ^ psi_oisu_kind_fors := X. +proc_info_set_require_tailrec_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_require_tailrec := yes(X). +proc_info_set_reg_r_headvars(X, !PI) :- + !PI ^ proc_sub_info ^ psi_reg_r_headvars := X. +proc_info_set_arg_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_arg_info := yes(X). +proc_info_set_maybe_special_return(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_special_return := X. +proc_info_set_liveness_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_initial_liveness := X. +proc_info_set_stack_slots(X, !PI) :- + !PI ^ proc_sub_info ^ psi_stack_slots := X. +proc_info_set_needs_maxfr_slot(X, !PI) :- + !PI ^ proc_sub_info ^ psi_needs_maxfr_slot := X. +proc_info_set_call_table_tip(X, !PI) :- + !PI ^ proc_sub_info ^ psi_call_table_tip := X. +proc_info_set_maybe_proc_table_io_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_table_io_info := X. +proc_info_set_table_attributes(X, !PI) :- + !PI ^ proc_sub_info ^ psi_table_attributes := X. +proc_info_set_obsolete_in_favour_of(X, !PI) :- + !PI ^ proc_sub_info ^ psi_proc_obsolete_in_favour_of := X. +proc_info_set_maybe_deep_profile_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_deep_prof_info := X. +proc_info_set_maybe_arg_size_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_arg_sizes := X. +proc_info_set_maybe_termination_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_maybe_termination := X. +proc_info_set_termination2_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_termination2 := X. +proc_info_set_exception_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_exception_info := X. +proc_info_set_trailing_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_trailing_info := X. +proc_info_set_mm_tabling_info(X, !PI) :- + !PI ^ proc_sub_info ^ psi_mm_tabling_info := X. + +proc_info_get_structure_sharing(ProcInfo, MaybeSharing) :- + MaybeSharing = ProcInfo ^ proc_sub_info ^ psi_structure_sharing + ^ maybe_sharing. + +proc_info_set_structure_sharing(Sharing, !ProcInfo) :- + !ProcInfo ^ proc_sub_info ^ psi_structure_sharing ^ maybe_sharing := + yes(Sharing). + +proc_info_get_imported_structure_sharing(ProcInfo, HeadVars, Types, Sharing) :- + MaybeImportedSharing = ProcInfo ^ proc_sub_info ^ psi_structure_sharing + ^ maybe_imported_sharing, + MaybeImportedSharing = yes(ImportedSharing), + ImportedSharing = imported_sharing(HeadVars, Types, Sharing). + +proc_info_set_imported_structure_sharing(HeadVars, Types, Sharing, + !ProcInfo) :- + ImportedSharing = imported_sharing(HeadVars, Types, Sharing), + MaybeImportedSharing = yes(ImportedSharing), + !ProcInfo ^ proc_sub_info ^ psi_structure_sharing + ^ maybe_imported_sharing := MaybeImportedSharing. + +proc_info_reset_imported_structure_sharing(!ProcInfo) :- + !ProcInfo ^ proc_sub_info ^ psi_structure_sharing + ^ maybe_imported_sharing := no. + +proc_info_get_structure_reuse(ProcInfo, MaybeReuse) :- + MaybeReuse = ProcInfo ^ proc_sub_info ^ psi_structure_reuse ^ maybe_reuse. + +proc_info_set_structure_reuse(Reuse, !ProcInfo) :- + !ProcInfo ^ proc_sub_info ^ psi_structure_reuse ^ maybe_reuse + := yes(Reuse). + +proc_info_get_imported_structure_reuse(ProcInfo, HeadVars, Types, Reuse) :- + MaybeImportedReuse = ProcInfo ^ proc_sub_info ^ psi_structure_reuse + ^ maybe_imported_reuse, + MaybeImportedReuse = yes(ImportedReuse), + ImportedReuse = imported_reuse(HeadVars, Types, Reuse). + +proc_info_set_imported_structure_reuse(HeadVars, Types, Reuse, !ProcInfo) :- + ImportedReuse = imported_reuse(HeadVars, Types, Reuse), + MaybeImportedReuse = yes(ImportedReuse), + !ProcInfo ^ proc_sub_info ^ psi_structure_reuse ^ maybe_imported_reuse := + MaybeImportedReuse. + +proc_info_reset_imported_structure_reuse(!ProcInfo) :- + !ProcInfo ^ proc_sub_info ^ psi_structure_reuse + ^ maybe_imported_reuse := no. + +%---------------------------------------------------------------------------% +:- end_module hlds.hlds_proc. +%---------------------------------------------------------------------------% diff --git a/compiler/hlds_proc_util.m b/compiler/hlds_proc_util.m index 88ece5b03..90cf78470 100644 --- a/compiler/hlds_proc_util.m +++ b/compiler/hlds_proc_util.m @@ -19,8 +19,10 @@ :- import_module check_hlds.mode_constraint_robdd. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. diff --git a/compiler/hlds_promise.m b/compiler/hlds_promise.m index 898b0b8e4..bbb2c04f6 100644 --- a/compiler/hlds_promise.m +++ b/compiler/hlds_promise.m @@ -16,7 +16,7 @@ :- module hlds.hlds_promise. :- interface. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module list. diff --git a/compiler/hlds_rtti.m b/compiler/hlds_rtti.m index e2078a356..6fa17154c 100644 --- a/compiler/hlds_rtti.m +++ b/compiler/hlds_rtti.m @@ -19,9 +19,9 @@ :- interface. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. @@ -319,6 +319,8 @@ :- implementation. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.mode_top_functor. :- import_module parse_tree.prog_type_scan. @@ -363,7 +365,7 @@ make_rtti_proc_label(ModuleInfo, PredId, ProcId) = ProcLabel :- PredIsImported = yes ; PredIsPseudoImp = yes, - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) ) then ProcIsImported = yes diff --git a/compiler/hlds_statistics.m b/compiler/hlds_statistics.m index f9dba7fd9..466c47b98 100644 --- a/compiler/hlds_statistics.m +++ b/compiler/hlds_statistics.m @@ -45,7 +45,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. diff --git a/compiler/implementation_defined_literals.m b/compiler/implementation_defined_literals.m index a23579761..7ba23b8bf 100644 --- a/compiler/implementation_defined_literals.m +++ b/compiler/implementation_defined_literals.m @@ -35,6 +35,7 @@ :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. :- import_module hlds.make_goal. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. diff --git a/compiler/inlining.m b/compiler/inlining.m index ee0208079..899afe867 100644 --- a/compiler/inlining.m +++ b/compiler/inlining.m @@ -86,7 +86,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.var_table. @@ -1170,7 +1172,7 @@ can_inline_proc_2(ModuleInfo, PredId, ProcId, BuiltinState, HighLevelCode, % for imported types. not ( pred_info_is_pseudo_imported(PredInfo), - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) ), % Only try to inline procedures which are evaluated using normal diff --git a/compiler/input_specialization.m b/compiler/input_specialization.m index 84577b081..dbddcadc6 100644 --- a/compiler/input_specialization.m +++ b/compiler/input_specialization.m @@ -57,8 +57,10 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_util. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.maybe_util. :- import_module mdbcomp. diff --git a/compiler/instance_method_clauses.m b/compiler/instance_method_clauses.m index 12aec4ace..1439ecaac 100644 --- a/compiler/instance_method_clauses.m +++ b/compiler/instance_method_clauses.m @@ -45,12 +45,12 @@ :- import_module hlds.hlds_args. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.make_hlds.add_clause. :- import_module hlds.make_hlds.state_var. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp.sym_name. :- import_module parse_tree.maybe_error. :- import_module parse_tree.prog_item. diff --git a/compiler/intermod.m b/compiler/intermod.m index 05ef1de15..94d1bba8b 100644 --- a/compiler/intermod.m +++ b/compiler/intermod.m @@ -137,7 +137,9 @@ :- import_module hlds.hlds_out.hlds_out_pred. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module hlds.var_table_hlds. :- import_module libs. diff --git a/compiler/intermod_analysis.m b/compiler/intermod_analysis.m index b6f11afde..77c8262ac 100644 --- a/compiler/intermod_analysis.m +++ b/compiler/intermod_analysis.m @@ -65,6 +65,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_item_pragma. :- import_module parse_tree.prog_parse_tree. @@ -140,6 +141,7 @@ :- implementation. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.pred_name. :- import_module hlds.proc_info_types. diff --git a/compiler/intermod_decide.m b/compiler/intermod_decide.m index d8ae696fa..8099249e1 100644 --- a/compiler/intermod_decide.m +++ b/compiler/intermod_decide.m @@ -51,8 +51,10 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_promise. :- import_module hlds.mode_test. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.special_pred. :- import_module hlds.status. diff --git a/compiler/intermod_info.m b/compiler/intermod_info.m index 351801de0..b00f2cbfa 100644 --- a/compiler/intermod_info.m +++ b/compiler/intermod_info.m @@ -22,7 +22,7 @@ :- import_module hlds.hlds_class. :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. diff --git a/compiler/intermod_mark_exported.m b/compiler/intermod_mark_exported.m index 452cfb376..6b760bc09 100644 --- a/compiler/intermod_mark_exported.m +++ b/compiler/intermod_mark_exported.m @@ -61,6 +61,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_pred. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.special_pred. :- import_module hlds.status. diff --git a/compiler/intermod_order_pred_info.m b/compiler/intermod_order_pred_info.m index decff7bb2..953218e2c 100644 --- a/compiler/intermod_order_pred_info.m +++ b/compiler/intermod_order_pred_info.m @@ -18,6 +18,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module parse_tree. diff --git a/compiler/introduce_exists_casts.m b/compiler/introduce_exists_casts.m index 9489c7c47..4bb5eb2e5 100644 --- a/compiler/introduce_exists_casts.m +++ b/compiler/introduce_exists_casts.m @@ -11,7 +11,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module list. @@ -39,6 +39,8 @@ :- import_module check_hlds.clause_to_proc. :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.mode_test. :- import_module hlds.mode_util. diff --git a/compiler/introduce_parallelism.m b/compiler/introduce_parallelism.m index 4b0d07053..64fd75591 100644 --- a/compiler/introduce_parallelism.m +++ b/compiler/introduce_parallelism.m @@ -45,8 +45,10 @@ :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module libs. diff --git a/compiler/lambda.m b/compiler/lambda.m index 58fa7af53..5c09bebee 100644 --- a/compiler/lambda.m +++ b/compiler/lambda.m @@ -137,11 +137,13 @@ :- import_module hlds.code_model. :- import_module hlds.goal_util. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.mode_test. :- import_module hlds.mode_util. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module hlds.status. diff --git a/compiler/layout_out.m b/compiler/layout_out.m index 0d4ca2182..ebc40d710 100644 --- a/compiler/layout_out.m +++ b/compiler/layout_out.m @@ -191,7 +191,6 @@ :- import_module backend_libs.c_util. :- import_module backend_libs.name_mangle. :- import_module backend_libs.proc_label. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.pred_name. :- import_module libs. diff --git a/compiler/lco.m b/compiler/lco.m index d674b0bdf..3d4b65295 100644 --- a/compiler/lco.m +++ b/compiler/lco.m @@ -179,6 +179,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_lookup. :- import_module hlds.inst_test. @@ -187,6 +188,7 @@ :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module hlds.status. diff --git a/compiler/live_vars.m b/compiler/live_vars.m index d7f43d730..d65c07d3a 100644 --- a/compiler/live_vars.m +++ b/compiler/live_vars.m @@ -27,7 +27,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.set_of_var. :- import_module parse_tree.var_table. @@ -74,6 +75,7 @@ :- import_module hlds.arg_info. :- import_module hlds.code_model. :- import_module hlds.goal_form. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module parse_tree.prog_data. diff --git a/compiler/liveness.m b/compiler/liveness.m index 91a5661cc..3355a1148 100644 --- a/compiler/liveness.m +++ b/compiler/liveness.m @@ -162,6 +162,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.set_of_var. diff --git a/compiler/llds.m b/compiler/llds.m index 0f186e3da..9fdd98c18 100644 --- a/compiler/llds.m +++ b/compiler/llds.m @@ -27,7 +27,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.trace_params. diff --git a/compiler/llds_out_file.m b/compiler/llds_out_file.m index 4f8d2060f..2074eb39f 100644 --- a/compiler/llds_out_file.m +++ b/compiler/llds_out_file.m @@ -75,7 +75,7 @@ :- import_module backend_libs.rtti. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs.compiler_util. :- import_module libs.file_util. :- import_module libs.optimization_options. diff --git a/compiler/llds_out_instr.m b/compiler/llds_out_instr.m index 4251d540d..56294e774 100644 --- a/compiler/llds_out_instr.m +++ b/compiler/llds_out_instr.m @@ -86,7 +86,7 @@ :- import_module backend_libs.name_mangle. :- import_module hlds. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.optimization_options. :- import_module ll_backend.foreign_proc_gen. @@ -481,7 +481,7 @@ output_float_dword_assignment(Info, Stream, Lval, Rval, !IO) :- output_debug_instruction_and_comment(Info, Stream, Instr, Comment, !IO) :- DummyModule = unqualified("DEBUG"), DummyPredName = "DEBUG", - proc_id_to_int(hlds_pred.initial_proc_id, InitialProcIdInt), + proc_id_to_int(initial_proc_id, InitialProcIdInt), ProcLabel = ordinary_proc_label(DummyModule, pf_predicate, DummyModule, DummyPredName, 0, InitialProcIdInt), CallerLabel = entry_label(entry_label_local, ProcLabel), @@ -499,7 +499,7 @@ output_debug_instruction_and_comment(Info, Stream, Instr, Comment, !IO) :- output_debug_instruction(Info, Stream, Instr, !IO) :- DummyModule = unqualified("DEBUG"), DummyPredName = "DEBUG", - proc_id_to_int(hlds_pred.initial_proc_id, InitialProcIdInt), + proc_id_to_int(initial_proc_id, InitialProcIdInt), ProcLabel = ordinary_proc_label(DummyModule, pf_predicate, DummyModule, DummyPredName, 0, InitialProcIdInt), CallerLabel = entry_label(entry_label_local, ProcLabel), diff --git a/compiler/llds_out_util.m b/compiler/llds_out_util.m index bcf16c8d7..13a0131aa 100644 --- a/compiler/llds_out_util.m +++ b/compiler/llds_out_util.m @@ -19,7 +19,7 @@ :- import_module backend_libs. :- import_module backend_libs.rtti. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module libs.optimization_options. diff --git a/compiler/loop_inv.m b/compiler/loop_inv.m index 4918cdcd4..ea15060c5 100644 --- a/compiler/loop_inv.m +++ b/compiler/loop_inv.m @@ -101,6 +101,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. %-----------------------------------------------------------------------------% @@ -842,7 +844,7 @@ gen_aux_proc(InvGoals, PredProcId, AuxPredProcId, Replacement, Body, % Put the new proc body and instmap into the module_info. AuxPredProcId = proc(AuxPredId, AuxProcId), - hlds_pred.proc_info_set_goal(AuxBody, !AuxProcInfo), + proc_info_set_goal(AuxBody, !AuxProcInfo), requantify_proc_general(ord_nl_no_lambda, !AuxProcInfo), recompute_instmap_delta_proc(no_recomp_atomics, !AuxProcInfo, !ModuleInfo), module_info_set_pred_proc_info(AuxPredId, AuxProcId, diff --git a/compiler/make_goal.m b/compiler/make_goal.m index 6942295e1..da446eb06 100644 --- a/compiler/make_goal.m +++ b/compiler/make_goal.m @@ -17,7 +17,7 @@ :- interface. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. diff --git a/compiler/make_hlds_error.m b/compiler/make_hlds_error.m index 94503a3f1..5599cd620 100644 --- a/compiler/make_hlds_error.m +++ b/compiler/make_hlds_error.m @@ -22,6 +22,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/make_hlds_passes.m b/compiler/make_hlds_passes.m index 1e94c17e9..2ec582d6c 100644 --- a/compiler/make_hlds_passes.m +++ b/compiler/make_hlds_passes.m @@ -67,6 +67,7 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_data. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_hlds.add_class. :- import_module hlds.make_hlds.add_clause. :- import_module hlds.make_hlds.add_foreign_proc. @@ -84,6 +85,7 @@ :- import_module hlds.make_hlds.make_hlds_warn. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.special_pred. :- import_module hlds.status. diff --git a/compiler/make_hlds_warn.m b/compiler/make_hlds_warn.m index 870037ef1..9da4aaf57 100644 --- a/compiler/make_hlds_warn.m +++ b/compiler/make_hlds_warn.m @@ -93,7 +93,6 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. -:- import_module hlds.hlds_pred. :- import_module libs.options. :- import_module parse_tree.parse_tree_out_misc. :- import_module parse_tree.parse_tree_out_term. diff --git a/compiler/mark_static_terms.m b/compiler/mark_static_terms.m index 5c102f23d..5d1163b82 100644 --- a/compiler/mark_static_terms.m +++ b/compiler/mark_static_terms.m @@ -39,7 +39,7 @@ :- implementation. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. :- import_module libs. :- import_module libs.file_util. diff --git a/compiler/mark_tail_calls.m b/compiler/mark_tail_calls.m index 009df997b..9347c0f3a 100644 --- a/compiler/mark_tail_calls.m +++ b/compiler/mark_tail_calls.m @@ -42,6 +42,8 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.compiler_util. :- import_module libs.dependency_graph. diff --git a/compiler/mark_trace_goals.m b/compiler/mark_trace_goals.m index b5b61c669..23cea4e17 100644 --- a/compiler/mark_trace_goals.m +++ b/compiler/mark_trace_goals.m @@ -43,7 +43,6 @@ :- implementation. :- import_module hlds.hlds_markers. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.options. :- import_module mdbcomp. diff --git a/compiler/mercury_compile_front_end.m b/compiler/mercury_compile_front_end.m index 55c48fce3..f5a828f29 100644 --- a/compiler/mercury_compile_front_end.m +++ b/compiler/mercury_compile_front_end.m @@ -135,6 +135,7 @@ :- import_module hlds.hlds_statistics. :- import_module hlds.implementation_defined_literals. :- import_module hlds.input_specialization. +:- import_module hlds.pred_proc_id. :- import_module libs.file_util. :- import_module libs.globals. :- import_module libs.optimization_options. diff --git a/compiler/mercury_compile_llds_back_end.m b/compiler/mercury_compile_llds_back_end.m index 9344e65a9..bd5c9caf5 100644 --- a/compiler/mercury_compile_llds_back_end.m +++ b/compiler/mercury_compile_llds_back_end.m @@ -78,7 +78,9 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mark_tail_calls. +:- import_module hlds.pred_proc_id. :- import_module libs.dependency_graph. :- import_module libs.file_util. :- import_module libs.optimization_options. diff --git a/compiler/ml_accurate_gc.m b/compiler/ml_accurate_gc.m index 7b72883b9..30ffa889e 100644 --- a/compiler/ml_accurate_gc.m +++ b/compiler/ml_accurate_gc.m @@ -87,7 +87,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. @@ -369,7 +371,7 @@ ml_gen_trace_var(Info, VarName, Type, TypeInfoRval, Context, TraceStmt) :- PredFormArity = pred_form_arity(1), PredLabel = mlds_user_pred_label(pf_predicate, no, PredName, PredFormArity), - ProcId = hlds_pred.initial_proc_id, + ProcId = initial_proc_id, PredModule = mercury_private_builtin_module, MLDS_Module = mercury_module_name_to_mlds(PredModule), ProcLabel = mlds_proc_label(PredLabel, ProcId), diff --git a/compiler/ml_args_util.m b/compiler/ml_args_util.m index fcd595844..bfc73acaf 100644 --- a/compiler/ml_args_util.m +++ b/compiler/ml_args_util.m @@ -19,9 +19,9 @@ :- import_module hlds. :- import_module hlds.code_model. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_gen_info. @@ -337,6 +337,8 @@ :- implementation. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_top_functor. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/ml_call_gen.m b/compiler/ml_call_gen.m index 07e9cbdaa..dcf49004d 100644 --- a/compiler/ml_call_gen.m +++ b/compiler/ml_call_gen.m @@ -22,8 +22,8 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. -:- import_module hlds.hlds_pred. :- import_module hlds.mark_tail_calls. % for nontail_rec_call_reason +:- import_module hlds.pred_proc_id. :- import_module ml_backend.ml_args_util. :- import_module ml_backend.ml_gen_info. :- import_module ml_backend.mlds. @@ -85,6 +85,8 @@ :- import_module backend_libs.builtin_ops. :- import_module hlds.hlds_class. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.type_util. :- import_module mdbcomp. diff --git a/compiler/ml_closure_gen.m b/compiler/ml_closure_gen.m index f2395838c..b0daac39e 100644 --- a/compiler/ml_closure_gen.m +++ b/compiler/ml_closure_gen.m @@ -20,7 +20,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module ml_backend.ml_gen_info. :- import_module ml_backend.mlds. :- import_module parse_tree. @@ -83,6 +83,8 @@ :- import_module backend_libs.rtti. :- import_module hlds.code_model. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mark_tail_calls. % for ntrcr_program :- import_module hlds.pred_info_types. :- import_module hlds.type_util. diff --git a/compiler/ml_code_util.m b/compiler/ml_code_util.m index 0c9323e92..fd8419a09 100644 --- a/compiler/ml_code_util.m +++ b/compiler/ml_code_util.m @@ -25,8 +25,8 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module ml_backend.ml_gen_info. @@ -803,7 +803,7 @@ ml_gen_pred_label_from_rtti(_ModuleInfo, RttiProcLabel, MLDS_PredLabel, ( if ThisModule \= TypeModule, SpecialPred = spec_pred_unify, - not hlds_pred.in_in_unification_proc_id(ProcId) + not in_in_unification_proc_id(ProcId) then % This is a locally-defined instance of a unification procedure % for a type defined in some other module. diff --git a/compiler/ml_elim_nested.m b/compiler/ml_elim_nested.m index dd8aa69e1..094573faf 100644 --- a/compiler/ml_elim_nested.m +++ b/compiler/ml_elim_nested.m @@ -453,7 +453,7 @@ :- import_module hlds. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.builtin_modules. :- import_module mdbcomp.prim_data. diff --git a/compiler/ml_foreign_proc_gen.m b/compiler/ml_foreign_proc_gen.m index 91fdeb81a..feaf4503c 100644 --- a/compiler/ml_foreign_proc_gen.m +++ b/compiler/ml_foreign_proc_gen.m @@ -17,7 +17,7 @@ :- import_module hlds. :- import_module hlds.code_model. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module ml_backend.ml_gen_info. :- import_module ml_backend.mlds. :- import_module parse_tree. @@ -48,6 +48,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.mode_top_functor. :- import_module hlds.pred_info_types. diff --git a/compiler/ml_gen_info.m b/compiler/ml_gen_info.m index 6e909c2c6..ab825f01e 100644 --- a/compiler/ml_gen_info.m +++ b/compiler/ml_gen_info.m @@ -22,8 +22,9 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mark_tail_calls. % for nontail_rec_call_reason +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module libs.optimization_options. diff --git a/compiler/ml_proc_gen.m b/compiler/ml_proc_gen.m index de41cf866..20e1f6765 100644 --- a/compiler/ml_proc_gen.m +++ b/compiler/ml_proc_gen.m @@ -45,10 +45,12 @@ :- import_module hlds.hlds_desc. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.mark_tail_calls. :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. diff --git a/compiler/ml_top_gen.m b/compiler/ml_top_gen.m index cda2325e9..901212e6d 100644 --- a/compiler/ml_top_gen.m +++ b/compiler/ml_top_gen.m @@ -39,6 +39,7 @@ :- import_module backend_libs.foreign. % XXX for handling foreign_procs :- import_module backend_libs.rtti. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/ml_unify_gen_construct.m b/compiler/ml_unify_gen_construct.m index 647a8b7a1..cb6be48d6 100644 --- a/compiler/ml_unify_gen_construct.m +++ b/compiler/ml_unify_gen_construct.m @@ -90,9 +90,9 @@ :- import_module hlds.goal_form. :- import_module hlds.hlds_code_util. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.mode_top_functor. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.type_classify. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/ml_unify_gen_deconstruct.m b/compiler/ml_unify_gen_deconstruct.m index f415e9452..f685845f1 100644 --- a/compiler/ml_unify_gen_deconstruct.m +++ b/compiler/ml_unify_gen_deconstruct.m @@ -75,7 +75,6 @@ :- import_module backend_libs.builtin_ops. :- import_module hlds.goal_form. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/ml_unify_gen_test.m b/compiler/ml_unify_gen_test.m index 7884097e7..22d592eb6 100644 --- a/compiler/ml_unify_gen_test.m +++ b/compiler/ml_unify_gen_test.m @@ -52,7 +52,6 @@ :- import_module backend_libs. :- import_module backend_libs.builtin_ops. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. diff --git a/compiler/ml_unify_gen_util.m b/compiler/ml_unify_gen_util.m index 88ad02378..0833ef19f 100644 --- a/compiler/ml_unify_gen_util.m +++ b/compiler/ml_unify_gen_util.m @@ -216,7 +216,6 @@ :- import_module backend_libs. :- import_module backend_libs.builtin_ops. :- import_module hlds.hlds_code_util. -:- import_module hlds.hlds_pred. :- import_module hlds.mode_top_functor. :- import_module hlds.pred_info_types. :- import_module hlds.type_util. diff --git a/compiler/mlds.m b/compiler/mlds.m index ac514687b..eaa2e79e2 100644 --- a/compiler/mlds.m +++ b/compiler/mlds.m @@ -335,7 +335,7 @@ :- import_module hlds. :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. diff --git a/compiler/mlds_dump.m b/compiler/mlds_dump.m index d234c03db..858686b96 100644 --- a/compiler/mlds_dump.m +++ b/compiler/mlds_dump.m @@ -39,7 +39,7 @@ :- import_module backend_libs.builtin_ops. :- import_module hlds. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/mlds_to_c_file.m b/compiler/mlds_to_c_file.m index 328c76fe8..bc7b4435c 100644 --- a/compiler/mlds_to_c_file.m +++ b/compiler/mlds_to_c_file.m @@ -73,7 +73,6 @@ :- import_module backend_libs.c_util. :- import_module backend_libs.foreign. :- import_module hlds. -:- import_module hlds.hlds_pred. % for pred_proc_id. :- import_module libs.compiler_util. :- import_module libs.file_util. :- import_module libs.indent. diff --git a/compiler/mlds_to_c_name.m b/compiler/mlds_to_c_name.m index 85dc4696f..f99425f6b 100644 --- a/compiler/mlds_to_c_name.m +++ b/compiler/mlds_to_c_name.m @@ -83,7 +83,7 @@ :- implementation. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/mlds_to_c_stmt.m b/compiler/mlds_to_c_stmt.m index e773e85db..15d8d600e 100644 --- a/compiler/mlds_to_c_stmt.m +++ b/compiler/mlds_to_c_stmt.m @@ -51,7 +51,7 @@ :- import_module backend_libs.rtti. :- import_module hlds. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs.globals. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. diff --git a/compiler/mlds_to_cs_name.m b/compiler/mlds_to_cs_name.m index 58f290cc5..db57d21d3 100644 --- a/compiler/mlds_to_cs_name.m +++ b/compiler/mlds_to_cs_name.m @@ -132,7 +132,7 @@ :- import_module backend_libs.rtti. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. % for pred_proc_id +:- import_module hlds.pred_proc_id. :- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_util. :- import_module ml_backend.mlds_to_target_util. diff --git a/compiler/mlds_to_java_name.m b/compiler/mlds_to_java_name.m index faff274f7..d6d8186bf 100644 --- a/compiler/mlds_to_java_name.m +++ b/compiler/mlds_to_java_name.m @@ -74,7 +74,7 @@ :- import_module backend_libs.rtti. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. % for pred_proc_id. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/mlds_to_java_wrap.m b/compiler/mlds_to_java_wrap.m index fff665bc6..cb9d5a96b 100644 --- a/compiler/mlds_to_java_wrap.m +++ b/compiler/mlds_to_java_wrap.m @@ -53,7 +53,7 @@ :- import_module backend_libs. :- import_module backend_libs.builtin_ops. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree.java_names. @@ -202,7 +202,7 @@ generate_call_method(Arity, CodeAddrs, MethodDefn) :- ), % Create new method name. - PredId = hlds_pred.initial_pred_id, + PredId = initial_pred_id, ProcId = initial_proc_id, PredLabel = mlds_special_pred_label("call", no, "", 0), ProcLabel = mlds_proc_label(PredLabel, ProcId), diff --git a/compiler/mlds_to_target_util.m b/compiler/mlds_to_target_util.m index 488960c22..f20dfb9ad 100644 --- a/compiler/mlds_to_target_util.m +++ b/compiler/mlds_to_target_util.m @@ -271,7 +271,7 @@ :- implementation. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp.prim_data. :- import_module parse_tree.prog_util. diff --git a/compiler/mmc_analysis.m b/compiler/mmc_analysis.m index f42003c9c..05088dafe 100644 --- a/compiler/mmc_analysis.m +++ b/compiler/mmc_analysis.m @@ -23,6 +23,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. diff --git a/compiler/mode_comparison.m b/compiler/mode_comparison.m index 4c1643647..b351e9b52 100644 --- a/compiler/mode_comparison.m +++ b/compiler/mode_comparison.m @@ -19,6 +19,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -95,6 +96,7 @@ :- implementation. :- import_module check_hlds.modecheck_util. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_match. :- import_module hlds.mode_util. diff --git a/compiler/mode_constraint_robdd.m b/compiler/mode_constraint_robdd.m index 2dccb5833..14c2485ba 100644 --- a/compiler/mode_constraint_robdd.m +++ b/compiler/mode_constraint_robdd.m @@ -25,7 +25,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module mode_robdd. @@ -200,7 +200,7 @@ init_mode_constraint_info(DebugStream, Simple) = MCI :- VarSet0 = varset.init, varset.new_var(ZeroVar, VarSet0, VarSet), - PredId = hlds_pred.initial_pred_id, + PredId = initial_pred_id, MCI = mode_constraint_info(DebugStream, VarSet, bimap.init, PredId, stack.init, map.init, map.init, set_of_var.init, ZeroVar, Simple, map.init). diff --git a/compiler/mode_constraints.m b/compiler/mode_constraints.m index bf1ec6bcd..7f98a815c 100644 --- a/compiler/mode_constraints.m +++ b/compiler/mode_constraints.m @@ -56,12 +56,14 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.inst_graph. :- import_module hlds.inst_lookup. :- import_module hlds.mode_util. :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.quantification. :- import_module hlds.var_table_hlds. :- import_module libs. diff --git a/compiler/mode_errors.m b/compiler/mode_errors.m index 1c259a7a7..e5a70ed3d 100644 --- a/compiler/mode_errors.m +++ b/compiler/mode_errors.m @@ -23,6 +23,7 @@ :- import_module hlds.hlds_pred. :- import_module hlds.instmap. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module parse_tree. @@ -476,6 +477,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_match. :- import_module hlds.inst_test. diff --git a/compiler/mode_info.m b/compiler/mode_info.m index 8ee8fbe87..681d1775f 100644 --- a/compiler/mode_info.m +++ b/compiler/mode_info.m @@ -24,8 +24,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module libs. :- import_module libs.maybe_util. @@ -467,6 +467,8 @@ :- implementation. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module libs.globals. :- import_module libs.options. :- import_module parse_tree.write_error_spec. diff --git a/compiler/mode_ordering.m b/compiler/mode_ordering.m index 2abb96c84..245195b78 100644 --- a/compiler/mode_ordering.m +++ b/compiler/mode_ordering.m @@ -19,7 +19,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.set_of_var. @@ -64,6 +64,8 @@ :- implementation. :- import_module check_hlds.clause_to_proc. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_graph. :- import_module mdbcomp. diff --git a/compiler/modecheck_call.m b/compiler/modecheck_call.m index 3af25d200..4104c746f 100644 --- a/compiler/modecheck_call.m +++ b/compiler/modecheck_call.m @@ -27,7 +27,7 @@ :- import_module check_hlds.modecheck_util. :- import_module hlds. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -67,6 +67,8 @@ :- import_module check_hlds.proc_requests. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_lookup. :- import_module hlds.inst_test. diff --git a/compiler/modecheck_goal.m b/compiler/modecheck_goal.m index 79f6214ca..35cd1ef22 100644 --- a/compiler/modecheck_goal.m +++ b/compiler/modecheck_goal.m @@ -123,6 +123,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.inst_test. :- import_module hlds.instmap. :- import_module hlds.make_goal. diff --git a/compiler/modecheck_unify.m b/compiler/modecheck_unify.m index 542cf3364..bf8972a92 100644 --- a/compiler/modecheck_unify.m +++ b/compiler/modecheck_unify.m @@ -55,6 +55,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.inst_lookup. :- import_module hlds.inst_match. :- import_module hlds.inst_test. @@ -64,6 +65,7 @@ :- import_module hlds.mode_top_functor. :- import_module hlds.mode_util. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.type_classify. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/modecheck_util.m b/compiler/modecheck_util.m index 433920df1..512e367bb 100644 --- a/compiler/modecheck_util.m +++ b/compiler/modecheck_util.m @@ -243,6 +243,7 @@ :- import_module check_hlds.inst_abstract_unify. :- import_module check_hlds.modecheck_goal. :- import_module check_hlds.polymorphism_goal. +:- import_module hlds.hlds_proc. :- import_module hlds.inst_lookup. :- import_module hlds.inst_match. :- import_module hlds.inst_test. diff --git a/compiler/modes.m b/compiler/modes.m index a912b1d92..cedc1b4c7 100644 --- a/compiler/modes.m +++ b/compiler/modes.m @@ -67,7 +67,7 @@ :- import_module check_hlds.mode_info. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.maybe_error. @@ -155,6 +155,8 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_lookup. :- import_module hlds.inst_match. diff --git a/compiler/notes/compiler_design.html b/compiler/notes/compiler_design.html index e208aa556..6d5236a03 100644 --- a/compiler/notes/compiler_design.html +++ b/compiler/notes/compiler_design.html @@ -862,9 +862,14 @@ hlds_rtti.m defines the part of the HLDS concerning RTTI.
  • const_struct.m defines the part of the HLDS concerning constant structures.
  • -hlds_pred.m defines representations of predicates and procedures, -with the types used in the representations of predicates and procedures -being defined in pred_info_types.m and proc_info_types.m respectively. +hlds_pred.m and hlds_proc.m define +the representations of predicates and procedures. +
  • +pred_info_types.m and proc_info_types.m define +the types used in the representations of predicates and procedures. +
  • +pred_proc_id.m defines types that identify predicates and procedures. +
  • pred_table.m defines the tables that index predicates and functions on various combinations of (qualified and unqualified) names and arity. diff --git a/compiler/oisu_check.m b/compiler/oisu_check.m index 79e1a1dda..d1413e90d 100644 --- a/compiler/oisu_check.m +++ b/compiler/oisu_check.m @@ -40,8 +40,10 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module parse_tree.prog_type. diff --git a/compiler/old_type_constraints.m b/compiler/old_type_constraints.m index c6c5ffa16..95c435e96 100644 --- a/compiler/old_type_constraints.m +++ b/compiler/old_type_constraints.m @@ -44,6 +44,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.special_pred. :- import_module hlds.var_table_hlds. diff --git a/compiler/opt_debug.m b/compiler/opt_debug.m index 3135f12b9..0e289ee92 100644 --- a/compiler/opt_debug.m +++ b/compiler/opt_debug.m @@ -153,9 +153,9 @@ :- import_module backend_libs.c_util. :- import_module backend_libs.proc_label. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module ll_backend.llds_out. :- import_module ll_backend.llds_out.llds_out_code_addr. :- import_module mdbcomp.sym_name. diff --git a/compiler/opt_format_call.m b/compiler/opt_format_call.m index 89cf7688f..be87d27a9 100644 --- a/compiler/opt_format_call.m +++ b/compiler/opt_format_call.m @@ -132,6 +132,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. @@ -175,6 +176,7 @@ :- import_module hlds.make_goal. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/opt_format_call_errors.m b/compiler/opt_format_call_errors.m index ee9509878..0dc0f15b9 100644 --- a/compiler/opt_format_call_errors.m +++ b/compiler/opt_format_call_errors.m @@ -19,7 +19,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. diff --git a/compiler/optimize.m b/compiler/optimize.m index 29c4778a9..ea51a6185 100644 --- a/compiler/optimize.m +++ b/compiler/optimize.m @@ -42,7 +42,7 @@ :- import_module hlds. :- import_module hlds.code_model. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs.file_util. :- import_module libs.optimization_options. :- import_module libs.options. diff --git a/compiler/ordering_mode_constraints.m b/compiler/ordering_mode_constraints.m index f56f96266..aa01ccd59 100644 --- a/compiler/ordering_mode_constraints.m +++ b/compiler/ordering_mode_constraints.m @@ -22,7 +22,7 @@ :- import_module check_hlds.prop_mode_constraints. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. @@ -110,6 +110,8 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module libs. :- import_module libs.globals. :- import_module libs.indent. diff --git a/compiler/par_loop_control.m b/compiler/par_loop_control.m index 153cd300b..92365523f 100644 --- a/compiler/par_loop_control.m +++ b/compiler/par_loop_control.m @@ -105,11 +105,13 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.status. diff --git a/compiler/parallel_to_plain_conj.m b/compiler/parallel_to_plain_conj.m index 157f53c89..3be2fe63f 100644 --- a/compiler/parallel_to_plain_conj.m +++ b/compiler/parallel_to_plain_conj.m @@ -19,7 +19,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. %-----------------------------------------------------------------------------% diff --git a/compiler/passes_aux.m b/compiler/passes_aux.m index 689831ad9..85ae97d1a 100644 --- a/compiler/passes_aux.m +++ b/compiler/passes_aux.m @@ -20,6 +20,8 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. diff --git a/compiler/pd_debug.m b/compiler/pd_debug.m index 3dde4c767..e7f4a85ea 100644 --- a/compiler/pd_debug.m +++ b/compiler/pd_debug.m @@ -19,7 +19,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module transform_hlds.pd_info. @@ -69,6 +69,8 @@ :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_mode. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/pd_info.m b/compiler/pd_info.m index e4cb58f1d..248415800 100644 --- a/compiler/pd_info.m +++ b/compiler/pd_info.m @@ -21,7 +21,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module transform_hlds.pd_term. diff --git a/compiler/pd_term.m b/compiler/pd_term.m index 722eba35b..ffb10b239 100644 --- a/compiler/pd_term.m +++ b/compiler/pd_term.m @@ -44,8 +44,8 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.pd_info. :- import_module list. diff --git a/compiler/pd_util.m b/compiler/pd_util.m index e11efac40..35aa4f236 100644 --- a/compiler/pd_util.m +++ b/compiler/pd_util.m @@ -24,7 +24,8 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.set_of_var. @@ -169,6 +170,7 @@ :- import_module hlds.goal_form. :- import_module hlds.goal_reorder. :- import_module hlds.goal_vars. +:- import_module hlds.hlds_pred. :- import_module hlds.inst_lookup. :- import_module hlds.inst_match. :- import_module hlds.inst_test. diff --git a/compiler/polymorphism.m b/compiler/polymorphism.m index c6a32ae9c..c328cae66 100644 --- a/compiler/polymorphism.m +++ b/compiler/polymorphism.m @@ -118,7 +118,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.maybe_error. @@ -166,6 +166,8 @@ :- import_module hlds.const_struct. :- import_module hlds.hlds_args. :- import_module hlds.hlds_clauses. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. :- import_module mdbcomp. diff --git a/compiler/polymorphism_goal.m b/compiler/polymorphism_goal.m index caf511c10..54e6ec6a0 100644 --- a/compiler/polymorphism_goal.m +++ b/compiler/polymorphism_goal.m @@ -52,6 +52,8 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module hlds.quantification. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/polymorphism_info.m b/compiler/polymorphism_info.m index aa0d48d63..7ac60cacd 100644 --- a/compiler/polymorphism_info.m +++ b/compiler/polymorphism_info.m @@ -24,6 +24,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module parse_tree. :- import_module parse_tree.error_spec. diff --git a/compiler/polymorphism_lambda.m b/compiler/polymorphism_lambda.m index a5be25731..331ddeb14 100644 --- a/compiler/polymorphism_lambda.m +++ b/compiler/polymorphism_lambda.m @@ -21,7 +21,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.maybe_error. :- import_module parse_tree.prog_data. @@ -54,6 +54,8 @@ :- implementation. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. :- import_module hlds.var_table_hlds. :- import_module mdbcomp. diff --git a/compiler/polymorphism_post_copy.m b/compiler/polymorphism_post_copy.m index f7a9db901..76afaeb79 100644 --- a/compiler/polymorphism_post_copy.m +++ b/compiler/polymorphism_post_copy.m @@ -12,7 +12,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module list. @@ -31,6 +31,8 @@ :- import_module check_hlds.introduce_exists_casts. :- import_module hlds.hlds_class. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.status. diff --git a/compiler/polymorphism_type_info.m b/compiler/polymorphism_type_info.m index e4e342291..02e3ed780 100644 --- a/compiler/polymorphism_type_info.m +++ b/compiler/polymorphism_type_info.m @@ -93,6 +93,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module parse_tree. :- import_module parse_tree.prog_data. diff --git a/compiler/post_term_analysis.m b/compiler/post_term_analysis.m index c554cb88f..92c2a79b8 100644 --- a/compiler/post_term_analysis.m +++ b/compiler/post_term_analysis.m @@ -42,6 +42,8 @@ :- import_module hlds.goal_transform. :- import_module hlds.hlds_data. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module hlds.special_pred. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/post_typecheck.m b/compiler/post_typecheck.m index 6907e47f7..305f5f1c8 100644 --- a/compiler/post_typecheck.m +++ b/compiler/post_typecheck.m @@ -88,8 +88,10 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_proc. :- import_module hlds.inst_mode_type_prop. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module hlds.type_rename. :- import_module hlds.type_util. diff --git a/compiler/pre_typecheck.m b/compiler/pre_typecheck.m index b76f5cb03..2871db51a 100644 --- a/compiler/pre_typecheck.m +++ b/compiler/pre_typecheck.m @@ -66,11 +66,13 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_goal. :- import_module hlds.make_hlds. :- import_module hlds.make_hlds.state_var. :- import_module hlds.mode_util. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/pred_name.m b/compiler/pred_name.m index 63654b56d..6fc41e6f8 100644 --- a/compiler/pred_name.m +++ b/compiler/pred_name.m @@ -25,7 +25,7 @@ :- module hlds.pred_name. :- interface. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/pred_proc_id.m b/compiler/pred_proc_id.m new file mode 100644 index 000000000..823cc00d3 --- /dev/null +++ b/compiler/pred_proc_id.m @@ -0,0 +1,136 @@ +%---------------------------------------------------------------------------% +% vim: ft=mercury ts=4 sw=4 et +%---------------------------------------------------------------------------% +% Copyright (C) 1996-2012 The University of Melbourne. +% Copyright (C) 2013-2026 The Mercury team. +% This file may only be copied under the terms of the GNU General +% Public License - see the file COPYING in the Mercury distribution. +%---------------------------------------------------------------------------% +% +% File: pred_proc_id.m. +% +% This module defines the types that identify pred_infos and proc_infos. +% +%---------------------------------------------------------------------------% + +:- module hlds.pred_proc_id. +:- interface. + +:- import_module parse_tree. +:- import_module parse_tree.prog_data. + +:- import_module set. + +%---------------------------------------------------------------------------% + +:- type pred_proc_id + ---> proc(pred_id, proc_id). + + % A proc_id is the name of a mode within a particular predicate - + % not to be confused with a mode_id, which is the name of a + % user-defined mode. + +:- type pred_id. +:- type proc_id. + +:- func pred_proc_id_project_pred_id(pred_proc_id) = pred_id. +:- func pred_proc_id_project_proc_id(pred_proc_id) = proc_id. + + % Predicate and procedure ids are abstract data types. One important + % advantage of this arrangement is to make it harder to accidentally + % confuse them for each other, or to use an integer in their place. + % However, you can convert between integers and pred_ids/proc_ids + % with the following predicates and functions. + % +:- func shroud_pred_id(pred_id) = shrouded_pred_id. +:- func shroud_proc_id(proc_id) = shrouded_proc_id. +:- func shroud_pred_proc_id(pred_proc_id) = shrouded_pred_proc_id. + +:- func unshroud_pred_id(shrouded_pred_id) = pred_id. +:- func unshroud_proc_id(shrouded_proc_id) = proc_id. +:- func unshroud_pred_proc_id(shrouded_pred_proc_id) = pred_proc_id. + +:- pred pred_id_to_int(pred_id, int). +:- mode pred_id_to_int(in, out) is det. +:- mode pred_id_to_int(out, in) is det. +:- func pred_id_to_int(pred_id) = int. + +:- pred proc_id_to_int(proc_id, int). +:- mode proc_id_to_int(in, out) is det. +:- mode proc_id_to_int(out, in) is det. +:- func proc_id_to_int(proc_id) = int. + + % Return the id of the first predicate in a module, and of the first + % procedure in a predicate. + % +:- func initial_pred_id = pred_id. +:- func initial_proc_id = proc_id. + + % Return an invalid predicate or procedure id. These are intended to be + % used to initialize the relevant fields in call(...) goals before + % we do type- and mode-checks, or when those checks find that there was + % no predicate matching the call. + % +:- func invalid_pred_id = pred_id. +:- func invalid_proc_id = proc_id. + +:- pred next_pred_id(pred_id::in, pred_id::out) is det. + + % For semidet complicated unifications with mode (in, in), these are + % defined to have the same proc_id (0). This returns that proc_id. + % +:- pred in_in_unification_proc_id(proc_id::out) is det. + + % Several passes operate on the module one SCC at a time. An SCC is + % a strongly connected component of the call graph, i.e. a group of + % procedures that all recursively call each other, directly or indirectly, + % which aren't mutually recursive with any procedure outside the SCC. +:- type scc == set(pred_proc_id). + +%---------------------------------------------------------------------------% +%---------------------------------------------------------------------------% + +:- implementation. + +:- import_module int. + +%---------------------------------------------------------------------------% + +:- type pred_id + ---> pred_id(int). + +:- type proc_id == int. + +pred_proc_id_project_pred_id(proc(PredId, _ProcId)) = PredId. +pred_proc_id_project_proc_id(proc(_PredId, ProcId)) = ProcId. + +shroud_pred_id(pred_id(PredId)) = shrouded_pred_id(PredId). +shroud_proc_id(ProcId) = shrouded_proc_id(ProcId). +shroud_pred_proc_id(proc(pred_id(PredId), ProcId)) = + shrouded_pred_proc_id(PredId, ProcId). + +unshroud_pred_id(shrouded_pred_id(PredId)) = pred_id(PredId). +unshroud_proc_id(shrouded_proc_id(ProcId)) = ProcId. +unshroud_pred_proc_id(shrouded_pred_proc_id(PredId, ProcId)) = + proc(pred_id(PredId), ProcId). + +pred_id_to_int(pred_id(PredId), PredId). +pred_id_to_int(pred_id(PredId)) = PredId. + +proc_id_to_int(ProcId, ProcId). +proc_id_to_int(ProcId) = ProcId. + +initial_pred_id = pred_id(0). +initial_proc_id = 0. + +invalid_pred_id = pred_id(-1). +invalid_proc_id = -1. + +next_pred_id(pred_id(PredId), pred_id(NextPredId)) :- + NextPredId = PredId + 1. + +in_in_unification_proc_id(0). + +%---------------------------------------------------------------------------% +:- end_module hlds.pred_proc_id. +%---------------------------------------------------------------------------% diff --git a/compiler/pred_table.m b/compiler/pred_table.m index d8afdc98e..2f22aae42 100644 --- a/compiler/pred_table.m +++ b/compiler/pred_table.m @@ -22,6 +22,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. @@ -468,7 +469,7 @@ predicate_table_init(PredicateTable) :- map.init(PredIdTable), - NextPredId = hlds_pred.initial_pred_id, + NextPredId = initial_pred_id, ValidPredIds = set_tree234.init, map.init(AccessibilityTable), map.init(Pred_N_Index), @@ -513,7 +514,7 @@ do_predicate_table_insert(MaybePredId, PredInfo, NeedQual, MaybeQualInfo, % Allocate a new pred_id. MaybePredId = no, PredId = NextPredId0, - hlds_pred.next_pred_id(PredId, NextPredId) + next_pred_id(PredId, NextPredId) ), % Insert the pred_id into either the function or predicate indices, % as appropriate. diff --git a/compiler/proc_gen.m b/compiler/proc_gen.m index ec553321e..ade9d943e 100644 --- a/compiler/proc_gen.m +++ b/compiler/proc_gen.m @@ -23,6 +23,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module ll_backend.global_data. :- import_module ll_backend.llds. diff --git a/compiler/proc_info_types.m b/compiler/proc_info_types.m index b521570ab..1093d2caa 100644 --- a/compiler/proc_info_types.m +++ b/compiler/proc_info_types.m @@ -21,9 +21,9 @@ :- import_module analysis. :- import_module analysis.framework. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module mdbcomp.program_representation. diff --git a/compiler/proc_label.m b/compiler/proc_label.m index 3a9129d8f..d66f92bb3 100644 --- a/compiler/proc_label.m +++ b/compiler/proc_label.m @@ -21,8 +21,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module parse_tree. @@ -46,6 +46,7 @@ :- implementation. +:- import_module hlds.hlds_pred. :- import_module hlds.pred_name. :- import_module mdbcomp.builtin_modules. :- import_module mdbcomp.sym_name. @@ -99,7 +100,7 @@ do_make_proc_label(PredOrFunc, ThisModule, PredModule, PredName, PredFormArity, ( if ThisModule \= TypeModule, SpecialPred = spec_pred_unify, - not hlds_pred.in_in_unification_proc_id(ProcId) + not in_in_unification_proc_id(ProcId) then DefiningModule = ThisModule else @@ -148,7 +149,7 @@ make_user_proc_label(ThisModule, PredIsImported, PredOrFunc, PredModule, make_uni_label(ModuleInfo, TypeCtor, UniModeNum) = ProcLabel :- module_info_get_name(ModuleInfo, ModuleName), ( if TypeCtor = type_ctor(qualified(TypeModule, TypeName), Arity) then - ( if hlds_pred.in_in_unification_proc_id(UniModeNum) then + ( if in_in_unification_proc_id(UniModeNum) then Module = TypeModule else Module = ModuleName diff --git a/compiler/proc_requests.m b/compiler/proc_requests.m index 83ae81ebb..27493c319 100644 --- a/compiler/proc_requests.m +++ b/compiler/proc_requests.m @@ -51,7 +51,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -107,6 +107,8 @@ :- import_module hlds.add_special_pred. :- import_module hlds.goal_transform. :- import_module hlds.hlds_data. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.inst_test. :- import_module hlds.mode_test. :- import_module hlds.pred_name. @@ -324,15 +326,15 @@ search_mode_num(ModuleInfo, TypeCtor, UnifyMode, Determinism, ProcId) :- inst_is_ground_or_any(ModuleInfo, InitInstX), inst_is_ground_or_any(ModuleInfo, InitInstY) then - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) else if InitInstX = not_reached then - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) else if InitInstY = not_reached then - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) else module_info_get_proc_requests(ModuleInfo, Requests), get_unify_req_map(Requests, UnifyReqMap), diff --git a/compiler/prog_rep.m b/compiler/prog_rep.m index 76e3923f4..34a2ac5ce 100644 --- a/compiler/prog_rep.m +++ b/compiler/prog_rep.m @@ -99,6 +99,7 @@ :- import_module hlds.inst_test. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp.goal_path. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.rtti_access. diff --git a/compiler/prop_mode_constraints.m b/compiler/prop_mode_constraints.m index b4cfd2125..e44564e60 100644 --- a/compiler/prop_mode_constraints.m +++ b/compiler/prop_mode_constraints.m @@ -24,7 +24,7 @@ :- import_module check_hlds.build_mode_constraints. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. @@ -87,6 +87,8 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.make_goal. :- import_module hlds.status. :- import_module hlds.var_table_hlds. diff --git a/compiler/purity.m b/compiler/purity.m index e89e32a4a..3ecbcfad1 100644 --- a/compiler/purity.m +++ b/compiler/purity.m @@ -129,6 +129,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. @@ -172,6 +173,7 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.passes_aux. diff --git a/compiler/push_goals_together.m b/compiler/push_goals_together.m index f3871697e..9765f6dd7 100644 --- a/compiler/push_goals_together.m +++ b/compiler/push_goals_together.m @@ -22,7 +22,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module mdbcomp. :- import_module mdbcomp.feedback. :- import_module mdbcomp.feedback.automatic_parallelism. diff --git a/compiler/qual_info.m b/compiler/qual_info.m index 64102b2a7..7a40c3324 100644 --- a/compiler/qual_info.m +++ b/compiler/qual_info.m @@ -17,7 +17,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/quantification.m b/compiler/quantification.m index d4374030c..e47ddee01 100644 --- a/compiler/quantification.m +++ b/compiler/quantification.m @@ -35,7 +35,7 @@ :- interface. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -148,6 +148,7 @@ :- import_module hlds.goal_vars. :- import_module hlds.hlds_markers. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module parse_tree.prog_rename. :- import_module parse_tree.var_db. diff --git a/compiler/rbmm.add_rbmm_goal_infos.m b/compiler/rbmm.add_rbmm_goal_infos.m index c0e0b0ddd..0deff8690 100644 --- a/compiler/rbmm.add_rbmm_goal_infos.m +++ b/compiler/rbmm.add_rbmm_goal_infos.m @@ -59,6 +59,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/rbmm.condition_renaming.m b/compiler/rbmm.condition_renaming.m index d55dc90b3..764911616 100644 --- a/compiler/rbmm.condition_renaming.m +++ b/compiler/rbmm.condition_renaming.m @@ -40,7 +40,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module transform_hlds.rbmm.points_to_info. @@ -139,6 +139,8 @@ :- import_module hlds.goal_form. :- import_module hlds.goal_path. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module transform_hlds.rbmm.points_to_graph. :- import_module transform_hlds.rbmm.region_instruction. :- import_module transform_hlds.smm_common. diff --git a/compiler/rbmm.execution_path.m b/compiler/rbmm.execution_path.m index e37f52484..fa919c5c2 100644 --- a/compiler/rbmm.execution_path.m +++ b/compiler/rbmm.execution_path.m @@ -34,6 +34,8 @@ :- import_module hlds.goal_path. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module transform_hlds.smm_common. diff --git a/compiler/rbmm.interproc_region_lifetime.m b/compiler/rbmm.interproc_region_lifetime.m index 26fd88148..c5144e2ff 100644 --- a/compiler/rbmm.interproc_region_lifetime.m +++ b/compiler/rbmm.interproc_region_lifetime.m @@ -61,7 +61,7 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.dependency_graph. diff --git a/compiler/rbmm.live_region_analysis.m b/compiler/rbmm.live_region_analysis.m index 29b64c7ec..d8f5e281e 100644 --- a/compiler/rbmm.live_region_analysis.m +++ b/compiler/rbmm.live_region_analysis.m @@ -40,6 +40,8 @@ :- implementation. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module transform_hlds.rbmm.points_to_graph. diff --git a/compiler/rbmm.live_variable_analysis.m b/compiler/rbmm.live_variable_analysis.m index 81ae14ff3..afdb2683b 100644 --- a/compiler/rbmm.live_variable_analysis.m +++ b/compiler/rbmm.live_variable_analysis.m @@ -33,6 +33,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.var_table. diff --git a/compiler/rbmm.points_to_analysis.m b/compiler/rbmm.points_to_analysis.m index f36e7fdbb..de1e43d2e 100644 --- a/compiler/rbmm.points_to_analysis.m +++ b/compiler/rbmm.points_to_analysis.m @@ -52,6 +52,8 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.dependency_graph. :- import_module parse_tree. diff --git a/compiler/rbmm.points_to_graph.m b/compiler/rbmm.points_to_graph.m index 75ddb808a..d476ab804 100644 --- a/compiler/rbmm.points_to_graph.m +++ b/compiler/rbmm.points_to_graph.m @@ -17,7 +17,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_data_pragma. diff --git a/compiler/rbmm.points_to_info.m b/compiler/rbmm.points_to_info.m index bdc3846d9..47eb0d037 100644 --- a/compiler/rbmm.points_to_info.m +++ b/compiler/rbmm.points_to_info.m @@ -19,7 +19,8 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.rbmm.points_to_graph. :- import_module transform_hlds.smm_common. diff --git a/compiler/rbmm.region_arguments.m b/compiler/rbmm.region_arguments.m index c139230f0..e50a945c5 100644 --- a/compiler/rbmm.region_arguments.m +++ b/compiler/rbmm.region_arguments.m @@ -25,7 +25,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.rbmm.points_to_graph. :- import_module transform_hlds.rbmm.points_to_info. :- import_module transform_hlds.rbmm.region_liveness_info. @@ -34,6 +34,8 @@ :- import_module list. :- import_module map. +%---------------------------------------------------------------------------% + :- type proc_formal_region_args_table == map( pred_proc_id, @@ -71,6 +73,8 @@ :- import_module hlds.goal_path. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. @@ -79,6 +83,8 @@ :- import_module require. :- import_module set. +%---------------------------------------------------------------------------% + record_region_arguments(ModuleInfo, RptaInfoTable, ConstantRTable, DeadRTable, BornRTable, FormalRegionArgTable, ActualRegionArgTable) :- module_info_get_valid_pred_ids(ModuleInfo, PredIds), diff --git a/compiler/rbmm.region_instruction.m b/compiler/rbmm.region_instruction.m index e0b701aa6..7e40008ae 100644 --- a/compiler/rbmm.region_instruction.m +++ b/compiler/rbmm.region_instruction.m @@ -20,7 +20,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.rbmm.points_to_info. :- import_module transform_hlds.rbmm.region_liveness_info. :- import_module transform_hlds.smm_common. @@ -28,6 +28,8 @@ :- import_module list. :- import_module map. +%---------------------------------------------------------------------------% + :- type region_instr_table == map(pred_proc_id, region_instr_proc). @@ -109,12 +111,16 @@ :- implementation. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module transform_hlds.rbmm.points_to_graph. :- import_module pair. :- import_module require. :- import_module set. +%---------------------------------------------------------------------------% + introduce_region_instructions(ModuleInfo, RptaInfoTable, ExecPathTable, LRBeforeTable, LRAfterTable, VoidVarRegionTable, BornRTable, DeadRTable, LocalRTable, diff --git a/compiler/rbmm.region_liveness_info.m b/compiler/rbmm.region_liveness_info.m index 45e2696fb..caa58fe67 100644 --- a/compiler/rbmm.region_liveness_info.m +++ b/compiler/rbmm.region_liveness_info.m @@ -21,7 +21,8 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module transform_hlds.rbmm.points_to_graph. diff --git a/compiler/rbmm.region_resurrection_renaming.m b/compiler/rbmm.region_resurrection_renaming.m index d6ad58695..09e6257e9 100644 --- a/compiler/rbmm.region_resurrection_renaming.m +++ b/compiler/rbmm.region_resurrection_renaming.m @@ -23,7 +23,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.rbmm.points_to_info. :- import_module transform_hlds.rbmm.region_instruction. :- import_module transform_hlds.rbmm.region_liveness_info. diff --git a/compiler/rbmm.region_transformation.m b/compiler/rbmm.region_transformation.m index c31855e4f..29f17536b 100644 --- a/compiler/rbmm.region_transformation.m +++ b/compiler/rbmm.region_transformation.m @@ -24,7 +24,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module transform_hlds.rbmm.points_to_info. @@ -79,6 +79,8 @@ :- import_module hlds.goal_transform. :- import_module hlds.goal_util. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. :- import_module hlds.pred_table. :- import_module hlds.quantification. diff --git a/compiler/recompilation.check.m b/compiler/recompilation.check.m index 3f925743a..5dcd0060f 100644 --- a/compiler/recompilation.check.m +++ b/compiler/recompilation.check.m @@ -65,6 +65,7 @@ :- import_module hlds. :- import_module hlds.hlds_cons. % for type field_access_type :- import_module hlds.hlds_pred. % for field_access_function_name, pred_id. +:- import_module hlds.pred_proc_id. :- import_module libs.file_util. :- import_module libs.options. :- import_module libs.timestamp. diff --git a/compiler/recompilation.usage.m b/compiler/recompilation.usage.m index 16cdce5b4..84017b7ba 100644 --- a/compiler/recompilation.usage.m +++ b/compiler/recompilation.usage.m @@ -39,6 +39,8 @@ :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/recompilation.used_file.m b/compiler/recompilation.used_file.m index 382f57b1c..1af18db4d 100644 --- a/compiler/recompilation.used_file.m +++ b/compiler/recompilation.used_file.m @@ -24,7 +24,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.file_util. :- import_module libs.globals. diff --git a/compiler/recompute_instmap_deltas.m b/compiler/recompute_instmap_deltas.m index cd85d593f..bf8aa24ad 100644 --- a/compiler/recompute_instmap_deltas.m +++ b/compiler/recompute_instmap_deltas.m @@ -22,7 +22,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -59,9 +59,11 @@ :- import_module check_hlds.inst_abstract_unify. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_match. :- import_module hlds.mode_util. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/resolve_unify_functor.m b/compiler/resolve_unify_functor.m index a699acc77..be043da4f 100644 --- a/compiler/resolve_unify_functor.m +++ b/compiler/resolve_unify_functor.m @@ -55,6 +55,7 @@ :- import_module hlds.hlds_cons. :- import_module hlds.hlds_data. :- import_module hlds.make_goal. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.type_util. :- import_module mdbcomp. diff --git a/compiler/rtti_to_mlds.m b/compiler/rtti_to_mlds.m index 480128e68..cb16da6f2 100644 --- a/compiler/rtti_to_mlds.m +++ b/compiler/rtti_to_mlds.m @@ -57,8 +57,8 @@ :- implementation. :- import_module backend_libs.type_ctor_info. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. diff --git a/compiler/saved_vars.m b/compiler/saved_vars.m index 3c8ab317a..afcbfbffa 100644 --- a/compiler/saved_vars.m +++ b/compiler/saved_vars.m @@ -30,7 +30,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module io. @@ -51,6 +52,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.passes_aux. diff --git a/compiler/scout_disjunctions.m b/compiler/scout_disjunctions.m index 8fe76b4af..56405d50e 100644 --- a/compiler/scout_disjunctions.m +++ b/compiler/scout_disjunctions.m @@ -24,7 +24,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module parse_tree. diff --git a/compiler/simplify_goal_call.m b/compiler/simplify_goal_call.m index 6f6e0dba7..c9c90525e 100644 --- a/compiler/simplify_goal_call.m +++ b/compiler/simplify_goal_call.m @@ -23,6 +23,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. @@ -75,6 +76,7 @@ :- import_module hlds.goal_util. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_proc. :- import_module hlds.inst_test. :- import_module hlds.make_goal. :- import_module hlds.mode_util. diff --git a/compiler/simplify_goal_conj.m b/compiler/simplify_goal_conj.m index e736469bb..45ccb5c4f 100644 --- a/compiler/simplify_goal_conj.m +++ b/compiler/simplify_goal_conj.m @@ -50,7 +50,6 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.make_goal. :- import_module hlds.passes_aux. diff --git a/compiler/simplify_goal_disj.m b/compiler/simplify_goal_disj.m index 4d7e25dd0..53c9a30ca 100644 --- a/compiler/simplify_goal_disj.m +++ b/compiler/simplify_goal_disj.m @@ -47,6 +47,8 @@ common_info::in, common_info::out, simplify_info::in, simplify_info::out) is det. +%----------------------------------------------------------------------------% + :- implementation. :- import_module check_hlds.simplify.simplify_goal. @@ -57,6 +59,7 @@ :- import_module hlds.inst_match. :- import_module hlds.inst_test. :- import_module hlds.make_goal. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.options. :- import_module parse_tree.error_spec. @@ -73,6 +76,8 @@ :- import_module string. :- import_module term_context. +%----------------------------------------------------------------------------% + simplify_goal_disj(GoalExpr0, GoalExpr, GoalInfo0, GoalInfo, NestedContext0, InstMap0, Common0, Common, !Info) :- GoalExpr0 = disj(Disjuncts0), diff --git a/compiler/simplify_goal_unify.m b/compiler/simplify_goal_unify.m index b6707f963..f5fbc678b 100644 --- a/compiler/simplify_goal_unify.m +++ b/compiler/simplify_goal_unify.m @@ -40,8 +40,10 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. :- import_module hlds.make_goal. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.special_pred. :- import_module mdbcomp. @@ -274,7 +276,7 @@ process_complicated_unify(XVar, YVar, UnifyMode, CanFail, _OldTypeInfoVars, determinism_components(Detism, CanFail, at_most_one), lookup_mode_num(ModuleInfo, TypeCtor, UnifyMode, Detism, ProcId), ( if - hlds_pred.in_in_unification_proc_id(ProcId), + in_in_unification_proc_id(ProcId), % For most imported types, we only generate unification % predicate declarations if they are needed for complicated % unifications other than proc_id 0. higher_order.m will diff --git a/compiler/simplify_info.m b/compiler/simplify_info.m index b4dba03e3..2efe27b01 100644 --- a/compiler/simplify_info.m +++ b/compiler/simplify_info.m @@ -24,7 +24,9 @@ :- import_module hlds.const_struct. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.optimization_options. diff --git a/compiler/simplify_proc.m b/compiler/simplify_proc.m index 5a3e3eb37..e0fdce2c1 100644 --- a/compiler/simplify_proc.m +++ b/compiler/simplify_proc.m @@ -25,7 +25,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.instmap. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_util. diff --git a/compiler/size_prof.m b/compiler/size_prof.m index 94e39809f..d56c9b6d4 100644 --- a/compiler/size_prof.m +++ b/compiler/size_prof.m @@ -86,7 +86,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module io. diff --git a/compiler/smm_common.m b/compiler/smm_common.m index e4e3d097b..bf159b7d0 100644 --- a/compiler/smm_common.m +++ b/compiler/smm_common.m @@ -21,7 +21,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module parse_tree. @@ -89,6 +89,7 @@ :- implementation. +:- import_module hlds.hlds_pred. :- import_module hlds.special_pred. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/special_pred.m b/compiler/special_pred.m index 88cdb0194..e30975b08 100644 --- a/compiler/special_pred.m +++ b/compiler/special_pred.m @@ -21,7 +21,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. @@ -137,6 +137,7 @@ :- implementation. +:- import_module hlds.hlds_pred. :- import_module hlds.pred_table. :- import_module hlds.type_classify. :- import_module hlds.type_util. diff --git a/compiler/ssdebug.m b/compiler/ssdebug.m index 1b0b4a48e..d40d8a04d 100644 --- a/compiler/ssdebug.m +++ b/compiler/ssdebug.m @@ -214,12 +214,14 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.make_goal. :- import_module hlds.mode_test. :- import_module hlds.passes_aux. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module hlds.status. diff --git a/compiler/stack_alloc.m b/compiler/stack_alloc.m index ecfd8c6b8..3c85bc130 100644 --- a/compiler/stack_alloc.m +++ b/compiler/stack_alloc.m @@ -28,7 +28,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. %-----------------------------------------------------------------------------% @@ -42,6 +43,7 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_llds. +:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/stack_layout.m b/compiler/stack_layout.m index 12bfa409a..dc99c0c7c 100644 --- a/compiler/stack_layout.m +++ b/compiler/stack_layout.m @@ -34,8 +34,8 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module ll_backend.continuation_info. :- import_module ll_backend.global_data. diff --git a/compiler/stack_opt.m b/compiler/stack_opt.m index 7ee31c79d..a109171ec 100644 --- a/compiler/stack_opt.m +++ b/compiler/stack_opt.m @@ -80,7 +80,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module io. @@ -111,6 +112,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. :- import_module hlds.quantification. :- import_module hlds.type_util. diff --git a/compiler/stm_expand.m b/compiler/stm_expand.m index f6369fe08..05d756848 100644 --- a/compiler/stm_expand.m +++ b/compiler/stm_expand.m @@ -177,6 +177,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_test. :- import_module hlds.instmap. @@ -184,6 +185,7 @@ :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. diff --git a/compiler/store_alloc.m b/compiler/store_alloc.m index 03ddb4831..725f5115d 100644 --- a/compiler/store_alloc.m +++ b/compiler/store_alloc.m @@ -30,7 +30,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. %-----------------------------------------------------------------------------% @@ -48,6 +49,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. +:- import_module hlds.hlds_pred. :- import_module hlds.instmap. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/stratify.m b/compiler/stratify.m index f79e47efc..e94ef8034 100644 --- a/compiler/stratify.m +++ b/compiler/stratify.m @@ -56,7 +56,9 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_test. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.dependency_graph. :- import_module libs.globals. diff --git a/compiler/structure_reuse.analysis.m b/compiler/structure_reuse.analysis.m index 71bd8446e..ff72915ed 100644 --- a/compiler/structure_reuse.analysis.m +++ b/compiler/structure_reuse.analysis.m @@ -54,7 +54,7 @@ :- import_module analysis.framework. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.ctgc.structure_reuse.domain. :- import_module bool. @@ -98,6 +98,8 @@ :- import_module hlds.goal_path. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. diff --git a/compiler/structure_reuse.direct.m b/compiler/structure_reuse.direct.m index 2e6084ad8..7163a9e82 100644 --- a/compiler/structure_reuse.direct.m +++ b/compiler/structure_reuse.direct.m @@ -27,7 +27,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.ctgc.structure_reuse.domain. :- import_module transform_hlds.ctgc.structure_sharing. :- import_module transform_hlds.ctgc.structure_sharing.domain. @@ -57,6 +57,8 @@ :- import_module analysis. :- import_module analysis.framework. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. :- import_module hlds.pred_name. :- import_module hlds.status. diff --git a/compiler/structure_reuse.direct_choose_reuse.m b/compiler/structure_reuse.direct_choose_reuse.m index 6b84e66fa..b4beb781e 100644 --- a/compiler/structure_reuse.direct_choose_reuse.m +++ b/compiler/structure_reuse.direct_choose_reuse.m @@ -105,7 +105,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module transform_hlds.ctgc.structure_reuse.dead_cell_table. :- import_module transform_hlds.ctgc.structure_reuse.domain. diff --git a/compiler/structure_reuse.direct_detect_garbage.m b/compiler/structure_reuse.direct_detect_garbage.m index 3123adea5..a25237b67 100644 --- a/compiler/structure_reuse.direct_detect_garbage.m +++ b/compiler/structure_reuse.direct_detect_garbage.m @@ -21,6 +21,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module transform_hlds.ctgc.structure_reuse.dead_cell_table. :- import_module transform_hlds.ctgc.structure_sharing. :- import_module transform_hlds.ctgc.structure_sharing.domain. @@ -42,6 +43,7 @@ :- implementation. +:- import_module hlds.pred_proc_id. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/structure_reuse.domain.m b/compiler/structure_reuse.domain.m index 644d31b00..ba20e2214 100644 --- a/compiler/structure_reuse.domain.m +++ b/compiler/structure_reuse.domain.m @@ -22,6 +22,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_data_pragma. diff --git a/compiler/structure_reuse.indirect.m b/compiler/structure_reuse.indirect.m index 831c853cb..3841562d5 100644 --- a/compiler/structure_reuse.indirect.m +++ b/compiler/structure_reuse.indirect.m @@ -19,7 +19,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.ctgc.structure_reuse.domain. :- import_module transform_hlds.ctgc.structure_sharing. :- import_module transform_hlds.ctgc.structure_sharing.domain. @@ -78,6 +78,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_name. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/structure_reuse.lbu.m b/compiler/structure_reuse.lbu.m index f0d87bf5d..19c42a165 100644 --- a/compiler/structure_reuse.lbu.m +++ b/compiler/structure_reuse.lbu.m @@ -29,7 +29,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- pred backward_use_information(proc_info::in, proc_info::out) is det. diff --git a/compiler/structure_reuse.lfu.m b/compiler/structure_reuse.lfu.m index 1e624d1bf..454f0e3dd 100644 --- a/compiler/structure_reuse.lfu.m +++ b/compiler/structure_reuse.lfu.m @@ -23,7 +23,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree. :- import_module parse_tree.set_of_var. diff --git a/compiler/structure_reuse.versions.m b/compiler/structure_reuse.versions.m index 7f71206a1..5ab3aa09d 100644 --- a/compiler/structure_reuse.versions.m +++ b/compiler/structure_reuse.versions.m @@ -20,7 +20,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.ctgc.structure_reuse.domain. :- import_module io. @@ -67,6 +67,8 @@ :- import_module check_hlds. :- import_module check_hlds.recompute_instmap_deltas. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. diff --git a/compiler/structure_sharing.analysis.m b/compiler/structure_sharing.analysis.m index 2eda8457b..f5e59470e 100644 --- a/compiler/structure_sharing.analysis.m +++ b/compiler/structure_sharing.analysis.m @@ -72,7 +72,9 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/structure_sharing.domain.m b/compiler/structure_sharing.domain.m index 85582c78c..60f415aee 100644 --- a/compiler/structure_sharing.domain.m +++ b/compiler/structure_sharing.domain.m @@ -59,6 +59,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_data_foreign. diff --git a/compiler/style_checks.m b/compiler/style_checks.m index c80cf90e9..accde4794 100644 --- a/compiler/style_checks.m +++ b/compiler/style_checks.m @@ -76,7 +76,9 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/switch_detection.m b/compiler/switch_detection.m index c76e35525..51396fc79 100644 --- a/compiler/switch_detection.m +++ b/compiler/switch_detection.m @@ -21,7 +21,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module io. @@ -55,10 +55,12 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_test. :- import_module hlds.instmap. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module hlds.quantification. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/switch_util.m b/compiler/switch_util.m index f9c5b7bb7..7a9d71623 100644 --- a/compiler/switch_util.m +++ b/compiler/switch_util.m @@ -169,7 +169,6 @@ :- implementation. :- import_module hlds.hlds_code_util. -:- import_module hlds.hlds_pred. :- import_module hlds.type_classify. :- import_module libs.optimization_options. :- import_module parse_tree.prog_type. diff --git a/compiler/table_gen.m b/compiler/table_gen.m index 9956809e3..80342efce 100644 --- a/compiler/table_gen.m +++ b/compiler/table_gen.m @@ -68,6 +68,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. @@ -75,6 +76,7 @@ :- import_module hlds.mode_test. :- import_module hlds.mode_util. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.proc_info_types. :- import_module hlds.status. diff --git a/compiler/tabling_analysis.m b/compiler/tabling_analysis.m index f9179e7b0..a2b404d53 100644 --- a/compiler/tabling_analysis.m +++ b/compiler/tabling_analysis.m @@ -86,7 +86,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.dependency_graph. diff --git a/compiler/tag_switch_util.m b/compiler/tag_switch_util.m index 2c205bc42..96c6e0212 100644 --- a/compiler/tag_switch_util.m +++ b/compiler/tag_switch_util.m @@ -233,7 +233,6 @@ :- implementation. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.globals. :- import_module parse_tree.prog_type. diff --git a/compiler/term_constr_build.m b/compiler/term_constr_build.m index 4f43e6e60..8d754aa19 100644 --- a/compiler/term_constr_build.m +++ b/compiler/term_constr_build.m @@ -66,8 +66,10 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_test. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module hlds.quantification. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/term_constr_data.m b/compiler/term_constr_data.m index 220fa349a..d1f18cd08 100644 --- a/compiler/term_constr_data.m +++ b/compiler/term_constr_data.m @@ -113,7 +113,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.lp_rational. :- import_module libs.polyhedron. diff --git a/compiler/term_constr_errors.m b/compiler/term_constr_errors.m index 82f6ee72d..ffae80b35 100644 --- a/compiler/term_constr_errors.m +++ b/compiler/term_constr_errors.m @@ -17,7 +17,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. @@ -76,6 +76,7 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/term_constr_fixpoint.m b/compiler/term_constr_fixpoint.m index 9e1ff5e3a..755bf3191 100644 --- a/compiler/term_constr_fixpoint.m +++ b/compiler/term_constr_fixpoint.m @@ -24,7 +24,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.term_constr_data. :- import_module transform_hlds.term_constr_errors. @@ -60,6 +60,8 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/term_constr_initial.m b/compiler/term_constr_initial.m index 081df6e06..9de188178 100644 --- a/compiler/term_constr_initial.m +++ b/compiler/term_constr_initial.m @@ -56,7 +56,9 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.lp_rational. diff --git a/compiler/term_constr_main.m b/compiler/term_constr_main.m index d18b5f14f..5f39e4631 100644 --- a/compiler/term_constr_main.m +++ b/compiler/term_constr_main.m @@ -101,6 +101,8 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/term_constr_pass2.m b/compiler/term_constr_pass2.m index 08e742ec0..2b618a2d4 100644 --- a/compiler/term_constr_pass2.m +++ b/compiler/term_constr_pass2.m @@ -24,7 +24,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.term_constr_main_types. %-----------------------------------------------------------------------------% @@ -50,6 +50,8 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module libs. :- import_module libs.lp_rational. :- import_module libs.polyhedron. diff --git a/compiler/term_constr_util.m b/compiler/term_constr_util.m index 55cc0934b..672043d9c 100644 --- a/compiler/term_constr_util.m +++ b/compiler/term_constr_util.m @@ -20,6 +20,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.lp_rational. :- import_module libs.polyhedron. @@ -209,6 +210,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_proc. :- import_module hlds.type_util. :- import_module libs.rat. :- import_module parse_tree.prog_type. diff --git a/compiler/term_errors.m b/compiler/term_errors.m index 5611b1b5a..8f1809bdd 100644 --- a/compiler/term_errors.m +++ b/compiler/term_errors.m @@ -20,7 +20,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. @@ -161,6 +161,8 @@ :- implementation. :- import_module hlds.hlds_error_util. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module libs. :- import_module libs.options. :- import_module parse_tree.prog_data_pragma. diff --git a/compiler/term_pass1.m b/compiler/term_pass1.m index 9ca5b899f..63ba0a734 100644 --- a/compiler/term_pass1.m +++ b/compiler/term_pass1.m @@ -26,7 +26,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.term_errors. :- import_module transform_hlds.term_util. @@ -57,6 +57,8 @@ :- import_module hlds.goal_transform. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module libs. :- import_module libs.lp. :- import_module parse_tree. diff --git a/compiler/term_pass2.m b/compiler/term_pass2.m index ea61bdd55..66d745929 100644 --- a/compiler/term_pass2.m +++ b/compiler/term_pass2.m @@ -21,7 +21,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module transform_hlds.term_util. %-----------------------------------------------------------------------------% @@ -39,6 +39,8 @@ :- implementation. :- import_module hlds.goal_transform. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_test. :- import_module parse_tree. :- import_module parse_tree.prog_data. diff --git a/compiler/term_traversal.m b/compiler/term_traversal.m index a0843ef93..6d9d515bf 100644 --- a/compiler/term_traversal.m +++ b/compiler/term_traversal.m @@ -24,7 +24,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.var_table. @@ -114,6 +114,8 @@ :- implementation. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module parse_tree.prog_data_pragma. :- import_module parse_tree.prog_type. :- import_module parse_tree.prog_type_test. diff --git a/compiler/term_util.m b/compiler/term_util.m index 6bfc206cb..0436440b3 100644 --- a/compiler/term_util.m +++ b/compiler/term_util.m @@ -24,6 +24,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_data_foreign. diff --git a/compiler/termination.m b/compiler/termination.m index 6e7a9cf87..3d869ca50 100644 --- a/compiler/termination.m +++ b/compiler/termination.m @@ -57,7 +57,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.dependency_graph. diff --git a/compiler/trace_gen.m b/compiler/trace_gen.m index ec9b3f7ad..8dd603769 100644 --- a/compiler/trace_gen.m +++ b/compiler/trace_gen.m @@ -52,7 +52,7 @@ :- import_module hlds. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/trace_params.m b/compiler/trace_params.m index 37be8aced..47914747c 100644 --- a/compiler/trace_params.m +++ b/compiler/trace_params.m @@ -39,6 +39,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. @@ -149,6 +150,7 @@ :- implementation. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.status. diff --git a/compiler/trailing_analysis.m b/compiler/trailing_analysis.m index dc633ee8c..222070b89 100644 --- a/compiler/trailing_analysis.m +++ b/compiler/trailing_analysis.m @@ -86,7 +86,9 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.passes_aux. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.type_classify. :- import_module hlds.type_util. diff --git a/compiler/transform_llds.m b/compiler/transform_llds.m index 86ff172a9..e93d97202 100644 --- a/compiler/transform_llds.m +++ b/compiler/transform_llds.m @@ -41,7 +41,7 @@ :- import_module backend_libs.builtin_ops. :- import_module hlds. :- import_module hlds.code_model. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module libs.options. :- import_module libs.trace_params. :- import_module mdbcomp. @@ -109,8 +109,8 @@ transform_llds(Globals, !CFile) :- gen_end_label_module(ModuleName, LastModule) = EndLabelModule :- Arity = 0, - ProcId = hlds_pred.initial_proc_id, - PredId = hlds_pred.initial_pred_id, + ProcId = initial_proc_id, + PredId = initial_pred_id, PredName = "ACCURATE_GC_END_LABEL", ProcLabel = ordinary_proc_label(ModuleName, pf_predicate, ModuleName, PredName, Arity, proc_id_to_int(ProcId)), diff --git a/compiler/try_expand.m b/compiler/try_expand.m index 9b720e5cf..9339d90c7 100644 --- a/compiler/try_expand.m +++ b/compiler/try_expand.m @@ -234,9 +234,11 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.make_goal. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module mdbcomp. diff --git a/compiler/tupling.m b/compiler/tupling.m index db2338a86..ef66ad252 100644 --- a/compiler/tupling.m +++ b/compiler/tupling.m @@ -114,11 +114,13 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.make_goal. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module libs. diff --git a/compiler/type_assign.m b/compiler/type_assign.m index 1f45bb4d6..d973ff756 100644 --- a/compiler/type_assign.m +++ b/compiler/type_assign.m @@ -21,7 +21,7 @@ :- import_module hlds.hlds_class. :- import_module hlds.hlds_cons. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.vartypes. diff --git a/compiler/type_class_info.m b/compiler/type_class_info.m index 1bca7fe9d..0683927de 100644 --- a/compiler/type_class_info.m +++ b/compiler/type_class_info.m @@ -50,6 +50,7 @@ :- import_module hlds.hlds_class. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. diff --git a/compiler/type_ctor_info.m b/compiler/type_ctor_info.m index 044932f6a..47664c673 100644 --- a/compiler/type_ctor_info.m +++ b/compiler/type_ctor_info.m @@ -73,8 +73,8 @@ :- import_module backend_libs.type_class_info. :- import_module hlds.hlds_class. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_proc_id. :- import_module hlds.special_pred. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/typecheck.m b/compiler/typecheck.m index 296af1bda..c9ee8ef43 100644 --- a/compiler/typecheck.m +++ b/compiler/typecheck.m @@ -132,6 +132,7 @@ :- import_module hlds.passes_aux. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.special_pred. :- import_module hlds.status. diff --git a/compiler/typecheck_clauses.m b/compiler/typecheck_clauses.m index 076246556..40a07c4fc 100644 --- a/compiler/typecheck_clauses.m +++ b/compiler/typecheck_clauses.m @@ -56,6 +56,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.type_rename. :- import_module mdbcomp. diff --git a/compiler/typecheck_cons_infos.m b/compiler/typecheck_cons_infos.m index 3e82e1021..c86ca0756 100644 --- a/compiler/typecheck_cons_infos.m +++ b/compiler/typecheck_cons_infos.m @@ -87,6 +87,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.pred_info_types. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module mdbcomp.prim_data. diff --git a/compiler/typecheck_error_builtin.m b/compiler/typecheck_error_builtin.m index ee2b5ae14..fda1ad03a 100644 --- a/compiler/typecheck_error_builtin.m +++ b/compiler/typecheck_error_builtin.m @@ -85,7 +85,6 @@ :- import_module hlds. :- import_module hlds.hlds_class. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module mdbcomp.prim_data. :- import_module term. diff --git a/compiler/typecheck_error_overload.m b/compiler/typecheck_error_overload.m index e7407a2b3..65d416fd0 100644 --- a/compiler/typecheck_error_overload.m +++ b/compiler/typecheck_error_overload.m @@ -62,7 +62,6 @@ :- import_module hlds. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.options. :- import_module mdbcomp. diff --git a/compiler/typecheck_error_undef.m b/compiler/typecheck_error_undef.m index 17131c71e..92ae8faff 100644 --- a/compiler/typecheck_error_undef.m +++ b/compiler/typecheck_error_undef.m @@ -24,6 +24,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree. diff --git a/compiler/typecheck_error_unify.m b/compiler/typecheck_error_unify.m index 419ae1a21..b7687be39 100644 --- a/compiler/typecheck_error_unify.m +++ b/compiler/typecheck_error_unify.m @@ -57,7 +57,6 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.maybe_util. :- import_module mdbcomp.builtin_modules. diff --git a/compiler/typecheck_error_util.m b/compiler/typecheck_error_util.m index 43f0795c8..4079e9aa7 100644 --- a/compiler/typecheck_error_util.m +++ b/compiler/typecheck_error_util.m @@ -23,7 +23,7 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. @@ -137,6 +137,7 @@ :- implementation. :- import_module hlds.hlds_cons. +:- import_module hlds.hlds_pred. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/typecheck_error_wrong_type.m b/compiler/typecheck_error_wrong_type.m index af30391e1..bd1b061f7 100644 --- a/compiler/typecheck_error_wrong_type.m +++ b/compiler/typecheck_error_wrong_type.m @@ -68,7 +68,6 @@ :- import_module hlds. :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module parse_tree.error_type_util. :- import_module list. diff --git a/compiler/typecheck_errors.m b/compiler/typecheck_errors.m index cd43f6bc3..3d7ed1b86 100644 --- a/compiler/typecheck_errors.m +++ b/compiler/typecheck_errors.m @@ -50,7 +50,6 @@ :- import_module hlds.hlds_class. :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.options. :- import_module mdbcomp. diff --git a/compiler/typecheck_info.m b/compiler/typecheck_info.m index 3f1677e91..12e659354 100644 --- a/compiler/typecheck_info.m +++ b/compiler/typecheck_info.m @@ -25,6 +25,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module mdbcomp. diff --git a/compiler/typecheck_msgs.m b/compiler/typecheck_msgs.m index 0361060e3..f3a9a1de6 100644 --- a/compiler/typecheck_msgs.m +++ b/compiler/typecheck_msgs.m @@ -12,7 +12,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. @@ -34,6 +34,7 @@ :- implementation. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. :- import_module hlds.pred_table. :- import_module libs. :- import_module libs.options. diff --git a/compiler/types_into_modes.m b/compiler/types_into_modes.m index 0adcaad21..294371c8f 100644 --- a/compiler/types_into_modes.m +++ b/compiler/types_into_modes.m @@ -18,6 +18,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.inst_mode_type_prop. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.error_spec. :- import_module parse_tree.prog_data. @@ -50,6 +51,7 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_proc. :- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/unify_gen_construct.m b/compiler/unify_gen_construct.m index cb115ded4..b2d7671ea 100644 --- a/compiler/unify_gen_construct.m +++ b/compiler/unify_gen_construct.m @@ -63,11 +63,11 @@ :- import_module hlds.goal_form. :- import_module hlds.hlds_code_util. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.mode_top_functor. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.type_classify. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/unify_gen_deconstruct.m b/compiler/unify_gen_deconstruct.m index d0cf9e76c..d30564849 100644 --- a/compiler/unify_gen_deconstruct.m +++ b/compiler/unify_gen_deconstruct.m @@ -46,7 +46,6 @@ :- import_module hlds.goal_form. :- import_module hlds.hlds_code_util. :- import_module hlds.hlds_data. -:- import_module hlds.hlds_pred. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/unify_gen_test.m b/compiler/unify_gen_test.m index 861369577..a27aa7f7c 100644 --- a/compiler/unify_gen_test.m +++ b/compiler/unify_gen_test.m @@ -44,7 +44,6 @@ :- import_module hlds.hlds_code_util. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. -:- import_module hlds.hlds_pred. :- import_module libs. :- import_module libs.globals. :- import_module ll_backend.code_util. diff --git a/compiler/unify_proc.m b/compiler/unify_proc.m index 86ca9f7a9..b680230ad 100644 --- a/compiler/unify_proc.m +++ b/compiler/unify_proc.m @@ -45,7 +45,7 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/unique_modes.m b/compiler/unique_modes.m index 52b5abf5b..49ef129e5 100644 --- a/compiler/unique_modes.m +++ b/compiler/unique_modes.m @@ -84,12 +84,14 @@ :- import_module check_hlds.modes. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_lookup. :- import_module hlds.inst_match. :- import_module hlds.instmap. :- import_module hlds.make_goal. :- import_module hlds.mode_util. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module parse_tree.prog_data_foreign. diff --git a/compiler/unneeded_code.m b/compiler/unneeded_code.m index c0afc0a7b..a7b1fb1a9 100644 --- a/compiler/unneeded_code.m +++ b/compiler/unneeded_code.m @@ -62,7 +62,8 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module io. @@ -84,6 +85,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.inst_test. :- import_module hlds.instmap. diff --git a/compiler/untupling.m b/compiler/untupling.m index b5478d686..af2d32f33 100644 --- a/compiler/untupling.m +++ b/compiler/untupling.m @@ -116,10 +116,12 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.make_goal. :- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. diff --git a/compiler/unused_args.m b/compiler/unused_args.m index 39cdd61e2..29b5cce25 100644 --- a/compiler/unused_args.m +++ b/compiler/unused_args.m @@ -75,11 +75,13 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.inst_match. :- import_module hlds.passes_aux. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module libs. :- import_module libs.globals. :- import_module libs.maybe_util. @@ -367,7 +369,7 @@ should_ignore_proc_unused_args(PredInfo, ProcId, ProcInfo) :- pred_info_is_imported(PredInfo) ; pred_info_is_pseudo_imported(PredInfo), - hlds_pred.in_in_unification_proc_id(ProcId) + in_in_unification_proc_id(ProcId) ; % Unused argument optimization and tabling are % not compatible with each other. diff --git a/compiler/unused_args_analysis.m b/compiler/unused_args_analysis.m index 5ce08eb0a..ad8f65ca7 100644 --- a/compiler/unused_args_analysis.m +++ b/compiler/unused_args_analysis.m @@ -22,7 +22,7 @@ :- import_module analysis.framework. :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -75,6 +75,8 @@ :- import_module analysis.operations. :- import_module hlds.goal_refs. :- import_module hlds.hlds_goal. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module transform_hlds.mmc_analysis. diff --git a/compiler/unused_args_base_ops.m b/compiler/unused_args_base_ops.m index 6c14ddb7e..f76c1708c 100644 --- a/compiler/unused_args_base_ops.m +++ b/compiler/unused_args_base_ops.m @@ -20,7 +20,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module parse_tree. :- import_module parse_tree.prog_data. @@ -167,6 +167,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.hlds_proc. :- import_module parse_tree.parse_tree_out_term. :- import_module parse_tree.var_table. diff --git a/compiler/unused_args_optimize.m b/compiler/unused_args_optimize.m index 6b72559ec..89132bcbb 100644 --- a/compiler/unused_args_optimize.m +++ b/compiler/unused_args_optimize.m @@ -26,7 +26,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. :- import_module transform_hlds.unused_args_base_ops. @@ -35,6 +35,8 @@ :- import_module list. :- import_module map. +%---------------------------------------------------------------------------% + % Information about procedures which have new predicates created for the % optimized version. % @@ -71,6 +73,8 @@ :- import_module analysis.operations. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. diff --git a/compiler/unused_args_warn_pragma.m b/compiler/unused_args_warn_pragma.m index a7a541dac..265148681 100644 --- a/compiler/unused_args_warn_pragma.m +++ b/compiler/unused_args_warn_pragma.m @@ -60,8 +60,10 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.options. diff --git a/compiler/unused_imports.m b/compiler/unused_imports.m index ca448e92f..1b996fb40 100644 --- a/compiler/unused_imports.m +++ b/compiler/unused_imports.m @@ -55,6 +55,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_inst_mode. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. +:- import_module hlds.pred_proc_id. :- import_module hlds.status. :- import_module libs. :- import_module libs.options. diff --git a/compiler/var_origins.m b/compiler/var_origins.m index d0f768712..95a4cbd96 100644 --- a/compiler/var_origins.m +++ b/compiler/var_origins.m @@ -47,6 +47,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_proc_id. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/xml_documentation.m b/compiler/xml_documentation.m index 809520ba4..3d0050f70 100644 --- a/compiler/xml_documentation.m +++ b/compiler/xml_documentation.m @@ -39,8 +39,10 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.hlds_proc. :- import_module hlds.hlds_proc_util. :- import_module hlds.pred_name. +:- import_module hlds.pred_proc_id. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module libs.