diff: remove dead code in polymorphism.m

Tyson Dowd trd at cs.mu.OZ.AU
Sun Aug 2 18:09:40 AEST 1998


Hi,

After trying to analyze this code for a while to see how to modify
it, I realized it doesn't actually do anything.

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


Estimated hours taken: 1

Remove some dead code.

compiler/polymorphism.m:
	Remove polymorphism__get_special_proc_list as it isn't used.
	

Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.140
diff -u -r1.140 polymorphism.m
--- polymorphism.m	1998/07/30 09:00:14	1.140
+++ polymorphism.m	1998/08/01 05:11:45
@@ -2306,81 +2306,6 @@
 
 	CountUnifyGoal = CountUnify - CountGoalInfo.
 
-	% Create the unifications to initialize the special pred
-	% variables for this type:
-	%
-	%	SpecialPred1 = __Unify__<type>,
-	%	SpecialPred2 = __Index__<type>,
-	%	SpecialPred3 = __Compare__<type>.
-
-:- pred polymorphism__get_special_proc_list(
-			type, module_info, varset, map(var, type),
-			list(var), list(hlds_goal), varset, map(var, type)).
-:- mode polymorphism__get_special_proc_list(in, in, in, in,
-					out, out, out, out) is det.
-
-polymorphism__get_special_proc_list(Type, ModuleInfo, VarSet0, VarTypes0,
-		SpecialPredVars, SpecialPredGoals, VarSet, VarTypes) :-
-	special_pred_list(SpecialPreds),
-	polymorphism__get_special_proc_list_2(SpecialPreds,
-		Type, ModuleInfo, VarSet0, VarTypes0,
-		SpecialPredVars, SpecialPredGoals, VarSet, VarTypes).
-
-:- pred polymorphism__get_special_proc_list_2(list(special_pred_id),
-			type, module_info, varset, map(var, type),
-			list(var), list(hlds_goal), varset, map(var, type)).
-:- mode polymorphism__get_special_proc_list_2(in, in, in, in, in,
-					out, out, out, out) is det.
-
-polymorphism__get_special_proc_list_2([],
-		_Type, _ModuleInfo, VarSet, VarTypes,
-		[], [], VarSet, VarTypes).
-polymorphism__get_special_proc_list_2([Id | Ids],
-		Type, ModuleInfo, VarSet0, VarTypes0,
-		[Var | Vars], [Goal | Goals], VarSet, VarTypes) :-
-
-	% introduce a fresh variable of the appropriate higher-order pred type
-
-	special_pred_info(Id, Type, PredName, TypeArgs, _Modes, _Det),
-	varset__new_var(VarSet0, Var, VarSet1a),
-	string__append("Var__", PredName, VarName),
-	varset__name_var(VarSet1a, Var, VarName, VarSet1),
-	term__context_init(Context),
-	PredType = term__functor(term__atom("pred"), TypeArgs, Context),
-	map__set(VarTypes0, Var, PredType, VarTypes1),
-
-	% get the ConsId for the address of the appropriate pred
-	% for the operation specified by Id applied to Type.
-
-	classify_type(Type, ModuleInfo, TypeCategory),
-	polymorphism__get_special_proc(TypeCategory, Type, Id, ModuleInfo,
-					PredName2, PredId, ProcId),
-	ConsId = code_addr_const(PredId, ProcId),
-
-	% create a construction unification which unifies the fresh
-	% variable with the address constant obtained above
-
-	Unification = construct(Var, ConsId, [], []),
-
-	Term = functor(cons(PredName2, 0), []),
-
-	Inst = bound(unique, [functor(cons(PredName2, 0), [])]),
-	UnifyMode = (free -> Inst) - (Inst -> Inst),
-	UnifyContext = unify_context(explicit, []),
-		% XXX the UnifyContext is wrong
-	Unify = unify(Var, Term, UnifyMode, Unification, UnifyContext),
-
-	% create a goal_info for the unification
-
-	set__singleton_set(NonLocals, Var),
-	instmap_delta_from_assoc_list([Var - Inst], InstMapDelta),
-	goal_info_init(NonLocals, InstMapDelta, det, GoalInfo),
-	Goal = Unify - GoalInfo,
-
-	polymorphism__get_special_proc_list_2(Ids,
-		Type, ModuleInfo, VarSet1, VarTypes1,
-		Vars, Goals, VarSet, VarTypes).
-
 :- pred polymorphism__get_special_proc(builtin_type, type, special_pred_id,
 				module_info, sym_name, pred_id, proc_id).
 :- mode polymorphism__get_special_proc(in, in, in, in, out, out, out) is det.


-- 
       Tyson Dowd           # There isn't any reason why Linux can't be
                            # implemented as an enterprise computing solution.
     trd at cs.mu.oz.au        # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.



More information about the developers mailing list