[m-rev.] diff: minor simplification to polymorphism code

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Jan 11 15:44:56 AEDT 2007


Estimated hours taken: 0.5
Branches: main

Make a minor simplification to the polymorphism code.

compiler/polymorphism.m:
 	Don't thread the the list of type variables through the code
 	that introduces polymorphism into clause arguments, since we
 	don't actually use it anywhere.

Julien.

Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.316
diff -u -r1.316 polymorphism.m
--- compiler/polymorphism.m	11 Jan 2007 03:36:00 -0000	1.316
+++ compiler/polymorphism.m	11 Jan 2007 04:40:17 -0000
@@ -565,7 +565,7 @@
      clauses_info_get_headvars(!.ClausesInfo, HeadVars0),

      setup_headvars(PredInfo0, HeadVars0, HeadVars,
-        ExtraArgModes, _HeadTypeVars, UnconstrainedTVars,
+        ExtraArgModes, UnconstrainedTVars,
          ExtraTypeInfoHeadVars, ExistTypeClassInfoHeadVars, !Info),

      clauses_info_clauses_only(!.ClausesInfo, Clauses0),
@@ -672,20 +672,19 @@
      %
  :- pred setup_headvars(pred_info::in, proc_arg_vector(prog_var)::in,
      proc_arg_vector(prog_var)::out, poly_arg_vector(mer_mode)::out,
-    list(tvar)::out, list(tvar)::out,
-    list(prog_var)::out, list(prog_var)::out,
+    list(tvar)::out, list(prog_var)::out, list(prog_var)::out,
      poly_info::in, poly_info::out) is det.

  setup_headvars(PredInfo, !HeadVars, ExtraArgModes,
-        HeadTypeVars, UnconstrainedTVars, ExtraHeadTypeInfoVars,
+        UnconstrainedTVars, ExtraHeadTypeInfoVars,
          ExistHeadTypeClassInfoVars, !Info) :-
      pred_info_get_origin(PredInfo, Origin),
      ExtraArgModes0 = poly_arg_vector_init : poly_arg_vector(mer_mode),
      ( Origin = origin_instance_method(InstanceMethodConstraints) ->
          setup_headvars_instance_method(PredInfo,
              InstanceMethodConstraints, !HeadVars,
-            HeadTypeVars, UnconstrainedTVars,
-            ExtraHeadTypeInfoVars, ExistHeadTypeClassInfoVars,
+            UnconstrainedTVars, ExtraHeadTypeInfoVars,
+            ExistHeadTypeClassInfoVars,
              ExtraArgModes0, ExtraArgModes, !Info)
      ;
          pred_info_get_class_context(PredInfo, ClassContext),
@@ -694,7 +693,7 @@
          InstanceUnconstrainedTypeInfoVars = [],
          setup_headvars_2(PredInfo, ClassContext, InstanceTVars,
              InstanceUnconstrainedTVars, InstanceUnconstrainedTypeInfoVars,
-            !HeadVars, HeadTypeVars, UnconstrainedTVars,
+            !HeadVars, UnconstrainedTVars,
              ExtraHeadTypeInfoVars, ExistHeadTypeClassInfoVars,
              ExtraArgModes0, ExtraArgModes, !Info)
      ).
@@ -706,14 +705,13 @@
  :- pred setup_headvars_instance_method(pred_info::in,
      instance_method_constraints::in,
      proc_arg_vector(prog_var)::in, proc_arg_vector(prog_var)::out,
-    list(tvar)::out, list(tvar)::out,
-    list(prog_var)::out, list(prog_var)::out,
+    list(tvar)::out, list(prog_var)::out, list(prog_var)::out,
      poly_arg_vector(mer_mode)::in, poly_arg_vector(mer_mode)::out,
      poly_info::in, poly_info::out) is det.

  setup_headvars_instance_method(PredInfo,
          InstanceMethodConstraints, !HeadVars, 
-        HeadTypeVars, UnconstrainedTVars, ExtraHeadTypeInfoVars,
+        UnconstrainedTVars, ExtraHeadTypeInfoVars,
          ExistHeadTypeClassInfoVars, !ExtraArgModes, !Info) :-

      InstanceMethodConstraints = instance_method_constraints(_,
@@ -751,22 +749,21 @@
      setup_headvars_2(PredInfo, ClassContext,
          InstanceTVars,
          UnconstrainedInstanceTVars, UnconstrainedInstanceTypeInfoVars,
-        !HeadVars, HeadTypeVars,
+        !HeadVars,
          UnconstrainedTVars, ExtraHeadTypeInfoVars,
          ExistHeadTypeClassInfoVars, !ExtraArgModes, !Info).

  :- pred setup_headvars_2(pred_info::in, prog_constraints::in,
      list(tvar)::in, list(tvar)::in, list(prog_var)::in,
      proc_arg_vector(prog_var)::in, proc_arg_vector(prog_var)::out,
-    list(tvar)::out, list(tvar)::out,
-    list(prog_var)::out, list(prog_var)::out,
+    list(tvar)::out, list(prog_var)::out, list(prog_var)::out,
      poly_arg_vector(mer_mode)::in, poly_arg_vector(mer_mode)::out,
      poly_info::in, poly_info::out) is det.

  setup_headvars_2(PredInfo, ClassContext,
          InstanceTVars, UnconstrainedInstanceTVars,
          UnconstrainedInstanceTypeInfoVars, HeadVars0,
-        HeadVars, HeadTypeVars, AllUnconstrainedTVars,
+        HeadVars, AllUnconstrainedTVars,
          AllExtraHeadTypeInfoVars, ExistHeadTypeClassInfoVars,
          !ExtraArgModes, !Info) :-


--------------------------------------------------------------------------
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