[m-dev.] [reuse] diff: output all types in .opt file

Peter Ross Peter.Ross at cs.kuleuven.ac.be
Mon Oct 16 19:48:29 AEDT 2000


Hi,


===================================================================


Estimated hours taken: 1

intermod.m:
    The reuse analysis requires all the types to be known, so output all
    types defined in a module to the opt file.


Index: intermod.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
retrieving revision 1.83.2.3
diff -u -r1.83.2.3 intermod.m
--- intermod.m	2000/09/25 17:03:00	1.83.2.3
+++ intermod.m	2000/10/16 08:47:05
@@ -1074,7 +1074,7 @@
 		io__state::uo) is det.
 
 intermod__write_intermod_info_2(IntermodInfo) -->
-	{ IntermodInfo = info(_, Preds0, PredDecls0, Instances, Types, _,
+	{ IntermodInfo = info(_, Preds0, PredDecls0, Instances, _Types, _,
 				ModuleInfo, WriteHeader, _, _) },
 	{ set__to_sorted_list(Preds0, Preds) }, 
 	{ set__to_sorted_list(PredDecls0, PredDecls) },
@@ -1090,6 +1090,18 @@
 	;
 		[]
 	),
+
+	{ module_info_types( ModuleInfo, TypesMap ) }, 
+	{ map__to_assoc_list( TypesMap, AllTypes) }, 
+	{ list__filter( 
+		pred(P::in) is semidet :- 
+		    ( P = _TId - TDefn, 
+		      hlds_data__get_type_defn_status( TDefn, Stat), 
+		      hlds_pred__status_defined_in_this_module(Stat, yes)
+		      
+		    ),
+		AllTypes, 
+		Types ) },
 
 	intermod__write_types(Types),
 	intermod__write_insts(ModuleInfo),

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list