diff --git a/compiler/base_typeclass_info.m b/compiler/base_typeclass_info.m
index a9c4960bf..33322d68f 100644
--- a/compiler/base_typeclass_info.m
+++ b/compiler/base_typeclass_info.m
@@ -45,9 +45,9 @@
:- import_module backend_libs.type_class_info.
:- import_module hlds.hlds_class.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_name.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module hlds.status.
:- import_module parse_tree.
:- import_module parse_tree.prog_data.
diff --git a/compiler/code_util.m b/compiler/code_util.m
index 5beecf946..bc788a98e 100644
--- a/compiler/code_util.m
+++ b/compiler/code_util.m
@@ -20,8 +20,8 @@
:- import_module hlds.hlds_llds.
:- import_module hlds.hlds_module.
:- import_module hlds.hlds_proc.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- 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 58ac6a137..f2d49ad90 100644
--- a/compiler/continuation_info.m
+++ b/compiler/continuation_info.m
@@ -63,6 +63,7 @@
:- import_module hlds.pred_proc_id.
:- import_module hlds.proc_info_types.
:- import_module hlds.proc_table_struct.
+:- import_module hlds.rtti_proc_label.
:- import_module libs.
:- import_module libs.globals.
:- import_module libs.trace_params.
diff --git a/compiler/deep_profiling.m b/compiler/deep_profiling.m
index 09e6da063..a6061812f 100644
--- a/compiler/deep_profiling.m
+++ b/compiler/deep_profiling.m
@@ -77,13 +77,13 @@
:- import_module hlds.hlds_pred.
:- import_module hlds.hlds_proc.
:- import_module hlds.hlds_proc_util.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.instmap.
:- import_module hlds.make_goal.
:- import_module hlds.mode_top_functor.
:- import_module hlds.pred_name.
:- import_module hlds.pred_table.
:- import_module hlds.proc_info_types.
+:- import_module hlds.rtti_proc_label.
:- import_module libs.
:- import_module libs.dependency_graph.
:- import_module libs.file_util.
diff --git a/compiler/hlds.m b/compiler/hlds.m
index eeb3f0e00..3d7263fa9 100644
--- a/compiler/hlds.m
+++ b/compiler/hlds.m
@@ -40,6 +40,7 @@
:- include_module pred_table.
:- include_module proc_info_types.
:- include_module proc_table_struct.
+:- include_module rtti_proc_label.
:- include_module special_pred.
:- include_module status.
diff --git a/compiler/hlds_rtti.m b/compiler/hlds_rtti.m
index dd7bbda6a..3d55f99d0 100644
--- a/compiler/hlds_rtti.m
+++ b/compiler/hlds_rtti.m
@@ -18,87 +18,16 @@
:- module hlds.hlds_rtti.
:- interface.
-:- import_module hlds.hlds_module.
-:- import_module hlds.pred_name.
-:- import_module hlds.pred_proc_id.
-:- import_module mdbcomp.
-:- import_module mdbcomp.prim_data.
-:- import_module mdbcomp.sym_name.
:- import_module parse_tree.
:- import_module parse_tree.prog_data.
:- import_module parse_tree.set_of_var.
:- import_module parse_tree.var_table.
:- import_module array.
-:- import_module assoc_list.
:- import_module bool.
:- import_module list.
:- import_module map.
-%---------------------------------------------------------------------------%
-
-:- type prog_var_name == string.
-
- % The rtti_proc_label type holds all the information about a procedure
- % that we need to compute the entry label for that procedure
- % in the target language (the llds.code_addr or mlds.code_addr).
-
-:- type rtti_proc_label
- ---> rtti_proc_label(
- rpl_pred_or_func :: pred_or_func,
- rpl_this_module :: module_name,
- rpl_proc_module :: module_name,
- rpl_proc_name :: string,
- rpl_proc_arity :: pred_form_arity,
- rpl_proc_arg_types :: list(mer_type),
- rpl_pred_id :: pred_id,
- rpl_proc_id :: proc_id,
- rpl_proc_headvars :: assoc_list(prog_var,
- prog_var_name),
- rpl_proc_top_modes :: list(top_functor_mode),
- rpl_proc_interface_detism :: determinism,
-
- % The following booleans hold values computed from the
- % pred_info, using procedures
- % pred_info_is_imported/1,
- % pred_info_is_pseudo_imported/1,
- % pred_info_get_origin/1
- % respectively.
- % We store booleans here, rather than storing the
- % pred_info, to avoid retaining a reference to the
- % parts of the pred_info that we aren't interested in,
- % so that those parts can be garbage collected.
- % We use booleans rather than an import_status
- % so that we can continue to use the above-mentioned
- % abstract interfaces rather than hard-coding tests
- % on the import_status.
-
- rpl_pred_is_imported :: bool,
- rpl_pred_is_pseudo_imported :: bool,
- rpl_pred_info_origin :: pred_origin,
-
- % The following boolean holds a value computed from the
- % proc_info, using procedure_is_exported/2
-
- rpl_proc_is_exported :: bool,
-
- % The following bool is true if the procedure was
- % imported, either because the containing predicate
- % was imported, or because it was pseudoimported
- % and the procedure is an in-in unify procedure.
-
- rpl_proc_is_imported :: bool
- ).
-
- % Construct an rtti_proc_label for a given procedure.
- %
-:- func make_rtti_proc_label(module_info, pred_id, proc_id) = rtti_proc_label.
-
- % The inverse of make_rtti_proc_label.
- %
-:- pred proc_label_pred_proc_id(rtti_proc_label::in,
- pred_id::out, proc_id::out) is det.
-
%---------------------------------------------------------------------------%
%
% Types and predicates to store information about RTTI.
@@ -460,13 +389,13 @@
:- implementation.
-:- import_module hlds.hlds_pred.
-:- import_module hlds.hlds_proc.
-:- import_module hlds.hlds_proc_util.
-:- import_module hlds.mode_top_functor.
+:- import_module mdbcomp.
+:- import_module mdbcomp.prim_data.
+:- import_module mdbcomp.sym_name.
:- import_module parse_tree.prog_type_scan.
:- import_module parse_tree.prog_type_subst.
+:- import_module assoc_list.
:- import_module pair.
:- import_module require.
:- import_module set_tree234.
@@ -475,55 +404,6 @@
%---------------------------------------------------------------------------%
-make_rtti_proc_label(ModuleInfo, PredId, ProcId) = ProcLabel :-
- module_info_get_name(ModuleInfo, ThisModule),
- module_info_pred_proc_info(ModuleInfo, PredId, ProcId, PredInfo, ProcInfo),
- PredOrFunc = pred_info_is_pred_or_func(PredInfo),
- PredModule = pred_info_module(PredInfo),
- PredName = pred_info_name(PredInfo),
- PredFormArity = pred_info_pred_form_arity(PredInfo),
- pred_info_get_arg_types(PredInfo, ArgTypes),
- proc_info_get_var_table(ProcInfo, ProcVarTable),
- proc_info_get_headvars(ProcInfo, ProcHeadVars),
- proc_info_get_argmodes(ProcInfo, ProcModes),
- proc_info_interface_determinism(ProcInfo, ProcDetism),
- modes_to_top_functor_modes(ModuleInfo, ProcModes, ArgTypes, ProcTopModes),
- PredIsImported =
- (if pred_info_is_imported(PredInfo) then yes else no),
- PredIsPseudoImp =
- (if pred_info_is_pseudo_imported(PredInfo) then yes else no),
- ProcIsExported =
- (if procedure_is_exported(ModuleInfo, PredInfo, ProcId)
- then yes else no),
- pred_info_get_origin(PredInfo, Origin),
- ProcHeadVarsWithNames = list.map(
- ( func(Var) = Var - Name :-
- Name = var_table_entry_name(ProcVarTable, Var)
- ), ProcHeadVars),
- ( if
- (
- PredIsImported = yes
- ;
- PredIsPseudoImp = yes,
- in_in_unification_proc_id(ProcId)
- )
- then
- ProcIsImported = yes
- else
- ProcIsImported = no
- ),
- ProcLabel = rtti_proc_label(PredOrFunc, ThisModule, PredModule,
- PredName, PredFormArity, ArgTypes, PredId, ProcId,
- ProcHeadVarsWithNames, ProcTopModes, ProcDetism,
- PredIsImported, PredIsPseudoImp, Origin,
- ProcIsExported, ProcIsImported).
-
-proc_label_pred_proc_id(RttiProcLabel, PredId, ProcId) :-
- PredId = RttiProcLabel ^ rpl_pred_id,
- ProcId = RttiProcLabel ^ rpl_proc_id.
-
-%---------------------------------------------------------------------------%
-
type_info_locn_var(type_info(Var), Var).
type_info_locn_var(typeclass_info(Var, _), Var).
diff --git a/compiler/layout.m b/compiler/layout.m
index a65a2dae9..b20946de2 100644
--- a/compiler/layout.m
+++ b/compiler/layout.m
@@ -36,8 +36,8 @@
:- interface.
:- import_module hlds.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_name.
+:- import_module hlds.rtti_proc_label.
:- import_module libs.
:- import_module libs.trace_params.
:- import_module ll_backend.llds.
diff --git a/compiler/layout_out.m b/compiler/layout_out.m
index ebc40d710..880d6c1f5 100644
--- a/compiler/layout_out.m
+++ b/compiler/layout_out.m
@@ -191,8 +191,8 @@
:- import_module backend_libs.c_util.
:- import_module backend_libs.name_mangle.
:- import_module backend_libs.proc_label.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_name.
+:- import_module hlds.rtti_proc_label.
:- import_module libs.
:- import_module libs.trace_params.
:- import_module ll_backend.llds_out.llds_out_code_addr.
diff --git a/compiler/ml_args_util.m b/compiler/ml_args_util.m
index 0ddbdd21a..da426699c 100644
--- a/compiler/ml_args_util.m
+++ b/compiler/ml_args_util.m
@@ -19,8 +19,8 @@
:- import_module hlds.
:- import_module hlds.code_model.
:- import_module hlds.hlds_module.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module mdbcomp.
:- import_module mdbcomp.prim_data.
:- import_module ml_backend.ml_gen_info.
diff --git a/compiler/ml_code_util.m b/compiler/ml_code_util.m
index fd8419a09..81453a217 100644
--- a/compiler/ml_code_util.m
+++ b/compiler/ml_code_util.m
@@ -25,8 +25,8 @@
:- import_module hlds.hlds_data.
:- import_module hlds.hlds_goal.
:- import_module hlds.hlds_module.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module mdbcomp.
:- import_module mdbcomp.sym_name.
:- import_module ml_backend.ml_gen_info.
diff --git a/compiler/notes/compiler_design.html b/compiler/notes/compiler_design.html
index 9c77acb08..21b281fad 100644
--- a/compiler/notes/compiler_design.html
+++ b/compiler/notes/compiler_design.html
@@ -869,6 +869,10 @@ structure of goals, including the annotations on goals.
hlds_clauses.m defines the part of the HLDS concerning clauses.
hlds_rtti.m defines the part of the HLDS concerning RTTI.
+Specifically, it defines the rtti_varmaps type, and operations on it.
+
+rtti_proc_label.m defines the HLDS representation
+from which the backends will generate the identifiers of procedures.
const_struct.m defines the part of the HLDS concerning constant structures.
diff --git a/compiler/opt_debug.m b/compiler/opt_debug.m
index 9091eacaf..46e319da8 100644
--- a/compiler/opt_debug.m
+++ b/compiler/opt_debug.m
@@ -153,9 +153,9 @@
:- import_module backend_libs.c_util.
:- import_module backend_libs.proc_label.
:- import_module hlds.hlds_data.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_name.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module ll_backend.llds_out.
:- import_module ll_backend.llds_out.llds_out_code_addr.
:- import_module mdbcomp.sym_name.
diff --git a/compiler/proc_gen.m b/compiler/proc_gen.m
index fce111a8e..ec4992060 100644
--- a/compiler/proc_gen.m
+++ b/compiler/proc_gen.m
@@ -75,11 +75,11 @@
:- import_module hlds.hlds_out.
:- import_module hlds.hlds_out.hlds_out_util.
:- import_module hlds.hlds_proc_util.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.instmap.
:- import_module hlds.pred_name.
:- import_module hlds.proc_info_types.
:- import_module hlds.proc_table_struct.
+:- import_module hlds.rtti_proc_label.
:- 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
index 8f3ff8253..02b641e32 100644
--- a/compiler/proc_info_types.m
+++ b/compiler/proc_info_types.m
@@ -20,9 +20,9 @@
:- import_module analysis.
:- import_module analysis.framework.
:- import_module hlds.hlds_goal.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.instmap.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module mdbcomp.
:- import_module mdbcomp.goal_path. % for forward_goal_path
:- import_module mdbcomp.program_representation. % for coverage_point_info
diff --git a/compiler/proc_label.m b/compiler/proc_label.m
index d66f92bb3..ec42ed3ef 100644
--- a/compiler/proc_label.m
+++ b/compiler/proc_label.m
@@ -21,8 +21,8 @@
:- import_module hlds.
:- import_module hlds.hlds_module.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module mdbcomp.
:- import_module mdbcomp.prim_data.
:- import_module parse_tree.
diff --git a/compiler/proc_table_struct.m b/compiler/proc_table_struct.m
index 2e1d86d74..c59c38176 100644
--- a/compiler/proc_table_struct.m
+++ b/compiler/proc_table_struct.m
@@ -17,8 +17,8 @@
:- module hlds.proc_table_struct.
:- interface.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.proc_info_types.
+:- import_module hlds.rtti_proc_label.
:- import_module parse_tree.
:- import_module parse_tree.prog_data.
:- import_module parse_tree.prog_data_pragma.
diff --git a/compiler/rtti.m b/compiler/rtti.m
index adf7cf64e..08a131e5b 100644
--- a/compiler/rtti.m
+++ b/compiler/rtti.m
@@ -28,8 +28,8 @@
:- interface.
:- import_module hlds.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.proc_table_struct.
+:- import_module hlds.rtti_proc_label.
:- import_module libs.
:- import_module libs.globals.
:- import_module mdbcomp.
diff --git a/compiler/rtti_out.m b/compiler/rtti_out.m
index 81a61d2df..a8d9849bf 100644
--- a/compiler/rtti_out.m
+++ b/compiler/rtti_out.m
@@ -115,7 +115,7 @@
:- import_module backend_libs.name_mangle.
:- import_module backend_libs.type_ctor_info.
:- import_module hlds.
-:- import_module hlds.hlds_rtti.
+:- import_module hlds.rtti_proc_label.
:- import_module libs.
:- import_module libs.globals.
:- import_module ll_backend.code_util.
diff --git a/compiler/rtti_proc_label.m b/compiler/rtti_proc_label.m
new file mode 100644
index 000000000..a3a6606f7
--- /dev/null
+++ b/compiler/rtti_proc_label.m
@@ -0,0 +1,161 @@
+%---------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%---------------------------------------------------------------------------%
+% Copyright (C) 1996-2007, 2009-2012 The University of Melbourne.
+% Copyright (C) 2014-2016, 2018, 2021-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: rtti_proc_label.m.
+%
+% This module defines the rtti_proc_label type, and some operations on it.
+%
+%---------------------------------------------------------------------------%
+
+:- module hlds.rtti_proc_label.
+:- interface.
+
+:- import_module hlds.hlds_module.
+:- import_module hlds.pred_name.
+:- import_module hlds.pred_proc_id.
+:- import_module mdbcomp.
+:- import_module mdbcomp.prim_data.
+:- import_module mdbcomp.sym_name.
+:- import_module parse_tree.
+:- import_module parse_tree.prog_data.
+
+:- import_module assoc_list.
+:- import_module bool.
+:- import_module list.
+
+%---------------------------------------------------------------------------%
+
+:- type prog_var_name == string.
+
+ % The rtti_proc_label type holds all the information about a procedure
+ % that we need to compute the entry label for that procedure
+ % in the target language (the llds.code_addr or mlds.code_addr).
+
+:- type rtti_proc_label
+ ---> rtti_proc_label(
+ rpl_pred_or_func :: pred_or_func,
+ rpl_this_module :: module_name,
+ rpl_proc_module :: module_name,
+ rpl_proc_name :: string,
+ rpl_proc_arity :: pred_form_arity,
+ rpl_proc_arg_types :: list(mer_type),
+ rpl_pred_id :: pred_id,
+ rpl_proc_id :: proc_id,
+ rpl_proc_headvars :: assoc_list(prog_var,
+ prog_var_name),
+ rpl_proc_top_modes :: list(top_functor_mode),
+ rpl_proc_interface_detism :: determinism,
+
+ % The following booleans hold values computed from the
+ % pred_info, using procedures
+ % pred_info_is_imported/1,
+ % pred_info_is_pseudo_imported/1,
+ % pred_info_get_origin/1
+ % respectively.
+ % We store booleans here, rather than storing the
+ % pred_info, to avoid retaining a reference to the
+ % parts of the pred_info that we aren't interested in,
+ % so that those parts can be garbage collected.
+ % We use booleans rather than an import_status
+ % so that we can continue to use the above-mentioned
+ % abstract interfaces rather than hard-coding tests
+ % on the import_status.
+
+ rpl_pred_is_imported :: bool,
+ rpl_pred_is_pseudo_imported :: bool,
+ rpl_pred_info_origin :: pred_origin,
+
+ % The following boolean holds a value computed from the
+ % proc_info, using procedure_is_exported/2
+
+ rpl_proc_is_exported :: bool,
+
+ % The following bool is true if the procedure was
+ % imported, either because the containing predicate
+ % was imported, or because it was pseudoimported
+ % and the procedure is an in-in unify procedure.
+
+ rpl_proc_is_imported :: bool
+ ).
+
+ % Construct an rtti_proc_label for a given procedure.
+ %
+:- func make_rtti_proc_label(module_info, pred_id, proc_id) = rtti_proc_label.
+
+ % The inverse of make_rtti_proc_label.
+ %
+:- pred proc_label_pred_proc_id(rtti_proc_label::in,
+ pred_id::out, proc_id::out) is det.
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+:- implementation.
+
+:- import_module hlds.hlds_pred.
+:- import_module hlds.hlds_proc.
+:- import_module hlds.hlds_proc_util.
+:- import_module hlds.mode_top_functor.
+:- import_module parse_tree.var_table.
+
+:- import_module pair.
+:- import_module term.
+
+%---------------------------------------------------------------------------%
+
+make_rtti_proc_label(ModuleInfo, PredId, ProcId) = ProcLabel :-
+ module_info_get_name(ModuleInfo, ThisModule),
+ module_info_pred_proc_info(ModuleInfo, PredId, ProcId, PredInfo, ProcInfo),
+ PredOrFunc = pred_info_is_pred_or_func(PredInfo),
+ PredModule = pred_info_module(PredInfo),
+ PredName = pred_info_name(PredInfo),
+ PredFormArity = pred_info_pred_form_arity(PredInfo),
+ pred_info_get_arg_types(PredInfo, ArgTypes),
+ proc_info_get_var_table(ProcInfo, ProcVarTable),
+ proc_info_get_headvars(ProcInfo, ProcHeadVars),
+ proc_info_get_argmodes(ProcInfo, ProcModes),
+ proc_info_interface_determinism(ProcInfo, ProcDetism),
+ modes_to_top_functor_modes(ModuleInfo, ProcModes, ArgTypes, ProcTopModes),
+ PredIsImported =
+ (if pred_info_is_imported(PredInfo) then yes else no),
+ PredIsPseudoImp =
+ (if pred_info_is_pseudo_imported(PredInfo) then yes else no),
+ ProcIsExported =
+ (if procedure_is_exported(ModuleInfo, PredInfo, ProcId)
+ then yes else no),
+ pred_info_get_origin(PredInfo, Origin),
+ ProcHeadVarsWithNames = list.map(
+ ( func(Var) = Var - Name :-
+ Name = var_table_entry_name(ProcVarTable, Var)
+ ), ProcHeadVars),
+ ( if
+ (
+ PredIsImported = yes
+ ;
+ PredIsPseudoImp = yes,
+ in_in_unification_proc_id(ProcId)
+ )
+ then
+ ProcIsImported = yes
+ else
+ ProcIsImported = no
+ ),
+ ProcLabel = rtti_proc_label(PredOrFunc, ThisModule, PredModule,
+ PredName, PredFormArity, ArgTypes, PredId, ProcId,
+ ProcHeadVarsWithNames, ProcTopModes, ProcDetism,
+ PredIsImported, PredIsPseudoImp, Origin,
+ ProcIsExported, ProcIsImported).
+
+proc_label_pred_proc_id(RttiProcLabel, PredId, ProcId) :-
+ PredId = RttiProcLabel ^ rpl_pred_id,
+ ProcId = RttiProcLabel ^ rpl_proc_id.
+
+%---------------------------------------------------------------------------%
+:- end_module hlds.rtti_proc_label.
+%---------------------------------------------------------------------------%
diff --git a/compiler/rtti_to_mlds.m b/compiler/rtti_to_mlds.m
index 1c6733266..f0e381fff 100644
--- a/compiler/rtti_to_mlds.m
+++ b/compiler/rtti_to_mlds.m
@@ -57,8 +57,8 @@
:- implementation.
:- import_module backend_libs.type_ctor_info.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module libs.
:- import_module libs.globals.
:- import_module mdbcomp.
diff --git a/compiler/stack_layout.m b/compiler/stack_layout.m
index 14242397b..47190770d 100644
--- a/compiler/stack_layout.m
+++ b/compiler/stack_layout.m
@@ -110,7 +110,7 @@
:- import_module hlds.goal_vars.
:- import_module hlds.hlds_llds.
:- import_module hlds.hlds_proc_util.
-:- import_module hlds.hlds_rtti.
+:- import_module hlds.rtti_proc_label.
:- import_module hlds.type_util.
:- import_module libs.
:- import_module libs.globals.
diff --git a/compiler/table_gen.m b/compiler/table_gen.m
index 55cac20f5..eb92e3a35 100644
--- a/compiler/table_gen.m
+++ b/compiler/table_gen.m
@@ -80,6 +80,7 @@
:- import_module hlds.pred_table.
:- import_module hlds.proc_info_types.
:- import_module hlds.proc_table_struct.
+:- import_module hlds.rtti_proc_label.
:- import_module hlds.status.
:- import_module hlds.type_classify.
:- import_module libs.
diff --git a/compiler/type_class_info.m b/compiler/type_class_info.m
index 8120a0835..e3cda4cd2 100644
--- a/compiler/type_class_info.m
+++ b/compiler/type_class_info.m
@@ -49,8 +49,8 @@
:- import_module backend_libs.pseudo_type_info.
:- import_module hlds.hlds_class.
:- import_module hlds.hlds_pred.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module hlds.status.
:- import_module mdbcomp.
:- import_module mdbcomp.sym_name.
diff --git a/compiler/type_ctor_info.m b/compiler/type_ctor_info.m
index 47664c673..7aabb8a50 100644
--- a/compiler/type_ctor_info.m
+++ b/compiler/type_ctor_info.m
@@ -73,8 +73,8 @@
:- import_module backend_libs.type_class_info.
:- import_module hlds.hlds_class.
:- import_module hlds.hlds_data.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module hlds.special_pred.
:- import_module hlds.status.
:- import_module hlds.type_util.
diff --git a/compiler/unify_gen_construct.m b/compiler/unify_gen_construct.m
index 2d6344a6e..f467ec098 100644
--- a/compiler/unify_gen_construct.m
+++ b/compiler/unify_gen_construct.m
@@ -63,10 +63,10 @@
:- import_module hlds.goal_form.
:- import_module hlds.hlds_code_util.
:- import_module hlds.hlds_data.
-:- import_module hlds.hlds_rtti.
:- import_module hlds.mode_top_functor.
:- import_module hlds.pred_name.
:- import_module hlds.pred_proc_id.
+:- import_module hlds.rtti_proc_label.
:- import_module hlds.type_classify.
:- import_module libs.
:- import_module libs.globals.