[m-rev.] [CTGC] trivial diff: use remove_typeinfo_vars

Nancy Mazur Nancy.Mazur at cs.kuleuven.ac.be
Fri Jan 26 16:06:18 AEDT 2007


Hi,


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



Estimated hours taken: 0.10

Obviously it was never a good idea to rely on list lengths to eliminate
typeinfo vars from a list of vars... fix it by using remove_typeinfo_vars
instead. 

compiler/structure_reuse.indirect.m:
	Use remove_typeinfo_vars.


Index: compiler/structure_reuse.indirect.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/structure_reuse.indirect.m,v
retrieving revision 1.8
diff -u -d -r1.8 structure_reuse.indirect.m
--- compiler/structure_reuse.indirect.m	6 Jan 2007 09:23:53 -0000	1.8
+++ compiler/structure_reuse.indirect.m	26 Jan 2007 04:56:44 -0000
@@ -56,6 +56,7 @@
 :- import_module libs.options.
 :- import_module parse_tree.prog_data.
 :- import_module parse_tree.prog_out.
+:- import_module parse_tree.prog_type.
 :- import_module transform_hlds.ctgc.datastruct.
 :- import_module transform_hlds.ctgc.fixpoint_table.
 :- import_module transform_hlds.ctgc.livedata.
@@ -196,17 +197,16 @@
 
 ir_background_info_init(ModuleInfo, PredInfo, ProcInfo, SharingTable,
         ReuseTable) = BG :-
-    PredOrigArity = pred_info_orig_arity(PredInfo),
-    proc_info_get_headvars(ProcInfo, HeadVars),
-    PredArity = list.length(HeadVars),
-    Diff = PredArity - PredOrigArity,
     % We don't need to keep track of any information regarding inserted
     % type-info arguments and alike, so we remove them from the list
     % of headvariables:
-    list.det_split_list(Diff, HeadVars, _AddedHeadVars, OrigHeadVars),
+    proc_info_get_headvars(ProcInfo, HeadVars),
+    proc_info_get_vartypes(ProcInfo, Vartypes), 
+    HeadVarsOfInterest = 
+        remove_typeinfo_vars(Vartypes, HeadVars), 
 
     BG = ir_background_info(ModuleInfo, PredInfo, ProcInfo,
-        SharingTable, ReuseTable, OrigHeadVars).
+        SharingTable, ReuseTable, HeadVarsOfInterest).
 
 :- func analysis_info_init(pred_proc_id, sr_fixpoint_table) = ir_analysis_info.
 


-- 
nancy.mazur at cs.kuleuven.ac.be ------------ Katholieke Universiteit Leuven -
tel: +32-16-327596 - fax: +32-16-327996 ------- Dept. of Computer Science -

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list