[m-rev.] diff: follow_code simplification

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Jan 3 03:16:35 AEDT 2011


compiler/follow_code.m:
	Remove the test of the option governing the application of this
	transformation, since all of our callers already check it.

Index: follow_code.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/follow_code.m,v
retrieving revision 1.100
diff -u -b -r1.100 follow_code.m
--- follow_code.m	30 Dec 2010 11:17:54 -0000	1.100
+++ follow_code.m	2 Jan 2011 14:38:27 -0000
@@ -63,20 +63,13 @@
 %-----------------------------------------------------------------------------%
 
 move_follow_code_in_proc(_PredProcId, !ProcInfo, !ModuleInfo) :-
-    module_info_get_globals(!.ModuleInfo, Globals),
-    globals.lookup_bool_option(Globals, follow_code, FollowCode),
-    (
-        FollowCode = no
-    ;
-        FollowCode = yes,
         proc_info_get_goal(!.ProcInfo, Goal0),
         proc_info_get_varset(!.ProcInfo, Varset0),
         proc_info_get_vartypes(!.ProcInfo, VarTypes0),
         proc_info_get_rtti_varmaps(!.ProcInfo, RttiVarMaps0),
-        (
             move_follow_code_in_goal(Goal0, Goal1, RttiVarMaps0, no, Changed),
-            Changed = yes
-        ->
+    (
+        Changed = yes,
             % We need to fix up the goal_info by recalculating the nonlocal
             % vars and the non-atomic instmap deltas.
             proc_info_get_headvars(!.ProcInfo, HeadVars),
@@ -88,17 +81,13 @@
             proc_info_get_initial_instmap(!.ProcInfo, !.ModuleInfo, InstMap0),
             proc_info_get_inst_varset(!.ProcInfo, InstVarSet),
             recompute_instmap_delta(do_not_recompute_atomic_instmap_deltas,
-                Goal2, Goal, VarTypes, InstVarSet, InstMap0, !ModuleInfo)
-        ;
-            Goal = Goal0,
-            Varset = Varset0,
-            VarTypes = VarTypes0,
-            RttiVarMaps = RttiVarMaps0
-        ),
+            Goal2, Goal, VarTypes, InstVarSet, InstMap0, !ModuleInfo),
         proc_info_set_goal(Goal, !ProcInfo),
         proc_info_set_varset(Varset, !ProcInfo),
         proc_info_set_vartypes(VarTypes, !ProcInfo),
         proc_info_set_rtti_varmaps(RttiVarMaps, !ProcInfo)
+    ;
+        Changed = no
     ).
 
 %-----------------------------------------------------------------------------%
--------------------------------------------------------------------------
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