diff --git a/compiler/accumulator.m b/compiler/accumulator.m index 90dfa58cc..7f29afcc6 100644 --- a/compiler/accumulator.m +++ b/compiler/accumulator.m @@ -175,8 +175,10 @@ :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_promise. :- import_module hlds.instmap. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/add_clause.m b/compiler/add_clause.m index 957e54799..c11c2b63b 100644 --- a/compiler/add_clause.m +++ b/compiler/add_clause.m @@ -75,6 +75,7 @@ :- import_module hlds.make_hlds.superhomogeneous_util. :- import_module hlds.make_hlds_error. :- import_module hlds.pre_quantification. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. :- import_module hlds.quantification. diff --git a/compiler/add_foreign_proc.m b/compiler/add_foreign_proc.m index 0061a831f..4d747550c 100644 --- a/compiler/add_foreign_proc.m +++ b/compiler/add_foreign_proc.m @@ -45,6 +45,7 @@ :- import_module hlds.hlds_pred. :- 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_table. :- import_module hlds.quantification. diff --git a/compiler/add_pragma_decl.m b/compiler/add_pragma_decl.m index 0a29c2f6f..62a7a3db7 100644 --- a/compiler/add_pragma_decl.m +++ b/compiler/add_pragma_decl.m @@ -85,6 +85,7 @@ :- 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_table. :- import_module hlds.status. :- import_module mdbcomp. diff --git a/compiler/add_pragma_gen.m b/compiler/add_pragma_gen.m index eca41e264..ad4584cb2 100644 --- a/compiler/add_pragma_gen.m +++ b/compiler/add_pragma_gen.m @@ -47,6 +47,7 @@ :- import_module hlds.hlds_pred. :- import_module hlds.make_hlds.add_pragma_util. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module mdbcomp.sym_name. diff --git a/compiler/add_pragma_impl.m b/compiler/add_pragma_impl.m index 96ff6dfe2..a2dc75caa 100644 --- a/compiler/add_pragma_impl.m +++ b/compiler/add_pragma_impl.m @@ -67,6 +67,7 @@ :- import_module hlds.make_hlds.make_hlds_warn. :- import_module hlds.make_hlds_error. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/add_pragma_type_spec.m b/compiler/add_pragma_type_spec.m index bd200e523..ada01489d 100644 --- a/compiler/add_pragma_type_spec.m +++ b/compiler/add_pragma_type_spec.m @@ -36,6 +36,7 @@ :- import_module hlds.hlds_pred. :- 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_table. :- import_module hlds.status. diff --git a/compiler/add_pred.m b/compiler/add_pred.m index 99e1fb916..7fb9132cf 100644 --- a/compiler/add_pred.m +++ b/compiler/add_pred.m @@ -20,6 +20,7 @@ :- 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.status. :- import_module mdbcomp. @@ -105,6 +106,7 @@ :- import_module hlds.make_hlds.check_field_access_functions. :- import_module hlds.make_hlds_error. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.var_table_hlds. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/add_special_pred.m b/compiler/add_special_pred.m index a56cf8064..3c0c3ce3c 100644 --- a/compiler/add_special_pred.m +++ b/compiler/add_special_pred.m @@ -102,8 +102,10 @@ :- import_module check_hlds.unify_proc. :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_markers. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.special_pred. :- import_module hlds.var_table_hlds. :- import_module mdbcomp.sym_name. diff --git a/compiler/arg_info.m b/compiler/arg_info.m index 136568466..26e30dfb8 100644 --- a/compiler/arg_info.m +++ b/compiler/arg_info.m @@ -33,6 +33,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.var_table. diff --git a/compiler/call_gen.m b/compiler/call_gen.m index 26f4900a9..cbe4fefd3 100644 --- a/compiler/call_gen.m +++ b/compiler/call_gen.m @@ -22,6 +22,7 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.globals. :- import_module ll_backend.code_info. diff --git a/compiler/check_pragma_format_call.m b/compiler/check_pragma_format_call.m index 30b8cc37f..301dbd137 100644 --- a/compiler/check_pragma_format_call.m +++ b/compiler/check_pragma_format_call.m @@ -59,6 +59,7 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.mode_test. +:- import_module hlds.pred_info_types. :- import_module hlds.status. :- import_module mdbcomp. :- import_module mdbcomp.builtin_modules. diff --git a/compiler/check_promise.m b/compiler/check_promise.m index 8231d49af..bfba1ee3c 100644 --- a/compiler/check_promise.m +++ b/compiler/check_promise.m @@ -39,6 +39,7 @@ :- import_module hlds.hlds_pred. :- import_module hlds.hlds_promise. :- import_module hlds.passes_aux. +:- import_module hlds.pred_info_types. :- 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 aff901bb9..9ba975e58 100644 --- a/compiler/check_typeclass.m +++ b/compiler/check_typeclass.m @@ -142,8 +142,10 @@ :- import_module hlds.hlds_pred. :- 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_table. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/closure_gen.m b/compiler/closure_gen.m index 53a5903c2..2785a29f3 100644 --- a/compiler/closure_gen.m +++ b/compiler/closure_gen.m @@ -45,6 +45,7 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_proc_util. +:- import_module hlds.pred_info_types. :- import_module hlds.type_classify. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/code_gen.m b/compiler/code_gen.m index d7d554bd0..1501b079b 100644 --- a/compiler/code_gen.m +++ b/compiler/code_gen.m @@ -49,6 +49,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.globals. :- import_module ll_backend.call_gen. diff --git a/compiler/code_info.m b/compiler/code_info.m index d6c7cf5e1..4e55047e3 100644 --- a/compiler/code_info.m +++ b/compiler/code_info.m @@ -32,6 +32,7 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.globals. :- import_module libs.optimization_options. @@ -67,6 +68,7 @@ :- import_module backend_libs. :- import_module backend_libs.proc_label. :- import_module hlds.hlds_proc_util. +:- import_module hlds.proc_info_types. :- import_module hlds.type_util. :- import_module libs.options. :- import_module ll_backend.code_util. diff --git a/compiler/code_loc_dep.m b/compiler/code_loc_dep.m index 65744022c..b95f9597f 100644 --- a/compiler/code_loc_dep.m +++ b/compiler/code_loc_dep.m @@ -45,8 +45,8 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_llds. -:- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.options. :- import_module ll_backend.code_info. @@ -74,6 +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_util. :- import_module hlds.hlds_rtti. :- import_module libs.globals. diff --git a/compiler/code_util.m b/compiler/code_util.m index cd7f4ffe9..4912bcf1d 100644 --- a/compiler/code_util.m +++ b/compiler/code_util.m @@ -21,6 +21,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.optimization_options. :- import_module ll_backend.llds. diff --git a/compiler/continuation_info.m b/compiler/continuation_info.m index a89b3b9ca..b0d073f47 100644 --- a/compiler/continuation_info.m +++ b/compiler/continuation_info.m @@ -58,6 +58,8 @@ :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. +:- import_module hlds.pred_info_types. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.globals. :- import_module libs.trace_params. diff --git a/compiler/coverage_profiling.m b/compiler/coverage_profiling.m index ceec0eddb..25b650d2f 100644 --- a/compiler/coverage_profiling.m +++ b/compiler/coverage_profiling.m @@ -20,6 +20,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.proc_info_types. :- import_module mdbcomp. :- import_module mdbcomp.goal_path. :- import_module mdbcomp.program_representation. diff --git a/compiler/dead_proc_elim.m b/compiler/dead_proc_elim.m index 79f9cdb53..f1b0aa116 100644 --- a/compiler/dead_proc_elim.m +++ b/compiler/dead_proc_elim.m @@ -196,6 +196,7 @@ :- import_module hlds.passes_aux. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/deep_profiling.m b/compiler/deep_profiling.m index 7fef07e4a..426b50588 100644 --- a/compiler/deep_profiling.m +++ b/compiler/deep_profiling.m @@ -77,8 +77,10 @@ :- import_module hlds.instmap. :- import_module hlds.make_goal. :- import_module hlds.mode_top_functor. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.dependency_graph. :- import_module libs.file_util. diff --git a/compiler/default_func_mode.m b/compiler/default_func_mode.m index 51c89306b..eb17ba8c2 100644 --- a/compiler/default_func_mode.m +++ b/compiler/default_func_mode.m @@ -33,6 +33,7 @@ :- implementation. +:- import_module hlds.proc_info_types. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module parse_tree. diff --git a/compiler/deforest.m b/compiler/deforest.m index 290d35d9b..8df925f81 100644 --- a/compiler/deforest.m +++ b/compiler/deforest.m @@ -67,6 +67,7 @@ :- import_module hlds.instmap. :- import_module hlds.mode_util. :- import_module hlds.passes_aux. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.var_table_hlds. :- import_module libs. diff --git a/compiler/dep_par_conj.m b/compiler/dep_par_conj.m index 3cfdfa70c..73a6ee499 100644 --- a/compiler/dep_par_conj.m +++ b/compiler/dep_par_conj.m @@ -148,6 +148,7 @@ :- import_module hlds.mode_test. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/det_check_proc.m b/compiler/det_check_proc.m index 9c13178d7..0efd18fbd 100644 --- a/compiler/det_check_proc.m +++ b/compiler/det_check_proc.m @@ -84,6 +84,7 @@ :- import_module hlds.instmap. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/direct_arg_in_out.m b/compiler/direct_arg_in_out.m index fcca060aa..ff0b85c01 100644 --- a/compiler/direct_arg_in_out.m +++ b/compiler/direct_arg_in_out.m @@ -213,6 +213,7 @@ :- import_module hlds.passes_aux. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/distance_granularity.m b/compiler/distance_granularity.m index 440c73864..7d4ee96a4 100644 --- a/compiler/distance_granularity.m +++ b/compiler/distance_granularity.m @@ -140,6 +140,7 @@ :- import_module hlds.make_goal. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/exception_analysis.m b/compiler/exception_analysis.m index dc7136abc..2a53b6632 100644 --- a/compiler/exception_analysis.m +++ b/compiler/exception_analysis.m @@ -127,6 +127,7 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_goal. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.type_classify. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/export.m b/compiler/export.m index 87534b31c..bdb50275d 100644 --- a/compiler/export.m +++ b/compiler/export.m @@ -20,7 +20,7 @@ :- import_module hlds. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_foreign. @@ -93,6 +93,7 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_data. :- import_module hlds.hlds_llds. +:- import_module hlds.hlds_pred. :- import_module hlds.hlds_proc_util. :- import_module hlds.pred_table. :- import_module hlds.status. diff --git a/compiler/fact_table_gen.m b/compiler/fact_table_gen.m index 49bb1e3d1..4eb95bbf1 100644 --- a/compiler/fact_table_gen.m +++ b/compiler/fact_table_gen.m @@ -136,6 +136,7 @@ :- import_module hlds.inst_test. :- import_module hlds.mode_test. :- import_module hlds.mode_util. +:- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.file_util. :- import_module libs.globals. diff --git a/compiler/follow_vars.m b/compiler/follow_vars.m index 6277d4bc2..085e500cf 100644 --- a/compiler/follow_vars.m +++ b/compiler/follow_vars.m @@ -57,6 +57,7 @@ :- import_module hlds.arg_info. :- import_module hlds.code_model. :- import_module hlds.hlds_proc_util. +:- import_module hlds.pred_info_types. :- 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 1555b3686..4bf1616d5 100644 --- a/compiler/foreign_proc_gen.m +++ b/compiler/foreign_proc_gen.m @@ -71,6 +71,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.instmap. :- import_module hlds.mode_top_functor. +:- import_module hlds.pred_info_types. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/goal_form.m b/compiler/goal_form.m index e85fd7918..4fc1e74b8 100644 --- a/compiler/goal_form.m +++ b/compiler/goal_form.m @@ -246,6 +246,7 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_markers. +:- import_module hlds.proc_info_types. :- import_module parse_tree.prog_data_foreign. :- import_module parse_tree.prog_data_pragma. :- import_module transform_hlds. diff --git a/compiler/granularity.m b/compiler/granularity.m index eccf475b5..7af01fb23 100644 --- a/compiler/granularity.m +++ b/compiler/granularity.m @@ -39,6 +39,7 @@ :- import_module hlds.hlds_pred. :- import_module hlds.instmap. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module libs. :- import_module libs.dependency_graph. diff --git a/compiler/hlds.m b/compiler/hlds.m index 3a3b75f36..6dad31e93 100644 --- a/compiler/hlds.m +++ b/compiler/hlds.m @@ -34,7 +34,9 @@ :- include_module hlds_rtti. :- include_module inst_graph. :- include_module instmap. +:- include_module pred_info_types. :- include_module pred_table. +:- include_module proc_info_types. :- include_module special_pred. :- include_module status. diff --git a/compiler/hlds_clauses.m b/compiler/hlds_clauses.m index 6706e918e..4afc1fccd 100644 --- a/compiler/hlds_clauses.m +++ b/compiler/hlds_clauses.m @@ -21,6 +21,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_info_types. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module parse_tree. diff --git a/compiler/hlds_goal.m b/compiler/hlds_goal.m index d5e05b593..b2404ad08 100644 --- a/compiler/hlds_goal.m +++ b/compiler/hlds_goal.m @@ -35,6 +35,7 @@ :- import_module parse_tree.prog_data_pragma. :- import_module parse_tree.prog_rename. :- import_module parse_tree.set_of_var. +:- import_module parse_tree.var_db. :- import_module assoc_list. :- import_module list. @@ -1058,6 +1059,22 @@ string % Used to explain the source of the unification. ). +:- type call_id + ---> plain_call_id(pf_sym_name_pred_form_arity) + % The call is a plain call, and the argument specifies the callee. + ; generic_call_id(var_name_source, generic_call). + % The call is a generic call, specified by the second argument. + % If it is a higher order call, then the second argument will + % specify the variable holding the identity of the callee. + % The var_name_source is needed to convert this variable + % to a printable name in diagnotics. + +:- type generic_call_id + ---> gcid_higher_order(purity, pred_or_func, pred_form_arity) + ; gcid_class_method(class_id, pf_sym_name_pred_form_arity) + ; gcid_event_call(string) + ; gcid_cast(cast_kind). + % A unify_sub_context describes the location of sub-unification % (which is unifying one argument of a term) within a particular % unification. diff --git a/compiler/hlds_module.m b/compiler/hlds_module.m index 39148d680..471fa4f3b 100644 --- a/compiler/hlds_module.m +++ b/compiler/hlds_module.m @@ -32,6 +32,7 @@ :- import_module hlds.hlds_pred. :- import_module hlds.hlds_promise. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.special_pred. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/hlds_out_module.m b/compiler/hlds_out_module.m index 33c487d2d..de150118b 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.proc_info_types. :- import_module libs. :- import_module libs.dependency_graph. :- import_module libs.globals. diff --git a/compiler/hlds_out_pred.m b/compiler/hlds_out_pred.m index e7d0926ca..e83145ad5 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.proc_info_types. :- import_module libs. :- import_module libs.indent. :- import_module mdbcomp. @@ -84,6 +85,7 @@ :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.status. :- import_module hlds.var_table_hlds. diff --git a/compiler/hlds_pred.m b/compiler/hlds_pred.m index 6fe0e62d4..5d8f33fe4 100644 --- a/compiler/hlds_pred.m +++ b/compiler/hlds_pred.m @@ -18,8 +18,6 @@ :- module hlds.hlds_pred. :- interface. -:- import_module analysis. -:- import_module analysis.framework. :- import_module check_hlds. :- import_module check_hlds.mode_constraint_robdd. :- import_module hlds.hlds_class. @@ -33,15 +31,15 @@ :- 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_table. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. -:- import_module mdbcomp.goal_path. :- import_module mdbcomp.prim_data. -:- import_module mdbcomp.program_representation. :- import_module mdbcomp.sym_name. :- import_module parse_tree. :- import_module parse_tree.error_spec. @@ -49,7 +47,6 @@ :- 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_db. :- import_module parse_tree.var_table. :- import_module transform_hlds. :- import_module transform_hlds.term_constr_main_types. @@ -60,7 +57,6 @@ :- import_module map. :- import_module maybe. :- import_module one_or_more. -:- import_module pair. :- import_module set. :- implementation. @@ -73,14 +69,17 @@ :- 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_type_scan. :- import_module parse_tree.prog_util. :- import_module parse_tree.vartypes. :- import_module int. +:- import_module pair. :- import_module require. :- import_module string. :- import_module term. @@ -157,157 +156,16 @@ :- type pred_info. :- type proc_info. - % These types are abstract exported to permit the proc_info fields - % of these types to be part of the argument lists of proc_prepare_to_clone - % and proc_create. - % -:- type structure_sharing_info. -:- type structure_reuse_info. - :- type proc_table == map(proc_id, proc_info). :- pred next_proc_id(proc_table::in, proc_id::out) is det. -:- type call_id - ---> plain_call_id(pf_sym_name_pred_form_arity) - % The call is a plain call, and the argument specifies the callee. - ; generic_call_id(var_name_source, generic_call). - % The call is a generic call, specified by the second argument. - % If it is a higher order call, then the second argument will - % specify the variable holding the identity of the callee. - % The var_name_source is needed to convert this variable - % to a printable name in diagnotics. - -:- type generic_call_id - ---> gcid_higher_order(purity, pred_or_func, pred_form_arity) - ; gcid_class_method(class_id, pf_sym_name_pred_form_arity) - ; gcid_event_call(string) - ; gcid_cast(cast_kind). - -%---------------------------------------------------------------------------% - -:- type implementation_language - ---> impl_lang_mercury - ; impl_lang_foreign(foreign_language). - - % A predicate, and the goal inside it, may implement a promise declaration, - % or it may be an ordinary predicate. -:- type goal_type - ---> goal_not_for_promise(np_goal_type) - ; goal_for_promise(promise_type). - - % An ordinary non-promise predicate may be defined by Mercury clauses, - % foreign procs, both, or neither. (The last is the recorded situation - % when we have added the predicate's declaration to the HLDS but have not - % processed any clauses or foreign procs just yet.) - % - % We use this information in two ways. - % - % First, intermod.m needs to know whether a predicate's definition - % contains any foreign_procs, because if it does, then it cannot append - % variable numbers after variable names for disambiguation, in e.g. clause - % heads, since that would screw up references to those variables in the - % foreign code. - % - % Second, purity.m has special handling for predicates that are defined - % *only* by foreign procs. - % - % Therefore the compiler does make a distinction between how it handles - % np_goal_type_foreign and np_goal_type_clause_and_foreign. - % - % As it happens, the compiler makes no distinction between how it handles - % np_goal_type_none and np_goal_type_clause, with the obvious exception - % that adding a foreign proc to the two results in no_goal_types that - % *are* distinguishable. -:- type np_goal_type - ---> np_goal_type_none - ; np_goal_type_clause - ; np_goal_type_foreign - ; np_goal_type_clause_and_foreign. - - % NOTE: `liveness_info' records liveness in the sense used by code - % generation. This is *not* the same thing as the notion of liveness - % used by mode analysis! See compiler/notes/glossary.html. - % -:- type liveness_info == set_of_progvar. % The live variables. - -:- type arg_info - ---> arg_info( - arg_loc, % Stored location. - top_functor_mode % Mode of top functor. - ). - - % The top_functor_mode specifies the mode of the top-level functor - % of a term (excluding `no_tag' functors, since those have no - % representation). It is used by the code generators when determining - % how to pass the argument. - % - % For the LLDS back-end, top_in arguments are passed in registers, - % and top_out values are returned in registers; top_unused values - % are not passed at all, but they are treated as if they were top_out - % for the purpose of assigning arguments to registers. (So e.g. if - % a det procedure has three arguments with top_functor_modes top_out, - % top_unused, and top_out respectively, the last argument will be - % returned in register r3, not r2.) - % - % For the MLDS back-end, top_in values are passed as arguments. - % Top_out values are normally passed by reference, except that - % - if the procedure is model_nondet, and the --nondet-copy-out option - % is set, top_out values are passed by value to the continuation - % function; - % - if the procedure is model_det or model_semi, and the - % --det-copy-out option is set, top_out arguments in the HLDS - % are mapped to (multiple) return values in the MLDS; and - % - if the HLDS function return value for a det function has mode - % `top_out', it is mapped to an MLDS return value. - % top_unused arguments are not passed at all. - % -:- type top_functor_mode - ---> top_in - ; top_out - ; top_unused. - -:- type arg_loc - ---> reg(reg_type, int). - % Are calls from a predicate with the pred_markers always fully % qualified? Basically, this function tests for the presence or absence % of marker_calls_are_fully_qualified. % :- func calls_are_fully_qualified(pred_markers) = is_fully_qualified. -%---% - - % This type is isomorphic to the module_section type, but defining it here - % allows us not to depend on parse_tree.prog_item.m. -:- type decl_section - ---> decl_interface - ; decl_implementation. - -:- type maybe_predmode_decl - ---> no_predmode_decl - ; predmode_decl. - -:- type cur_user_decl_info - ---> cur_user_decl_info( - decl_section, - maybe_predmode_decl, - item_seq_num - ). - -:- type format_call_info - ---> format_call_info( - % The context of the format_call pragma whose info - % this field of the pred_info records. We use this - % to generate more informative error messages in cases of - % duplicate format_call pragmas. - prog_context, - - % The pairs - % listed in that pragma. - one_or_more(format_string_values) - ). - % pred_info_init(PredOrFunc, PredModuleName, PredName, Arity, Context, % Origin, Status, CurUserDecl, GoalType, Markers, % ArgTypes, TypeVarSet, ExistQVars, ClassContext, ClassProofs, @@ -550,13 +408,6 @@ :- pred pred_info_set_proc_table(proc_table::in, pred_info::in, pred_info::out) is det. - % Mode information for the arguments of a procedure. - % The first map gives the instantiation state on entry of the node - % corresponding to the prog_var. The second map gives the instantiation - % state on exit. - % -:- type arg_modes_map == pair(map(prog_var, bool)). - % Return a list of the proc_ids for all the modes of this predicate, % :- func pred_info_all_proc_ids(pred_info) = list(proc_id). @@ -667,8 +518,6 @@ :- implementation. -:- import_module libs.optimization_options. - :- type pred_id ---> pred_id(int). @@ -1695,284 +1544,6 @@ pred_info_get_sym_name(PredInfo, SymName) :- :- interface. -:- type is_address_taken - ---> address_is_taken - ; address_is_not_taken. - -:- type deep_recursion_info - ---> deep_recursion_info( - dri_role :: deep_profile_role, - - % If the procedure is not tail recursive, this list is empty. - % Otherwise, it contains outer-inner pairs of procedures - % in the visible SCC, including this procedure and its copy. - dri_visible_scc :: list(visible_scc_data) - ). - -:- type deep_profile_role - ---> deep_prof_inner_proc( - dpip_outer_proc :: pred_proc_id - ) - ; deep_prof_outer_proc( - dpop_inner_proc :: pred_proc_id - ). - -:- type visible_scc_data - ---> visible_scc_data( - vis_outer_proc :: pred_proc_id, - vis_inner_proc :: pred_proc_id, - - % A list of all the call site numbers that correspond to - % tail calls. (Call sites are numbered depth-first, - % left-to-right, starting from zero.) - rec_call_sites :: list(int) - ). - -:- type call_site_static_data % defines MR_CallSiteStatic - ---> normal_call( - normal_callee :: rtti_proc_label, - normal_type_subst :: string, - normal_file_name :: string, - normal_line_number :: int, - normal_goal_path :: forward_goal_path - ) - ; special_call( - special_file_name :: string, - special_line_number :: int, - special_goal_path :: forward_goal_path - ) - ; higher_order_call( - higher_order_file_name :: string, - ho_line_number :: int, - ho_goal_path :: forward_goal_path - ) - ; method_call( - method_file_name :: string, - method_line_number :: int, - method_goal_path :: forward_goal_path - ) - ; callback( - callback_file_name :: string, - callback_line_number :: int, - callback_goal_path :: forward_goal_path - ). - -:- type hlds_proc_static - ---> hlds_proc_static( % defines part of MR_ProcStatic - proc_static_file_name :: string, - proc_static_line_number :: int, - proc_is_in_interface :: bool, - call_site_statics :: list(call_site_static_data), - coverage_points :: list(coverage_point_info) - ). - - % The hlds_deep_excp_vars gives the variables that hold the values returned - % by the call port code, which are needed to let exception.throw perform - % the work we need to do at the excp port. -:- type hlds_deep_excp_vars - ---> hlds_deep_excp_vars( - top_csd :: prog_var, - middle_csd :: prog_var, - old_outermost :: maybe(prog_var) - % Needed only with the save/restore - % approach, not the activation counting - % approach. - ). - -:- type hlds_deep_layout - ---> hlds_deep_layout( - deep_layout_static :: hlds_proc_static, - deep_layout_excp :: hlds_deep_excp_vars - ). - -:- type deep_profile_proc_info - ---> deep_profile_proc_info( - % This field is set during the first part of the deep profiling - % transformation; tail recursion, if that is enabled. - deep_rec :: maybe(deep_recursion_info), - - % This field is set during the second part; it will be bound - % to `no' before and during the first part, and to `yes' - % after the second. The contents of this field govern - % what will go into MR_ProcStatic structures. - deep_layout :: maybe(hlds_deep_layout), - - % This field stores the original body of a procedure, - % before either part of the deep profiling transformation - % was executed. For inner procedures created by the tail - % recursion part of the deep profiling transformation, - % it holds the original body of the outer procedure. - deep_orig_body :: deep_original_body - ). - -:- type deep_original_body - ---> deep_original_body( - dob_body :: hlds_goal, - dob_head_vars :: list(prog_var), - dob_instmap :: instmap, - dob_var_table :: var_table, - dob_detism :: determinism - ). - -:- type table_arg_infos - ---> table_arg_infos( - list(table_arg_info), - map(tvar, table_locn) - ). - -:- type table_arg_info - ---> table_arg_info( - orig_var_num :: int, - orig_var_name :: string, - slot_num :: int, - arg_type :: mer_type - ). - - % This type is analogous to layout_locn in llds.m, but it refers - % not to lvals, but to slots in the extended answer blocks used by - % I/O action tabling for declarative debugging. -:- type table_locn - ---> table_locn_direct(int) - ; table_locn_indirect(int, int). - - % This type differs from the type table_step_kind in table_statistics.m - % in the library in that - % (a) in gives more information about the type of the corresponding - % argument (if this info is needed and available), - % (b) it doesn't have to be an enum, and - % (c) it doesn't have to handle dummy steps. - % -:- type table_trie_step - ---> table_trie_step_dummy - ; table_trie_step_int(int_type) - ; table_trie_step_char - ; table_trie_step_string - ; table_trie_step_float - ; table_trie_step_enum( - % The int gives the maximum enum value in the enum type + 1, - % and thus the size of the corresponding trie node. - % If the enum type is not a subtype, then the value is equal to - % the number of alternatives in the type. - int - ) - ; table_trie_step_foreign_enum - ; table_trie_step_general( - mer_type, - table_is_poly, - table_value_or_addr - ) - ; table_trie_step_typeinfo - ; table_trie_step_typeclassinfo - ; table_trie_step_promise_implied. - -:- type table_is_poly - ---> table_is_mono % The table type is monomorphic. - ; table_is_poly. % The table type is polymorphic. - -:- type table_value_or_addr - ---> table_value % We are tabling the value itself. - ; table_addr. % We are tabling only the address. - - % Return a description of what kind of statistics we collect for a trie - % step of a given kind. The description is the name of a value in the C - % enum type MR_TableStepStatsKind. (We will need to generalize this - % when we implement tabling for non-C backends.) - % -:- func table_step_stats_kind(table_trie_step) = string. - -:- type proc_table_io_info - ---> proc_table_io_info( - % The information we need to display an I/O action to the user. - % - % The table_arg_infos correspond one to one to the elements - % of the block saved for an I/O action. The first element - % will be the pointer to the proc_layout of the action's - % procedure. - % - % The right tvarset for interpreting the types in the - % table_arg_infos is the one in the proc_info in which - % the proc_table_io_info is stored. - - maybe(table_arg_infos) - ). - -:- type table_step_desc - ---> table_step_desc( - tsd_var_name :: string, - tsd_step :: table_trie_step - ). - -:- type proc_table_struct_info - ---> proc_table_struct_info( - % The information we need to create the data structures - % created by tabling for a procedure, and to interpret them - % for the debugger (except the information -such as - % determinism- that is already available from proc_layout - % structures. - % - % The table_arg_infos list first all the input arguments, - % then all the output arguments. - % - % The right tvarset for interpreting the types in the - % table_arg_infos is the one stored below. It is taken from - % the proc_info of the procedure whose table this structure - % describes. Since we care only about the shapes of the types, - % we don't care about neither the actual numerical values - % nor the names of the type variables, so we don't care if - % the tvarset in that proc_info changes after table_gen.m - % takes the snapshot stored here. - % - % We record the rtti_proc_label of the procedure whose table - % this is. We can't record its identity in the form of a - % pred_proc_id, since that won't work if the procedure is - % deleted before the code generation phase. - - ptsi_proc_label :: rtti_proc_label, - ptsi_tvarset :: tvarset, - ptsi_context :: prog_context, - ptsi_num_inputs :: int, - ptsi_num_outputs :: int, - ptsi_input_steps :: list(table_step_desc), - ptsi_maybe_output_steps :: maybe(list(table_step_desc)), - ptsi_gen_arg_infos :: table_arg_infos, - ptsi_eval_method :: tabled_eval_method - ). - -:- type special_proc_return - ---> generator_return( - % The generator is stored in this location. We can't use an - % rval to represent the location, since we don't want this - % module to depend on the ll_backend package. - generator_rval :: string, - - % What should we pass as the value of the debug parameter - % in the call to MR_tbl_mmos_return_answer? - return_debug :: string - ). - -:- type structure_sharing_domain_and_status - ---> structure_sharing_domain_and_status( - structure_sharing_domain, - analysis_status - ). - -:- type structure_reuse_domain_and_status - ---> structure_reuse_domain_and_status( - structure_reuse_domain, - analysis_status - ). - -:- type untuple_proc_info - ---> untuple_proc_info( - map(prog_var, list(prog_var)) - ). - -:- type detism_decl - ---> detism_decl_explicit - ; detism_decl_implicit - ; detism_decl_none. - % The determinism of the procedure is not declared. - :- 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, @@ -2043,79 +1614,6 @@ pred_info_get_sym_name(PredInfo, SymName) :- list(prog_var)::in, hlds_goal::in, rtti_varmaps::in, proc_info::in, proc_info::out) is det. -:- type can_process - ---> cannot_process_yet - ; can_process_now. - -:- type needs_maxfr_slot - ---> needs_maxfr_slot - ; does_not_need_maxfr_slot. - -:- type has_parallel_conj - ---> has_parallel_conj - ; has_no_parallel_conj. - -:- type has_user_event - ---> has_user_event - ; has_no_user_event. - -:- type has_self_tail_rec_call - ---> has_self_tail_rec_call - ; has_no_self_tail_rec_call. - -:- type has_mutual_tail_rec_call - ---> has_mutual_tail_rec_call - ; has_no_mutual_tail_rec_call. - -:- type has_tail_rec_call - ---> has_tail_rec_call( - has_self_tail_rec_call, - has_mutual_tail_rec_call - ). - -:- type oisu_pred_kind_for - ---> oisu_creator_for(type_ctor) - ; oisu_mutator_for(type_ctor) - ; oisu_destructor_for(type_ctor). - - % Is a procedure the subject of any foreign_export pragmas? - % -:- type proc_foreign_exports - ---> no_foreign_exports - ; has_foreign_exports. - - % Gives an indication of whether or not the procedure - % might throw an exception. - % -:- type proc_exception_info - ---> proc_exception_info( - proc_exception_status :: exception_status, - proc_maybe_excep_analysis_status :: maybe(analysis_status) - ). - - % Gives an indication of whether or not the procedure modifies the trail. - % -:- type proc_trailing_info - ---> proc_trailing_info( - proc_trailing_status :: trailing_status, - proc_maybe_trail_analysis_status :: maybe(analysis_status) - ). - - % Gives an indication of whether or not the procedure, or one of its - % subgoals, calls a procedure that is tabled using minimal model tabling. -:- type proc_mm_tabling_info - ---> proc_mm_tabling_info( - % The tabling status for this procedures as determined - % by tabling analysis. - proc_mm_status :: mm_tabling_status, - - % The status of the tabling analysis results for this - % procedure. This is used by the intermodule analysis - % framework to determine if there is any benefit in - % re-analysing this procedure. - proc_mm_analysis_status :: maybe(analysis_status) - ). - % Predicates to get fields of proc_infos. :- pred proc_info_get_headvars(proc_info::in, list(prog_var)::out) is det. @@ -2624,106 +2122,6 @@ pred_info_get_sym_name(PredInfo, SymName) :- psi_structure_reuse :: structure_reuse_info ). -:- type structure_sharing_info - ---> structure_sharing_info( - maybe_sharing :: maybe(structure_sharing_domain_and_status), - maybe_imported_sharing :: maybe(imported_sharing) - % Records the sharing information from any `.opt' or - % `.trans_opt' file. This information needs to be processed at - % the beginning of structure sharing analysis. After that, - % this field is of no use. - ). - - % Sharing information is expressed in terms of head variables and the - % type variables occurring in their types. In order to correctly process - % (mainly renaming) this information, we need both the list of head - % variables as well as their types. As this list of head variables may - % contain any compiler-added head variables, the processing of imported - % structure sharing information needs to be postponed until the actual - % structure sharing analysis, which explains the need for the type - % imported_sharing to temporarily store the imported sharing information. - % -:- type imported_sharing - ---> imported_sharing( - % The list of head variables in which terms the imported - % sharing is expressed. - s_headvars :: list(prog_var), - - % The types of the head variables. - s_types :: list(mer_type), - - s_sharing :: structure_sharing_domain - ). - -:- func structure_sharing_info_init = structure_sharing_info. - -structure_sharing_info_init = structure_sharing_info(no, no). - -:- type structure_reuse_info - ---> structure_reuse_info( - maybe_reuse :: maybe(structure_reuse_domain_and_status), - - maybe_imported_reuse :: maybe(imported_reuse) - % Records the reuse information from any `.opt' or - % `.trans_opt' file. This information needs to be processed - % at the beginning of structure reuse analysis. After that - % this field is of no use. - ). - - % Same rationale as for imported_sharing. - % -:- type imported_reuse - ---> imported_reuse( - % The list of headvars in which terms the imported reuse - % information is expressed. - r_headvars :: list(prog_var), - - % The types of the headvars. - r_types :: list(mer_type), - - r_reuse :: structure_reuse_domain - ). - -:- func structure_reuse_info_init = structure_reuse_info. - -structure_reuse_info_init = structure_reuse_info(no, no). - -table_step_stats_kind(Step) = KindStr :- - ( - ( Step = table_trie_step_int(_) - ; Step = table_trie_step_char - ; Step = table_trie_step_string - ; Step = table_trie_step_float - ; Step = table_trie_step_typeinfo - ; Step = table_trie_step_typeclassinfo - ; Step = table_trie_step_foreign_enum - ), - KindStr = "MR_TABLE_STATS_DETAIL_HASH" - ; - Step = table_trie_step_enum(_), - KindStr = "MR_TABLE_STATS_DETAIL_ENUM" - ; - Step = table_trie_step_general(_Type, IsPoly, ValueOrAddr), - ( - ValueOrAddr = table_addr, - KindStr = "MR_TABLE_STATS_DETAIL_HASH" - ; - ValueOrAddr = table_value, - ( - IsPoly = table_is_mono, - KindStr = "MR_TABLE_STATS_DETAIL_DU" - ; - IsPoly = table_is_poly, - KindStr = "MR_TABLE_STATS_DETAIL_POLY" - ) - ) - ; - ( Step = table_trie_step_promise_implied - ; Step = table_trie_step_dummy - ), - KindStr = "MR_TABLE_STATS_DETAIL_NONE" - ). - %---------------------------------------------------------------------------% :- pred proc_info_init(module_info::in, prog_context::in, item_seq_num::in, diff --git a/compiler/hlds_proc_util.m b/compiler/hlds_proc_util.m index e97c7d7e7..88ece5b03 100644 --- a/compiler/hlds_proc_util.m +++ b/compiler/hlds_proc_util.m @@ -20,6 +20,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.instmap. +:- import_module hlds.pred_info_types. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.prog_type. diff --git a/compiler/hlds_rtti.m b/compiler/hlds_rtti.m index e149b394b..e2078a356 100644 --- a/compiler/hlds_rtti.m +++ b/compiler/hlds_rtti.m @@ -20,6 +20,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/inlining.m b/compiler/inlining.m index 95a0346ea..ee0208079 100644 --- a/compiler/inlining.m +++ b/compiler/inlining.m @@ -171,6 +171,7 @@ :- import_module hlds.hlds_proc_util. :- import_module hlds.passes_aux. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/instance_method_clauses.m b/compiler/instance_method_clauses.m index 22ce1add6..12aec4ace 100644 --- a/compiler/instance_method_clauses.m +++ b/compiler/instance_method_clauses.m @@ -50,6 +50,7 @@ :- 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 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 91cded7f2..05ef1de15 100644 --- a/compiler/intermod.m +++ b/compiler/intermod.m @@ -137,6 +137,7 @@ :- import_module hlds.hlds_out.hlds_out_pred. :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- 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 a30ee6b39..b6f11afde 100644 --- a/compiler/intermod_analysis.m +++ b/compiler/intermod_analysis.m @@ -142,6 +142,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_proc_util. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module hlds.var_table_hlds. :- import_module libs. diff --git a/compiler/introduce_parallelism.m b/compiler/introduce_parallelism.m index 5a188d23d..4b0d07053 100644 --- a/compiler/introduce_parallelism.m +++ b/compiler/introduce_parallelism.m @@ -48,6 +48,7 @@ :- import_module hlds.hlds_proc_util. :- import_module hlds.instmap. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/lambda.m b/compiler/lambda.m index 5c06a77e7..58fa7af53 100644 --- a/compiler/lambda.m +++ b/compiler/lambda.m @@ -77,6 +77,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.proc_info_types. :- import_module parse_tree. :- import_module parse_tree.prog_data. :- import_module parse_tree.set_of_var. @@ -139,6 +140,7 @@ :- 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_table. :- import_module hlds.quantification. diff --git a/compiler/layout_out.m b/compiler/layout_out.m index 7f08de4fa..902589b51 100644 --- a/compiler/layout_out.m +++ b/compiler/layout_out.m @@ -25,7 +25,7 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. +:- import_module hlds.proc_info_types. :- import_module ll_backend.layout. :- import_module ll_backend.llds. :- import_module ll_backend.llds_out. @@ -191,6 +191,7 @@ :- 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 a8e273369..d674b0bdf 100644 --- a/compiler/lco.m +++ b/compiler/lco.m @@ -185,6 +185,7 @@ :- import_module hlds.instmap. :- import_module hlds.mode_top_functor. :- import_module hlds.passes_aux. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. :- import_module hlds.quantification. diff --git a/compiler/liveness.m b/compiler/liveness.m index 060c4b4b6..91a5661cc 100644 --- a/compiler/liveness.m +++ b/compiler/liveness.m @@ -202,6 +202,7 @@ :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.mode_top_functor. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.quantification. :- import_module libs. diff --git a/compiler/llds.m b/compiler/llds.m index 38dfbd8f0..473e6efd6 100644 --- a/compiler/llds.m +++ b/compiler/llds.m @@ -28,6 +28,7 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.trace_params. :- import_module ll_backend.layout. diff --git a/compiler/llds_out_global.m b/compiler/llds_out_global.m index e1bc6fb9a..bedd3eb1d 100644 --- a/compiler/llds_out_global.m +++ b/compiler/llds_out_global.m @@ -59,7 +59,7 @@ :- import_module backend_libs.c_util. :- import_module backend_libs.name_mangle. :- import_module backend_libs.rtti. -:- import_module hlds.hlds_pred. +:- import_module hlds.proc_info_types. :- import_module ll_backend.llds_out.llds_out_data. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/lookup_switch_util.m b/compiler/lookup_switch_util.m index 532d861a5..243038375 100644 --- a/compiler/lookup_switch_util.m +++ b/compiler/lookup_switch_util.m @@ -159,10 +159,10 @@ :- import_module pair. :- import_module require. :- import_module uint. -:- import_module uint8. :- import_module uint16. :- import_module uint32. :- import_module uint64. +:- import_module uint8. %---------------------------------------------------------------------------% % diff --git a/compiler/loop_inv.m b/compiler/loop_inv.m index f6c0d5a3b..4918cdcd4 100644 --- a/compiler/loop_inv.m +++ b/compiler/loop_inv.m @@ -129,6 +129,7 @@ :- import_module hlds.mode_test. :- import_module hlds.mode_util. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. diff --git a/compiler/make_hlds_passes.m b/compiler/make_hlds_passes.m index aaffc1a1c..1e94c17e9 100644 --- a/compiler/make_hlds_passes.m +++ b/compiler/make_hlds_passes.m @@ -82,6 +82,7 @@ :- import_module hlds.make_hlds.make_hlds_separate_items. :- import_module hlds.make_hlds.make_hlds_types. :- import_module hlds.make_hlds.make_hlds_warn. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. :- import_module hlds.special_pred. diff --git a/compiler/mark_tail_calls.m b/compiler/mark_tail_calls.m index dc92436c2..009df997b 100644 --- a/compiler/mark_tail_calls.m +++ b/compiler/mark_tail_calls.m @@ -217,6 +217,8 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_proc_util. :- import_module hlds.mode_top_functor. +:- import_module hlds.pred_info_types. +:- import_module hlds.proc_info_types. :- import_module hlds.type_util. :- import_module libs.options. :- import_module mdbcomp. diff --git a/compiler/mercury_compile_middle_passes.m b/compiler/mercury_compile_middle_passes.m index b705d6c46..6a5194bf6 100644 --- a/compiler/mercury_compile_middle_passes.m +++ b/compiler/mercury_compile_middle_passes.m @@ -59,6 +59,7 @@ :- import_module hlds.hlds_dependency_graph. :- import_module hlds.hlds_pred. :- import_module hlds.mark_static_terms. +:- import_module hlds.proc_info_types. :- import_module libs.file_util. :- import_module libs.globals. :- import_module libs.optimization_options. diff --git a/compiler/ml_args_util.m b/compiler/ml_args_util.m index 7bc4ea92b..fcd595844 100644 --- a/compiler/ml_args_util.m +++ b/compiler/ml_args_util.m @@ -21,6 +21,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_info_types. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. :- import_module ml_backend.ml_gen_info. diff --git a/compiler/ml_closure_gen.m b/compiler/ml_closure_gen.m index 08fe50f3d..f2395838c 100644 --- a/compiler/ml_closure_gen.m +++ b/compiler/ml_closure_gen.m @@ -84,6 +84,7 @@ :- import_module hlds.code_model. :- import_module hlds.hlds_module. :- import_module hlds.mark_tail_calls. % for ntrcr_program +:- import_module hlds.pred_info_types. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/ml_foreign_proc_gen.m b/compiler/ml_foreign_proc_gen.m index 39644a7af..91fdeb81a 100644 --- a/compiler/ml_foreign_proc_gen.m +++ b/compiler/ml_foreign_proc_gen.m @@ -50,6 +50,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_proc_util. :- import_module hlds.mode_top_functor. +:- import_module hlds.pred_info_types. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/ml_proc_gen.m b/compiler/ml_proc_gen.m index 23443dccc..de41cf866 100644 --- a/compiler/ml_proc_gen.m +++ b/compiler/ml_proc_gen.m @@ -48,6 +48,8 @@ :- 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.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/ml_top_gen.m b/compiler/ml_top_gen.m index 20aa51b04..cda2325e9 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.proc_info_types. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/ml_unify_gen_construct.m b/compiler/ml_unify_gen_construct.m index ba91b6abf..647a8b7a1 100644 --- a/compiler/ml_unify_gen_construct.m +++ b/compiler/ml_unify_gen_construct.m @@ -92,6 +92,7 @@ :- 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.type_classify. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/ml_unify_gen_util.m b/compiler/ml_unify_gen_util.m index ba600d052..fb1830b15 100644 --- a/compiler/ml_unify_gen_util.m +++ b/compiler/ml_unify_gen_util.m @@ -218,6 +218,7 @@ :- 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. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/mode_constraints.m b/compiler/mode_constraints.m index 50b55aded..7bbe45082 100644 --- a/compiler/mode_constraints.m +++ b/compiler/mode_constraints.m @@ -61,6 +61,7 @@ :- import_module hlds.inst_lookup. :- import_module hlds.mode_util. :- import_module hlds.passes_aux. +:- import_module hlds.pred_info_types. :- import_module hlds.quantification. :- import_module hlds.var_table_hlds. :- import_module libs. diff --git a/compiler/mode_top_functor.m b/compiler/mode_top_functor.m index d27959688..1175335a1 100644 --- a/compiler/mode_top_functor.m +++ b/compiler/mode_top_functor.m @@ -17,7 +17,7 @@ :- interface. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module parse_tree. :- import_module parse_tree.prog_data. diff --git a/compiler/modecheck_unify.m b/compiler/modecheck_unify.m index 6fef1f100..542cf3364 100644 --- a/compiler/modecheck_unify.m +++ b/compiler/modecheck_unify.m @@ -63,6 +63,7 @@ :- import_module hlds.mode_test. :- import_module hlds.mode_top_functor. :- import_module hlds.mode_util. +:- import_module hlds.pred_info_types. :- import_module hlds.type_classify. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/modes.m b/compiler/modes.m index 41b4a921b..a912b1d92 100644 --- a/compiler/modes.m +++ b/compiler/modes.m @@ -165,6 +165,7 @@ :- import_module hlds.passes_aux. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/notes/compiler_design.html b/compiler/notes/compiler_design.html index bca6f28b2..e208aa556 100644 --- a/compiler/notes/compiler_design.html +++ b/compiler/notes/compiler_design.html @@ -862,8 +862,9 @@ 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 the part of the HLDS concerning -predicates and procedures; +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.
  • 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 b6b097f17..79e1a1dda 100644 --- a/compiler/oisu_check.m +++ b/compiler/oisu_check.m @@ -42,6 +42,7 @@ :- import_module hlds.hlds_pred. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module parse_tree.prog_type. diff --git a/compiler/opt_format_call.m b/compiler/opt_format_call.m index 6cdd49ed2..89cf7688f 100644 --- a/compiler/opt_format_call.m +++ b/compiler/opt_format_call.m @@ -173,6 +173,7 @@ :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.instmap. :- import_module hlds.make_goal. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. :- import_module libs. diff --git a/compiler/par_loop_control.m b/compiler/par_loop_control.m index 666647da9..153cd300b 100644 --- a/compiler/par_loop_control.m +++ b/compiler/par_loop_control.m @@ -108,8 +108,10 @@ :- 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_table. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/parallel_to_plain_conj.m b/compiler/parallel_to_plain_conj.m index db17986fd..3c1e0fb2a 100644 --- a/compiler/parallel_to_plain_conj.m +++ b/compiler/parallel_to_plain_conj.m @@ -36,6 +36,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.passes_aux. +:- import_module hlds.proc_info_types. :- import_module io. :- import_module list. diff --git a/compiler/pd_info.m b/compiler/pd_info.m index 00a5fe6f6..e4cb58f1d 100644 --- a/compiler/pd_info.m +++ b/compiler/pd_info.m @@ -118,6 +118,7 @@ :- import_module hlds.inst_match. :- import_module hlds.mode_util. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.globals. :- import_module libs.options. diff --git a/compiler/polymorphism.m b/compiler/polymorphism.m index 5e9426a04..c6a32ae9c 100644 --- a/compiler/polymorphism.m +++ b/compiler/polymorphism.m @@ -167,6 +167,7 @@ :- import_module hlds.hlds_args. :- import_module hlds.hlds_clauses. :- import_module hlds.passes_aux. +:- import_module hlds.pred_info_types. :- import_module mdbcomp. :- import_module mdbcomp.program_representation. :- import_module mdbcomp.sym_name. diff --git a/compiler/pre_typecheck.m b/compiler/pre_typecheck.m index 5b7699f67..b76f5cb03 100644 --- a/compiler/pre_typecheck.m +++ b/compiler/pre_typecheck.m @@ -70,6 +70,7 @@ :- 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.status. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/pred_info_types.m b/compiler/pred_info_types.m new file mode 100644 index 000000000..531ca8243 --- /dev/null +++ b/compiler/pred_info_types.m @@ -0,0 +1,162 @@ +%---------------------------------------------------------------------------% +% 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 predicates +% and procedures. +% +%---------------------------------------------------------------------------% + +:- module hlds.pred_info_types. +:- interface. + +:- import_module hlds.hlds_llds. +:- import_module libs. +:- import_module libs.globals. +:- import_module parse_tree. +:- 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 bool. +:- import_module map. +:- import_module one_or_more. +:- import_module pair. + +%---------------------------------------------------------------------------% + +:- type implementation_language + ---> impl_lang_mercury + ; impl_lang_foreign(foreign_language). + + % A predicate, and the goal inside it, may implement a promise declaration, + % or it may be an ordinary predicate. +:- type goal_type + ---> goal_not_for_promise(np_goal_type) + ; goal_for_promise(promise_type). + + % An ordinary non-promise predicate may be defined by Mercury clauses, + % foreign procs, both, or neither. (The last is the recorded situation + % when we have added the predicate's declaration to the HLDS but have not + % processed any clauses or foreign procs just yet.) + % + % We use this information in two ways. + % + % First, intermod.m needs to know whether a predicate's definition + % contains any foreign_procs, because if it does, then it cannot append + % variable numbers after variable names for disambiguation, in e.g. clause + % heads, since that would screw up references to those variables in the + % foreign code. + % + % Second, purity.m has special handling for predicates that are defined + % *only* by foreign procs. + % + % Therefore the compiler does make a distinction between how it handles + % np_goal_type_foreign and np_goal_type_clause_and_foreign. + % + % As it happens, the compiler makes no distinction between how it handles + % np_goal_type_none and np_goal_type_clause, with the obvious exception + % that adding a foreign proc to the two results in no_goal_types that + % *are* distinguishable. +:- type np_goal_type + ---> np_goal_type_none + ; np_goal_type_clause + ; np_goal_type_foreign + ; np_goal_type_clause_and_foreign. + + % NOTE: `liveness_info' records liveness in the sense used by code + % generation. This is *not* the same thing as the notion of liveness + % used by mode analysis! See compiler/notes/glossary.html. + % +:- type liveness_info == set_of_progvar. % The live variables. + +:- type arg_info + ---> arg_info( + arg_loc, % Stored location. + top_functor_mode % Mode of top functor. + ). + + % The top_functor_mode specifies the mode of the top-level functor + % of a term (excluding `no_tag' functors, since those have no + % representation). It is used by the code generators when determining + % how to pass the argument. + % + % For the LLDS back-end, top_in arguments are passed in registers, + % and top_out values are returned in registers; top_unused values + % are not passed at all, but they are treated as if they were top_out + % for the purpose of assigning arguments to registers. (So e.g. if + % a det procedure has three arguments with top_functor_modes top_out, + % top_unused, and top_out respectively, the last argument will be + % returned in register r3, not r2.) + % + % For the MLDS back-end, top_in values are passed as arguments. + % Top_out values are normally passed by reference, except that + % - if the procedure is model_nondet, and the --nondet-copy-out option + % is set, top_out values are passed by value to the continuation + % function; + % - if the procedure is model_det or model_semi, and the + % --det-copy-out option is set, top_out arguments in the HLDS + % are mapped to (multiple) return values in the MLDS; and + % - if the HLDS function return value for a det function has mode + % `top_out', it is mapped to an MLDS return value. + % top_unused arguments are not passed at all. + % +:- type top_functor_mode + ---> top_in + ; top_out + ; top_unused. + +:- type arg_loc + ---> reg(reg_type, int). + +%---------------------% + + % This type is isomorphic to the module_section type, but defining it here + % allows us not to depend on parse_tree.prog_item.m. +:- type decl_section + ---> decl_interface + ; decl_implementation. + +:- type maybe_predmode_decl + ---> no_predmode_decl + ; predmode_decl. + +:- type cur_user_decl_info + ---> cur_user_decl_info( + decl_section, + maybe_predmode_decl, + item_seq_num + ). + +:- type format_call_info + ---> format_call_info( + % The context of the format_call pragma whose info + % this field of the pred_info records. We use this + % to generate more informative error messages in cases of + % duplicate format_call pragmas. + prog_context, + + % The pairs + % listed in that pragma. + one_or_more(format_string_values) + ). + + % Mode information for the arguments of a procedure. + % The first map gives the instantiation state on entry of the node + % corresponding to the prog_var. The second map gives the instantiation + % state on exit. + % +:- type arg_modes_map == pair(map(prog_var, bool)). + +%---------------------------------------------------------------------------% +:- end_module hlds.pred_info_types. +%---------------------------------------------------------------------------% diff --git a/compiler/proc_gen.m b/compiler/proc_gen.m index 7608089b6..ec553321e 100644 --- a/compiler/proc_gen.m +++ b/compiler/proc_gen.m @@ -76,6 +76,7 @@ :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.file_util. :- import_module libs.globals. diff --git a/compiler/proc_info_types.m b/compiler/proc_info_types.m new file mode 100644 index 000000000..b521570ab --- /dev/null +++ b/compiler/proc_info_types.m @@ -0,0 +1,505 @@ +%---------------------------------------------------------------------------% +% 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 predicates +% and procedures. +% +%---------------------------------------------------------------------------% + +:- module hlds.proc_info_types. +:- interface. + +:- 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 mdbcomp. +:- import_module mdbcomp.goal_path. +:- import_module mdbcomp.program_representation. +:- import_module parse_tree. +:- import_module parse_tree.prog_data. +:- import_module parse_tree.prog_data_pragma. +:- import_module parse_tree.prog_data_rare. +:- import_module parse_tree.var_table. + +:- import_module bool. +:- import_module list. +:- import_module map. +:- import_module maybe. + +%---------------------------------------------------------------------------% + +:- type is_address_taken + ---> address_is_taken + ; address_is_not_taken. + +:- type deep_recursion_info + ---> deep_recursion_info( + dri_role :: deep_profile_role, + + % If the procedure is not tail recursive, this list is empty. + % Otherwise, it contains outer-inner pairs of procedures + % in the visible SCC, including this procedure and its copy. + dri_visible_scc :: list(visible_scc_data) + ). + +:- type deep_profile_role + ---> deep_prof_inner_proc( + dpip_outer_proc :: pred_proc_id + ) + ; deep_prof_outer_proc( + dpop_inner_proc :: pred_proc_id + ). + +:- type visible_scc_data + ---> visible_scc_data( + vis_outer_proc :: pred_proc_id, + vis_inner_proc :: pred_proc_id, + + % A list of all the call site numbers that correspond to + % tail calls. (Call sites are numbered depth-first, + % left-to-right, starting from zero.) + rec_call_sites :: list(int) + ). + +:- type call_site_static_data % defines MR_CallSiteStatic + ---> normal_call( + normal_callee :: rtti_proc_label, + normal_type_subst :: string, + normal_file_name :: string, + normal_line_number :: int, + normal_goal_path :: forward_goal_path + ) + ; special_call( + special_file_name :: string, + special_line_number :: int, + special_goal_path :: forward_goal_path + ) + ; higher_order_call( + higher_order_file_name :: string, + ho_line_number :: int, + ho_goal_path :: forward_goal_path + ) + ; method_call( + method_file_name :: string, + method_line_number :: int, + method_goal_path :: forward_goal_path + ) + ; callback( + callback_file_name :: string, + callback_line_number :: int, + callback_goal_path :: forward_goal_path + ). + +:- type hlds_proc_static + ---> hlds_proc_static( % defines part of MR_ProcStatic + proc_static_file_name :: string, + proc_static_line_number :: int, + proc_is_in_interface :: bool, + call_site_statics :: list(call_site_static_data), + coverage_points :: list(coverage_point_info) + ). + + % The hlds_deep_excp_vars gives the variables that hold the values returned + % by the call port code, which are needed to let exception.throw perform + % the work we need to do at the excp port. +:- type hlds_deep_excp_vars + ---> hlds_deep_excp_vars( + top_csd :: prog_var, + middle_csd :: prog_var, + old_outermost :: maybe(prog_var) + % Needed only with the save/restore + % approach, not the activation counting + % approach. + ). + +:- type hlds_deep_layout + ---> hlds_deep_layout( + deep_layout_static :: hlds_proc_static, + deep_layout_excp :: hlds_deep_excp_vars + ). + +:- type deep_profile_proc_info + ---> deep_profile_proc_info( + % This field is set during the first part of the deep profiling + % transformation; tail recursion, if that is enabled. + deep_rec :: maybe(deep_recursion_info), + + % This field is set during the second part; it will be bound + % to `no' before and during the first part, and to `yes' + % after the second. The contents of this field govern + % what will go into MR_ProcStatic structures. + deep_layout :: maybe(hlds_deep_layout), + + % This field stores the original body of a procedure, + % before either part of the deep profiling transformation + % was executed. For inner procedures created by the tail + % recursion part of the deep profiling transformation, + % it holds the original body of the outer procedure. + deep_orig_body :: deep_original_body + ). + +:- type deep_original_body + ---> deep_original_body( + dob_body :: hlds_goal, + dob_head_vars :: list(prog_var), + dob_instmap :: instmap, + dob_var_table :: var_table, + dob_detism :: determinism + ). + +:- type table_arg_infos + ---> table_arg_infos( + list(table_arg_info), + map(tvar, table_locn) + ). + +:- type table_arg_info + ---> table_arg_info( + orig_var_num :: int, + orig_var_name :: string, + slot_num :: int, + arg_type :: mer_type + ). + + % This type is analogous to layout_locn in llds.m, but it refers + % not to lvals, but to slots in the extended answer blocks used by + % I/O action tabling for declarative debugging. +:- type table_locn + ---> table_locn_direct(int) + ; table_locn_indirect(int, int). + + % This type differs from the type table_step_kind in table_statistics.m + % in the library in that + % (a) in gives more information about the type of the corresponding + % argument (if this info is needed and available), + % (b) it doesn't have to be an enum, and + % (c) it doesn't have to handle dummy steps. + % +:- type table_trie_step + ---> table_trie_step_dummy + ; table_trie_step_int(int_type) + ; table_trie_step_char + ; table_trie_step_string + ; table_trie_step_float + ; table_trie_step_enum( + % The int gives the maximum enum value in the enum type + 1, + % and thus the size of the corresponding trie node. + % If the enum type is not a subtype, then the value is equal to + % the number of alternatives in the type. + int + ) + ; table_trie_step_foreign_enum + ; table_trie_step_general( + mer_type, + table_is_poly, + table_value_or_addr + ) + ; table_trie_step_typeinfo + ; table_trie_step_typeclassinfo + ; table_trie_step_promise_implied. + +:- type table_is_poly + ---> table_is_mono % The table type is monomorphic. + ; table_is_poly. % The table type is polymorphic. + +:- type table_value_or_addr + ---> table_value % We are tabling the value itself. + ; table_addr. % We are tabling only the address. + + % Return a description of what kind of statistics we collect for a trie + % step of a given kind. The description is the name of a value in the C + % enum type MR_TableStepStatsKind. (We will need to generalize this + % when we implement tabling for non-C backends.) + % +:- func table_step_stats_kind(table_trie_step) = string. + +:- type proc_table_io_info + ---> proc_table_io_info( + % The information we need to display an I/O action to the user. + % + % The table_arg_infos correspond one to one to the elements + % of the block saved for an I/O action. The first element + % will be the pointer to the proc_layout of the action's + % procedure. + % + % The right tvarset for interpreting the types in the + % table_arg_infos is the one in the proc_info in which + % the proc_table_io_info is stored. + + maybe(table_arg_infos) + ). + +:- type table_step_desc + ---> table_step_desc( + tsd_var_name :: string, + tsd_step :: table_trie_step + ). + +:- type proc_table_struct_info + ---> proc_table_struct_info( + % The information we need to create the data structures + % created by tabling for a procedure, and to interpret them + % for the debugger (except the information -such as + % determinism- that is already available from proc_layout + % structures. + % + % The table_arg_infos list first all the input arguments, + % then all the output arguments. + % + % The right tvarset for interpreting the types in the + % table_arg_infos is the one stored below. It is taken from + % the proc_info of the procedure whose table this structure + % describes. Since we care only about the shapes of the types, + % we don't care about neither the actual numerical values + % nor the names of the type variables, so we don't care if + % the tvarset in that proc_info changes after table_gen.m + % takes the snapshot stored here. + % + % We record the rtti_proc_label of the procedure whose table + % this is. We can't record its identity in the form of a + % pred_proc_id, since that won't work if the procedure is + % deleted before the code generation phase. + + ptsi_proc_label :: rtti_proc_label, + ptsi_tvarset :: tvarset, + ptsi_context :: prog_context, + ptsi_num_inputs :: int, + ptsi_num_outputs :: int, + ptsi_input_steps :: list(table_step_desc), + ptsi_maybe_output_steps :: maybe(list(table_step_desc)), + ptsi_gen_arg_infos :: table_arg_infos, + ptsi_eval_method :: tabled_eval_method + ). + +:- type special_proc_return + ---> generator_return( + % The generator is stored in this location. We can't use an + % rval to represent the location, since we don't want this + % module to depend on the ll_backend package. + generator_rval :: string, + + % What should we pass as the value of the debug parameter + % in the call to MR_tbl_mmos_return_answer? + return_debug :: string + ). + +:- type structure_sharing_domain_and_status + ---> structure_sharing_domain_and_status( + structure_sharing_domain, + analysis_status + ). + +:- type structure_reuse_domain_and_status + ---> structure_reuse_domain_and_status( + structure_reuse_domain, + analysis_status + ). + +:- type untuple_proc_info + ---> untuple_proc_info( + map(prog_var, list(prog_var)) + ). + +:- type detism_decl + ---> detism_decl_explicit + ; detism_decl_implicit + ; detism_decl_none. + % The determinism of the procedure is not declared. + +:- type can_process + ---> cannot_process_yet + ; can_process_now. + +:- type needs_maxfr_slot + ---> needs_maxfr_slot + ; does_not_need_maxfr_slot. + +:- type has_parallel_conj + ---> has_parallel_conj + ; has_no_parallel_conj. + +:- type has_user_event + ---> has_user_event + ; has_no_user_event. + +:- type has_self_tail_rec_call + ---> has_self_tail_rec_call + ; has_no_self_tail_rec_call. + +:- type has_mutual_tail_rec_call + ---> has_mutual_tail_rec_call + ; has_no_mutual_tail_rec_call. + +:- type has_tail_rec_call + ---> has_tail_rec_call( + has_self_tail_rec_call, + has_mutual_tail_rec_call + ). + +:- type oisu_pred_kind_for + ---> oisu_creator_for(type_ctor) + ; oisu_mutator_for(type_ctor) + ; oisu_destructor_for(type_ctor). + + % Is a procedure the subject of any foreign_export pragmas? + % +:- type proc_foreign_exports + ---> no_foreign_exports + ; has_foreign_exports. + + % Gives an indication of whether or not the procedure + % might throw an exception. + % +:- type proc_exception_info + ---> proc_exception_info( + proc_exception_status :: exception_status, + proc_maybe_excep_analysis_status :: maybe(analysis_status) + ). + + % Gives an indication of whether or not the procedure modifies the trail. + % +:- type proc_trailing_info + ---> proc_trailing_info( + proc_trailing_status :: trailing_status, + proc_maybe_trail_analysis_status :: maybe(analysis_status) + ). + + % Gives an indication of whether or not the procedure, or one of its + % subgoals, calls a procedure that is tabled using minimal model tabling. +:- type proc_mm_tabling_info + ---> proc_mm_tabling_info( + % The tabling status for this procedures as determined + % by tabling analysis. + proc_mm_status :: mm_tabling_status, + + % The status of the tabling analysis results for this + % procedure. This is used by the intermodule analysis + % framework to determine if there is any benefit in + % re-analysing this procedure. + proc_mm_analysis_status :: maybe(analysis_status) + ). + +:- type structure_sharing_info + ---> structure_sharing_info( + maybe_sharing :: maybe(structure_sharing_domain_and_status), + maybe_imported_sharing :: maybe(imported_sharing) + % Records the sharing information from any `.opt' or + % `.trans_opt' file. This information needs to be processed at + % the beginning of structure sharing analysis. After that, + % this field is of no use. + ). + + % Sharing information is expressed in terms of head variables and the + % type variables occurring in their types. In order to correctly process + % (mainly renaming) this information, we need both the list of head + % variables as well as their types. As this list of head variables may + % contain any compiler-added head variables, the processing of imported + % structure sharing information needs to be postponed until the actual + % structure sharing analysis, which explains the need for the type + % imported_sharing to temporarily store the imported sharing information. + % +:- type imported_sharing + ---> imported_sharing( + % The list of head variables in which terms the imported + % sharing is expressed. + s_headvars :: list(prog_var), + + % The types of the head variables. + s_types :: list(mer_type), + + s_sharing :: structure_sharing_domain + ). + +:- type structure_reuse_info + ---> structure_reuse_info( + maybe_reuse :: maybe(structure_reuse_domain_and_status), + + maybe_imported_reuse :: maybe(imported_reuse) + % Records the reuse information from any `.opt' or + % `.trans_opt' file. This information needs to be processed + % at the beginning of structure reuse analysis. After that + % this field is of no use. + ). + + % Same rationale as for imported_sharing. + % +:- type imported_reuse + ---> imported_reuse( + % The list of headvars in which terms the imported reuse + % information is expressed. + r_headvars :: list(prog_var), + + % The types of the headvars. + r_types :: list(mer_type), + + r_reuse :: structure_reuse_domain + ). + +:- func structure_sharing_info_init = structure_sharing_info. + +:- func structure_reuse_info_init = structure_reuse_info. + +%---------------------------------------------------------------------------% + +:- implementation. + +:- import_module term. +:- import_module varset. + +%---------------------------------------------------------------------------% + +table_step_stats_kind(Step) = KindStr :- + ( + ( Step = table_trie_step_int(_) + ; Step = table_trie_step_char + ; Step = table_trie_step_string + ; Step = table_trie_step_float + ; Step = table_trie_step_typeinfo + ; Step = table_trie_step_typeclassinfo + ; Step = table_trie_step_foreign_enum + ), + KindStr = "MR_TABLE_STATS_DETAIL_HASH" + ; + Step = table_trie_step_enum(_), + KindStr = "MR_TABLE_STATS_DETAIL_ENUM" + ; + Step = table_trie_step_general(_Type, IsPoly, ValueOrAddr), + ( + ValueOrAddr = table_addr, + KindStr = "MR_TABLE_STATS_DETAIL_HASH" + ; + ValueOrAddr = table_value, + ( + IsPoly = table_is_mono, + KindStr = "MR_TABLE_STATS_DETAIL_DU" + ; + IsPoly = table_is_poly, + KindStr = "MR_TABLE_STATS_DETAIL_POLY" + ) + ) + ; + ( Step = table_trie_step_promise_implied + ; Step = table_trie_step_dummy + ), + KindStr = "MR_TABLE_STATS_DETAIL_NONE" + ). + +structure_sharing_info_init = structure_sharing_info(no, no). + +structure_reuse_info_init = structure_reuse_info(no, no). + +%---------------------------------------------------------------------------% +:- end_module hlds.proc_info_types. +%---------------------------------------------------------------------------% diff --git a/compiler/proc_requests.m b/compiler/proc_requests.m index 3fcac6406..83ae81ebb 100644 --- a/compiler/proc_requests.m +++ b/compiler/proc_requests.m @@ -110,6 +110,7 @@ :- import_module hlds.inst_test. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.special_pred. :- import_module hlds.type_util. :- import_module mdbcomp. diff --git a/compiler/purity.m b/compiler/purity.m index a25295c20..e89e32a4a 100644 --- a/compiler/purity.m +++ b/compiler/purity.m @@ -175,6 +175,7 @@ :- 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_table. :- import_module hlds.quantification. diff --git a/compiler/rtti.m b/compiler/rtti.m index f803d77e4..a2b3a668a 100644 --- a/compiler/rtti.m +++ b/compiler/rtti.m @@ -28,8 +28,8 @@ :- interface. :- import_module hlds. -:- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. diff --git a/compiler/simplify_goal_call.m b/compiler/simplify_goal_call.m index 5994ba3ac..6f6e0dba7 100644 --- a/compiler/simplify_goal_call.m +++ b/compiler/simplify_goal_call.m @@ -80,6 +80,7 @@ :- import_module hlds.mode_util. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.var_table_hlds. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/simplify_goal_conj.m b/compiler/simplify_goal_conj.m index 2c494456c..e736469bb 100644 --- a/compiler/simplify_goal_conj.m +++ b/compiler/simplify_goal_conj.m @@ -54,6 +54,7 @@ :- import_module hlds.hlds_rtti. :- import_module hlds.make_goal. :- import_module hlds.passes_aux. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.trace_params. :- import_module parse_tree. diff --git a/compiler/simplify_info.m b/compiler/simplify_info.m index a22ac610b..b4dba03e3 100644 --- a/compiler/simplify_info.m +++ b/compiler/simplify_info.m @@ -25,6 +25,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.hlds_rtti. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.optimization_options. :- import_module libs.trace_params. diff --git a/compiler/simplify_proc.m b/compiler/simplify_proc.m index 8988fc944..5a3e3eb37 100644 --- a/compiler/simplify_proc.m +++ b/compiler/simplify_proc.m @@ -96,6 +96,7 @@ :- import_module hlds.hlds_out.hlds_out_goal. :- import_module hlds.hlds_proc_util. :- import_module hlds.passes_aux. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module libs. diff --git a/compiler/stack_layout.m b/compiler/stack_layout.m index 075d25dbf..8defbe531 100644 --- a/compiler/stack_layout.m +++ b/compiler/stack_layout.m @@ -36,6 +36,7 @@ :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module ll_backend.continuation_info. :- import_module ll_backend.global_data. :- import_module ll_backend.layout. @@ -110,6 +111,7 @@ :- import_module hlds.hlds_llds. :- import_module hlds.hlds_proc_util. :- import_module hlds.hlds_rtti. +:- import_module hlds.pred_info_types. :- import_module hlds.type_util. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/stm_expand.m b/compiler/stm_expand.m index a4621608f..f6369fe08 100644 --- a/compiler/stm_expand.m +++ b/compiler/stm_expand.m @@ -182,8 +182,10 @@ :- import_module hlds.instmap. :- import_module hlds.make_goal. :- import_module hlds.passes_aux. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/structure_reuse.analysis.m b/compiler/structure_reuse.analysis.m index 7c7192a9c..71bd8446e 100644 --- a/compiler/structure_reuse.analysis.m +++ b/compiler/structure_reuse.analysis.m @@ -100,6 +100,7 @@ :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.passes_aux. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module libs. :- import_module libs.file_util. diff --git a/compiler/structure_reuse.domain.m b/compiler/structure_reuse.domain.m index ff3f915e0..644d31b00 100644 --- a/compiler/structure_reuse.domain.m +++ b/compiler/structure_reuse.domain.m @@ -275,6 +275,7 @@ :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.proc_info_types. :- import_module parse_tree.prog_ctgc. :- import_module parse_tree.set_of_var. :- import_module parse_tree.var_table. diff --git a/compiler/structure_reuse.versions.m b/compiler/structure_reuse.versions.m index 002220e9a..3e035ee17 100644 --- a/compiler/structure_reuse.versions.m +++ b/compiler/structure_reuse.versions.m @@ -69,6 +69,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_proc_util. :- import_module hlds.passes_aux. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. :- import_module hlds.quantification. diff --git a/compiler/structure_sharing.analysis.m b/compiler/structure_sharing.analysis.m index a8b639db6..2eda8457b 100644 --- a/compiler/structure_sharing.analysis.m +++ b/compiler/structure_sharing.analysis.m @@ -73,6 +73,7 @@ :- import_module hlds.hlds_out.hlds_out_util. :- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module libs. :- import_module libs.dependency_graph. diff --git a/compiler/structure_sharing.domain.m b/compiler/structure_sharing.domain.m index 89ef7e3ae..85582c78c 100644 --- a/compiler/structure_sharing.domain.m +++ b/compiler/structure_sharing.domain.m @@ -310,7 +310,9 @@ :- import_module hlds.inst_test. :- import_module hlds.mode_top_functor. :- import_module hlds.mode_util. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module parse_tree.parse_tree_out_misc. :- import_module parse_tree.prog_ctgc. diff --git a/compiler/style_checks.m b/compiler/style_checks.m index 00194998e..c80cf90e9 100644 --- a/compiler/style_checks.m +++ b/compiler/style_checks.m @@ -76,6 +76,7 @@ :- import_module hlds.hlds_error_util. :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_table. :- import_module libs. :- import_module libs.globals. diff --git a/compiler/superhomogeneous.m b/compiler/superhomogeneous.m index 8d0d5f5fd..3d6173dfa 100644 --- a/compiler/superhomogeneous.m +++ b/compiler/superhomogeneous.m @@ -87,7 +87,6 @@ :- import_module hlds.from_ground_term_util. :- import_module hlds.hlds_cons. :- import_module hlds.hlds_module. -:- import_module hlds.hlds_pred. :- import_module hlds.make_goal. :- import_module hlds.make_hlds.field_access. :- import_module hlds.make_hlds.goal_expr_to_goal. diff --git a/compiler/superhomogeneous_util.m b/compiler/superhomogeneous_util.m index 9861a14b8..584a509ba 100644 --- a/compiler/superhomogeneous_util.m +++ b/compiler/superhomogeneous_util.m @@ -18,7 +18,6 @@ :- interface. :- import_module hlds.hlds_goal. -:- import_module hlds.hlds_pred. :- import_module hlds.make_hlds.state_var. :- import_module mdbcomp. :- import_module mdbcomp.prim_data. diff --git a/compiler/table_gen.m b/compiler/table_gen.m index 3ef40f87a..9956809e3 100644 --- a/compiler/table_gen.m +++ b/compiler/table_gen.m @@ -76,6 +76,7 @@ :- import_module hlds.mode_util. :- import_module hlds.pred_name. :- import_module hlds.pred_table. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module hlds.type_classify. :- import_module libs. diff --git a/compiler/tabling_analysis.m b/compiler/tabling_analysis.m index 70a1b8f4f..f9179e7b0 100644 --- a/compiler/tabling_analysis.m +++ b/compiler/tabling_analysis.m @@ -87,6 +87,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. +:- import_module hlds.proc_info_types. :- import_module libs. :- import_module libs.dependency_graph. :- import_module libs.globals. diff --git a/compiler/trace_gen.m b/compiler/trace_gen.m index 77c7f80a6..16cb2e025 100644 --- a/compiler/trace_gen.m +++ b/compiler/trace_gen.m @@ -53,6 +53,7 @@ :- import_module hlds.hlds_goal. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.globals. :- import_module libs.trace_params. @@ -251,6 +252,7 @@ :- import_module hlds.inst_test. :- import_module hlds.instmap. :- import_module hlds.mode_util. +:- import_module hlds.proc_info_types. :- import_module libs.options. :- import_module ll_backend.code_util. :- import_module ll_backend.layout_out. diff --git a/compiler/trace_params.m b/compiler/trace_params.m index c34914481..a78699263 100644 --- a/compiler/trace_params.m +++ b/compiler/trace_params.m @@ -149,6 +149,7 @@ :- implementation. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.status. :- import_module char. diff --git a/compiler/trailing_analysis.m b/compiler/trailing_analysis.m index 64abd4bb8..dc633ee8c 100644 --- a/compiler/trailing_analysis.m +++ b/compiler/trailing_analysis.m @@ -87,6 +87,7 @@ :- import_module hlds.hlds_markers. :- import_module hlds.hlds_pred. :- import_module hlds.passes_aux. +:- import_module hlds.proc_info_types. :- import_module hlds.type_classify. :- import_module hlds.type_util. :- import_module libs. diff --git a/compiler/tupling.m b/compiler/tupling.m index bdb217b6e..db2338a86 100644 --- a/compiler/tupling.m +++ b/compiler/tupling.m @@ -119,6 +119,7 @@ :- import_module hlds.make_goal. :- import_module hlds.mode_test. :- import_module hlds.pred_name. +:- import_module hlds.proc_info_types. :- import_module hlds.quantification. :- import_module libs. :- import_module libs.dependency_graph. diff --git a/compiler/typecheck.m b/compiler/typecheck.m index 55c7252fa..296af1bda 100644 --- a/compiler/typecheck.m +++ b/compiler/typecheck.m @@ -130,6 +130,7 @@ :- import_module hlds.instmap. :- import_module hlds.make_goal. :- import_module hlds.passes_aux. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_name. :- import_module hlds.pred_table. :- import_module hlds.special_pred. diff --git a/compiler/typecheck_cons_infos.m b/compiler/typecheck_cons_infos.m index 00dbd8746..3e82e1021 100644 --- a/compiler/typecheck_cons_infos.m +++ b/compiler/typecheck_cons_infos.m @@ -86,6 +86,7 @@ :- import_module hlds.hlds_data. :- import_module hlds.hlds_module. :- import_module hlds.hlds_pred. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_table. :- import_module hlds.status. :- import_module mdbcomp.prim_data. diff --git a/compiler/types_into_modes.m b/compiler/types_into_modes.m index b2a60e5b3..0adcaad21 100644 --- a/compiler/types_into_modes.m +++ b/compiler/types_into_modes.m @@ -50,6 +50,7 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_goal. :- import_module hlds.hlds_markers. +:- import_module hlds.pred_info_types. :- import_module libs. :- import_module libs.globals. :- import_module mdbcomp. diff --git a/compiler/unify_gen_construct.m b/compiler/unify_gen_construct.m index a14a68301..cb115ded4 100644 --- a/compiler/unify_gen_construct.m +++ b/compiler/unify_gen_construct.m @@ -66,6 +66,7 @@ :- 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.type_classify. :- import_module libs. diff --git a/compiler/unify_gen_util.m b/compiler/unify_gen_util.m index 756905364..df499c2ba 100644 --- a/compiler/unify_gen_util.m +++ b/compiler/unify_gen_util.m @@ -92,8 +92,8 @@ :- import_module backend_libs. :- import_module backend_libs.builtin_ops. -:- import_module hlds.hlds_pred. :- import_module hlds.mode_top_functor. +:- import_module hlds.pred_info_types. :- import_module hlds.type_util. :- import_module mdbcomp. :- import_module mdbcomp.sym_name. diff --git a/compiler/unify_proc.m b/compiler/unify_proc.m index fab284602..86ca9f7a9 100644 --- a/compiler/unify_proc.m +++ b/compiler/unify_proc.m @@ -92,6 +92,7 @@ :- import_module hlds.hlds_rtti. :- import_module hlds.instmap. :- import_module hlds.make_goal. +:- import_module hlds.pred_info_types. :- import_module hlds.pred_table. :- import_module hlds.quantification. :- import_module hlds.special_pred. diff --git a/compiler/untupling.m b/compiler/untupling.m index 2cd2342c1..b5478d686 100644 --- a/compiler/untupling.m +++ b/compiler/untupling.m @@ -118,7 +118,9 @@ :- import_module hlds.hlds_pred. :- 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.proc_info_types. :- import_module hlds.quantification. :- import_module hlds.status. :- import_module hlds.type_util. diff --git a/compiler/var_origins.m b/compiler/var_origins.m index 1ea403358..d0f768712 100644 --- a/compiler/var_origins.m +++ b/compiler/var_origins.m @@ -211,6 +211,7 @@ :- import_module hlds.hlds_clauses. :- import_module hlds.hlds_out. :- import_module hlds.hlds_out.hlds_out_util. +:- import_module hlds.pred_info_types. :- import_module parse_tree.parse_tree_out_cons_id. :- import_module parse_tree.parse_tree_out_info. :- import_module parse_tree.parse_tree_out_term.