[m-rev.] trivial diff: resolve ambiguous overloadings in compiler

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Dec 20 23:44:08 AEDT 2004


Estimated hours taken: 0.5
Branches: main

compiler/hhf.m:
compiler/inst_graph.m:
compiler/mode_constraint_robdd.m:
compiler/mode_constraints.m:
	Module qualify calls to predicates as necessary in
	order to avoid ambiguous overloadings (and the resulting
	type ambiguites) when compiling with intermodule-optimization
	enabled.

Julien.

Index: compiler/hhf.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/hhf.m,v
retrieving revision 1.2
diff -u -r1.2 hhf.m
--- compiler/hhf.m	20 Dec 2004 01:15:37 -0000	1.2
+++ compiler/hhf.m	20 Dec 2004 11:25:54 -0000
@@ -298,7 +298,7 @@
 			map__lookup(InstGraph0, A, Node),
 			Node = node(_, parent(_))
 		;
-			A `member` NonLocals
+			A `set__member` NonLocals
 		)
 	->
 		VarSet0 = !.HI ^ varset,
Index: compiler/inst_graph.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/inst_graph.m,v
retrieving revision 1.2
diff -u -r1.2 inst_graph.m
--- compiler/inst_graph.m	20 Dec 2004 01:15:39 -0000	1.2
+++ compiler/inst_graph.m	20 Dec 2004 11:34:00 -0000
@@ -206,10 +206,10 @@
 	(
 		Descendant = Arg
 	;
-		( Arg `member` Seen ->
+		( Arg `set__member` Seen ->
 			fail
 		;
-			descendant_2(InstGraph, Seen `insert` Arg,
+			descendant_2(InstGraph, Seen `set__insert` Arg,
 				Arg, Descendant)
 		)
 	).
@@ -235,11 +235,11 @@
 	map__lookup(InstGraph, Var, node(Functors, _)),
 	map__foldl((pred(_ConsId::in, Args::in, MAcc0::in, MAcc::out) is det :-
 		list__foldl((pred(Arg::in, LAcc0::in, LAcc::out) is det :-
-			( Arg `member` Seen ->
+			( Arg `set__member` Seen ->
 				LAcc = LAcc0
 			;
 				foldl_reachable_aux(P,
-					InstGraph, Arg, Seen `insert` Arg,
+					InstGraph, Arg, Seen `set__insert` Arg,
 					LAcc0, LAcc)
 			)
 		), Args, MAcc0, MAcc)
@@ -266,12 +266,12 @@
 			MAcc20::in, MAcc2::out) is det :-
 		list__foldl2((pred(Arg::in, LAccA0::in, LAccA::out,
 				LAccB0::in, LAccB::out) is det :-
-			( Arg `member` Seen ->
+			( Arg `set__member` Seen ->
 				LAccA = LAccA0,
 				LAccB = LAccB0
 			;
 				foldl_reachable_aux2(P,
-					InstGraph, Arg, Seen `insert` Arg,
+					InstGraph, Arg, Seen `set__insert` Arg,
 					LAccA0, LAccA, LAccB0, LAccB)
 			)
 		), Args, MAcc10, MAcc1, MAcc20, MAcc2)
@@ -294,13 +294,13 @@

 corresponding_nodes_2(_, _, _, _, A, B, A, B).
 corresponding_nodes_2(InstGraphA, InstGraphB, SeenA0, SeenB0, A, B, V, W) :-
-	not ( A `member` SeenA0, B `member` SeenB0 ),
+	not ( A `set__member` SeenA0, B `set__member` SeenB0 ),

 	map__lookup(InstGraphA, A, node(FunctorsA, _)),
 	map__lookup(InstGraphB, B, node(FunctorsB, _)),

-	SeenA = SeenA0 `insert` A,
-	SeenB = SeenB0 `insert` B,
+	SeenA = SeenA0 `set__insert` A,
+	SeenB = SeenB0 `set__insert` B,

 	( map__member(FunctorsA, ConsId, ArgsA) ->
 		( map__is_empty(FunctorsB) ->
Index: compiler/mode_constraint_robdd.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_constraint_robdd.m,v
retrieving revision 1.2
diff -u -r1.2 mode_constraint_robdd.m
--- compiler/mode_constraint_robdd.m	20 Dec 2004 01:15:40 -0000	1.2
+++ compiler/mode_constraint_robdd.m	20 Dec 2004 11:16:16 -0000
@@ -270,7 +270,7 @@
 	bimap__ordinates(VarMap, Keys),
 	Constraint1 = ensure_normalised(Constraint0),
 	solutions((pred(ProgVar::out) is nondet :-
-			member(Key, Keys),
+			list__member(Key, Keys),
 			Key = key(in(ProgVar), PredId, LambdaPath),
 			bimap__lookup(VarMap, Key, RobddVar),
 			var_entailed(Constraint1, RobddVar)
Index: compiler/mode_constraints.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mode_constraints.m,v
retrieving revision 1.2
diff -u -r1.2 mode_constraints.m
--- compiler/mode_constraints.m	20 Dec 2004 01:15:40 -0000	1.2
+++ compiler/mode_constraints.m	20 Dec 2004 11:21:41 -0000
@@ -913,7 +913,7 @@
 	mode_constraint_var(in(V), V_in, !MCI),
 	mode_constraint_var(out(V), V_out, !MCI),
 	mode_constraint_var(V `at` [], V_, !MCI),
-	( TopLevel `member` HeadVars ->
+	( TopLevel `list__member` HeadVars ->
 		% For each variable V in the instantiation graph, add
 		%	(Vout = Vin + V), ~(Vin * V)
 		!:Constraint = !.Constraint ^

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list