[m-rev.] for review: term size profiling

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri May 30 02:16:27 AEST 2003


On 29-May-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 1.
> 
> > compiler/goal_util.m:
> > compiler/hlds_module.m:

compiler/goal_util.m:
compiler/hlds_module.m:
	When generating calls, specify whether the call is to a predicate or
	function.

compiler/goal_util.m:
compiler/unify_proc.m:
	Move a predicate that generates unsafe casts from unify_proc to
	goal_util, since polymorphism may also want to use it someday.

compiler/add_heap_ops.m:
compiler/add_trail_ops.m:
compiler/aditi_builtin_ops.m:
compiler/deep_profiling.m:
compiler/det_analysis.m:
compiler/higher_order.m:
compiler/polymorphism.m:
compiler/simplify.m:
compiler/table_gen.m:
compiler/type_ctor_info.m:
compiler/type_util.m:
compiler/typecheck.m:
	Trivial diffs to conform to the changes above.

Zoltan.

cvs diff: Diffing .
Index: add_heap_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_heap_ops.m,v
retrieving revision 1.8
diff -u -b -r1.8 add_heap_ops.m
--- add_heap_ops.m	15 Mar 2003 07:11:55 -0000	1.8
+++ add_heap_ops.m	29 May 2003 15:12:23 -0000
@@ -351,8 +351,8 @@
 generate_call(PredName, Args, Detism, MaybeFeature, InstMap, Module, Context,
 		CallGoal) :-
 	mercury_private_builtin_module(BuiltinModule),
-	goal_util__generate_simple_call(BuiltinModule, PredName, Args,
-		only_mode, Detism, MaybeFeature, InstMap, Module,
+	goal_util__generate_simple_call(BuiltinModule, PredName, predicate,
+		Args, only_mode, Detism, MaybeFeature, InstMap, Module,
 		Context, CallGoal).
 
 %-----------------------------------------------------------------------------%
Index: add_trail_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/add_trail_ops.m,v
retrieving revision 1.10
diff -u -b -r1.10 add_trail_ops.m
--- add_trail_ops.m	15 Mar 2003 03:08:42 -0000	1.10
+++ add_trail_ops.m	29 May 2003 15:12:23 -0000
@@ -145,7 +145,7 @@
 		% So we use a call to `private_builtin__unused' (which
 		% will call error/1) rather than `fail' for the "then" part.
 		mercury_private_builtin_module(PrivateBuiltin),
-		generate_simple_call(PrivateBuiltin, "unused",
+		generate_simple_call(PrivateBuiltin, "unused", predicate,
 			[], only_mode, det,
 			no, [], ModuleInfo, Context, ThenGoal)
 	;
@@ -475,8 +475,8 @@
 generate_call(PredName, Args, Detism, MaybeFeature, InstMap, Module, Context,
 		CallGoal) :-
 	mercury_private_builtin_module(BuiltinModule),
-	goal_util__generate_simple_call(BuiltinModule, PredName, Args,
-		only_mode, Detism, MaybeFeature, InstMap, Module,
+	goal_util__generate_simple_call(BuiltinModule, PredName, predicate,
+		Args, only_mode, Detism, MaybeFeature, InstMap, Module,
 		Context, CallGoal).
 
 %-----------------------------------------------------------------------------%
Index: aditi_builtin_ops.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/aditi_builtin_ops.m,v
retrieving revision 1.1
diff -u -b -r1.1 aditi_builtin_ops.m
--- aditi_builtin_ops.m	18 Mar 2003 02:43:35 -0000	1.1
+++ aditi_builtin_ops.m	29 May 2003 15:12:23 -0000
@@ -197,8 +197,8 @@
 
 	ModuleInfo0 =^ module_info,
 	{ lookup_builtin_pred_proc_id(ModuleInfo0,
-		aditi_private_builtin_module, "do_call_returning_relation", 4,
-		only_mode, BuiltinPredId, BuiltinProcId) },
+		aditi_private_builtin_module, "do_call_returning_relation",
+		predicate, 4, only_mode, BuiltinPredId, BuiltinProcId) },
 
 	%
 	% Build the input arguments describing the procedure to call.
@@ -304,7 +304,7 @@
 	{ aditi_builtin_info(ModuleInfo, Builtin,
 		BuiltinProcName, BuiltinProcArity, ConstArgs) },
 	{ lookup_builtin_pred_proc_id(ModuleInfo, aditi_private_builtin_module,
-		BuiltinProcName, BuiltinProcArity, only_mode,
+		BuiltinProcName, predicate, BuiltinProcArity, only_mode,
 		PredId, ProcId) },
 	generate_const_args(ConstArgs, ConstArgVars, ConstArgGoals),
 	transform_aditi_builtin_2(Builtin, Args, Modes, Det,
@@ -478,7 +478,7 @@
 	; Det = erroneous, Proc = "do_erroneous_call"
 	},
 	{ lookup_builtin_pred_proc_id(ModuleInfo0,
-		aditi_private_builtin_module, Proc, 4, only_mode,
+		aditi_private_builtin_module, Proc, predicate, 4, only_mode,
 		BuiltinPredId, BuiltinProcId) },
 	{ BuiltinSymName = qualified(aditi_private_builtin_module, Proc) },
 
Index: deep_profiling.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/deep_profiling.m,v
retrieving revision 1.18
diff -u -b -r1.18 deep_profiling.m
--- deep_profiling.m	18 Mar 2003 02:43:35 -0000	1.18
+++ deep_profiling.m	29 May 2003 15:12:23 -0000
@@ -1471,22 +1471,22 @@
 	( Expr = call(PredId, ProcId, Args, _, _, _) ->
 		(
 			lookup_builtin_pred_proc_id(ModuleInfo,
-				mercury_public_builtin_module, "unify", 2,
-				mode_no(0), PredId, _),
+				mercury_public_builtin_module, "unify",
+				predicate, 2, mode_no(0), PredId, _),
 			Args = [TypeInfoVar | _]
 		->
 			Class = special(proc(PredId, ProcId), TypeInfoVar)
 		;
 			lookup_builtin_pred_proc_id(ModuleInfo,
-				mercury_public_builtin_module, "compare", 3,
-				mode_no(0), PredId, _),
+				mercury_public_builtin_module, "compare",
+				predicate, 3, mode_no(0), PredId, _),
 			Args = [TypeInfoVar | _]
 		->
 			Class = special(proc(PredId, ProcId), TypeInfoVar)
 		;
 			lookup_builtin_pred_proc_id(ModuleInfo,
 				mercury_public_builtin_module,
-				"compare_representation", 3,
+				"compare_representation", predicate, 3,
 				mode_no(0), PredId, _),
 			Args = [TypeInfoVar | _]
 		->
Index: goal_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/goal_util.m,v
retrieving revision 1.85
diff -u -b -r1.85 goal_util.m
--- goal_util.m	26 May 2003 08:59:54 -0000	1.85
+++ goal_util.m	29 May 2003 15:12:23 -0000
@@ -220,7 +220,7 @@
 :- pred goal_util__reordering_maintains_termination(module_info::in, bool::in, 
 		hlds_goal::in, hlds_goal::in) is semidet.
 
-	% generate_simple_call(ModuleName, PredName, Args, ModeNo,
+	% generate_simple_call(ModuleName, ProcName, PredOrFunc, Args, ModeNo,
 	%		Detism, MaybeFeature, InstMapDelta,
 	%		ModuleInfo, Context, CallGoal):
 	% Generate a call to a builtin procedure (e.g.
@@ -235,10 +235,13 @@
 	% from 0.
 	%
 :- pred goal_util__generate_simple_call(module_name::in, string::in,
-	list(prog_var)::in, mode_no::in, determinism::in,
+	pred_or_func::in, list(prog_var)::in, mode_no::in, determinism::in,
 	maybe(goal_feature)::in, assoc_list(prog_var, inst)::in,
 	module_info::in, term__context::in, hlds_goal::out) is det.
 
+:- pred goal_util__generate_unsafe_cast(prog_var::in, prog_var::in,
+	prog_context::in, hlds_goal::out) is det.
+
 %-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%
 
@@ -603,8 +606,7 @@
 	),	
 	goal_util__rhs_goal_vars(RHS, Set2, Set).
 
-goal_util__goal_vars_2(generic_call(GenericCall, ArgVars, _, _),
-		Set0, Set) :-
+goal_util__goal_vars_2(generic_call(GenericCall, ArgVars, _, _), Set0, Set) :-
 	goal_util__generic_call_vars(GenericCall, Vars0),
 	set__insert_list(Set0, Vars0, Set1),
 	set__insert_list(Set1, ArgVars, Set).
@@ -1228,10 +1230,10 @@
 
 %-----------------------------------------------------------------------------%
 
-goal_util__generate_simple_call(ModuleName, PredName, Args, ModeNo, Detism,
-		MaybeFeature, InstMap, Module, Context, CallGoal) :-
+goal_util__generate_simple_call(ModuleName, ProcName, PredOrFunc, Args, ModeNo,
+		Detism, MaybeFeature, InstMap, Module, Context, CallGoal) :-
 	list__length(Args, Arity),
-	lookup_builtin_pred_proc_id(Module, ModuleName, PredName, 
+	lookup_builtin_pred_proc_id(Module, ModuleName, ProcName, PredOrFunc,
 		Arity, ModeNo, PredId, ProcId),
 
 	% builtin_state only uses this to work out whether
@@ -1241,7 +1243,7 @@
 	builtin_state(Module, InvalidPredId, PredId, ProcId, BuiltinState),
 
 	Call = call(PredId, ProcId, Args, BuiltinState, no,
-		qualified(ModuleName, PredName)),
+		qualified(ModuleName, ProcName)),
 	set__init(NonLocals0),
 	set__insert_list(NonLocals0, Args, NonLocals),
 	determinism_components(Detism, _CanFail, NumSolns),
@@ -1264,6 +1266,14 @@
 		CallGoalInfo = CallGoalInfo0
 	),
 	CallGoal = Call - CallGoalInfo.
+
+generate_unsafe_cast(InArg, OutArg, Context, Goal) :-
+	set__list_to_set([InArg, OutArg], NonLocals),
+	instmap_delta_from_assoc_list([OutArg - ground(shared, none)],
+		InstMapDelta),
+	goal_info_init(NonLocals, InstMapDelta, det, pure, Context, GoalInfo),
+	Goal = generic_call(unsafe_cast, [InArg, OutArg],
+		[in_mode, out_mode], det) - GoalInfo.
 
 %-----------------------------------------------------------------------------%
 
Index: higher_order.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/higher_order.m,v
retrieving revision 1.108
diff -u -b -r1.108 higher_order.m
--- higher_order.m	27 May 2003 05:57:09 -0000	1.108
+++ higher_order.m	29 May 2003 15:12:23 -0000
@@ -942,7 +942,8 @@
 get_typeclass_info_args(ModuleInfo, TypeClassInfoVar, PredName, MakeResultType,
 		Args, Index, Goals, Vars, ProcInfo0, ProcInfo) :-
 	lookup_builtin_pred_proc_id(ModuleInfo, mercury_private_builtin_module,
-		PredName, 3, only_mode, ExtractArgPredId, ExtractArgProcId),
+		PredName, predicate, 3, only_mode, ExtractArgPredId,
+		ExtractArgProcId),
 	get_typeclass_info_args_2(TypeClassInfoVar, ExtractArgPredId,
 		ExtractArgProcId,
 		qualified(mercury_private_builtin_module, PredName),
Index: hlds_module.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.86
diff -u -b -r1.86 hlds_module.m
--- hlds_module.m	26 May 2003 08:59:55 -0000	1.86
+++ hlds_module.m	29 May 2003 15:12:23 -0000
@@ -1320,8 +1320,8 @@
 	;       mode_no(int).		% The Nth mode, counting from 0.
 
 :- pred lookup_builtin_pred_proc_id(module_info, module_name,
-		string, arity, mode_no, pred_id, proc_id).
-:- mode lookup_builtin_pred_proc_id(in, in, in, in, in, out, out) is det.
+		string, pred_or_func, arity, mode_no, pred_id, proc_id).
+:- mode lookup_builtin_pred_proc_id(in, in, in, in, in, in, out, out) is det.
 
 %-----------------------------------------------------------------------------%
 
@@ -2029,27 +2029,47 @@
 		error(Message)
 	).
 
-lookup_builtin_pred_proc_id(Module, ModuleName, PredName, 
+lookup_builtin_pred_proc_id(Module, ModuleName, ProcName, PredOrFunc,
 		Arity, ModeNo, PredId, ProcId) :-
 	module_info_get_predicate_table(Module, PredTable),
 	(
+		(
+			PredOrFunc = predicate,
 		predicate_table_search_pred_m_n_a(PredTable,
-			is_fully_qualified, ModuleName, PredName, Arity,
+				is_fully_qualified, ModuleName, ProcName, Arity,
+				[PredId0])
+		;
+			PredOrFunc = function,
+			predicate_table_search_func_m_n_a(PredTable,
+				is_fully_qualified, ModuleName, ProcName, Arity,
 			[PredId0])
+		)
 	->
 		PredId = PredId0
 	;
 		% Some of the table builtins are polymorphic,
 		% and for them we need to subtract one from the arity
 		% to take into account the type_info argument.
+		% XXX The caller should supply us with the exact arity.
+		% Guessing how many of the arguments are typeinfos and/or
+		% typeclass_infos, as this code here does, is error-prone
+		% as well as inefficient.
+		(
+			PredOrFunc = predicate,
 		predicate_table_search_pred_m_n_a(PredTable,
-			is_fully_qualified, ModuleName, PredName, Arity - 1,
-			[PredId0])
+				is_fully_qualified, ModuleName, ProcName,
+				Arity - 1, [PredId0])
+		;
+			PredOrFunc = function,
+			predicate_table_search_func_m_n_a(PredTable,
+				is_fully_qualified, ModuleName, ProcName,
+				Arity - 1, [PredId0])
+		)
 	->
 		PredId = PredId0
 	;
 		string__int_to_string(Arity, ArityS),
-		string__append_list(["can't locate ", PredName,
+		string__append_list(["can't locate ", ProcName,
 			"/", ArityS], ErrorMessage),
 		error(ErrorMessage)
 	),
@@ -2064,7 +2084,7 @@
 		;
 			error(string__format( 
 				"expected single mode for %s/%d",
-				[s(PredName), i(Arity)]))
+				[s(ProcName), i(Arity)]))
 		)
 	;
 		ModeNo = mode_no(N),
@@ -2075,7 +2095,7 @@
 		;
 			error(string__format(
 				"there is no mode %d for %s/%d",
-				[i(N), s(PredName), i(Arity)]))
+				[i(N), s(ProcName), i(Arity)]))
 		)
 	).
 
Index: polymorphism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.237
diff -u -b -r1.237 polymorphism.m
--- polymorphism.m	27 May 2003 05:57:17 -0000	1.237
+++ polymorphism.m	29 May 2003 15:50:43 -0000
@@ -2383,7 +2383,7 @@
 			% even though its declaration is polymorphic.
 
 		goal_util__generate_simple_call(mercury_private_builtin_module,
-			"superclass_from_typeclass_info",
+			"superclass_from_typeclass_info", predicate,
 			[SubClassVar, IndexVar, Var], only_mode, det, no,
 			[], ModuleInfo, term__context_init, SuperClassGoal),
 
@@ -2840,8 +2840,8 @@
 		string__append_list(
 			["builtin_", SpecialName, "_", CategoryName], Name),
 		lookup_builtin_pred_proc_id(ModuleInfo,
-			mercury_private_builtin_module, Name, Arity,
-			only_mode, PredId, ProcId),
+			mercury_private_builtin_module, Name, predicate,
+			Arity, only_mode, PredId, ProcId),
 		PredName = qualified(mercury_private_builtin_module, Name)
 	).
 
@@ -3078,7 +3078,7 @@
 		TypeInfoVar, VarSet, VarTypes),
 
 	goal_util__generate_simple_call(mercury_private_builtin_module,
-		"type_info_from_typeclass_info",
+		"type_info_from_typeclass_info", predicate,
 		[TypeClassInfoVar, IndexVar, TypeInfoVar], only_mode, det, no,
 		[TypeInfoVar - ground(shared, none)], ModuleInfo,
 		term__context_init, CallGoal),
Index: simplify.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/simplify.m,v
retrieving revision 1.118
diff -u -b -r1.118 simplify.m
--- simplify.m	27 May 2003 05:57:20 -0000	1.118
+++ simplify.m	29 May 2003 15:12:23 -0000
@@ -1169,8 +1169,8 @@
 
 	Unique   = ground(unique, none),
 	ArgInsts = [R - Unique],
-	goal_util__generate_simple_call(BuiltinModule, "compare", Args,
-		mode_no(ModeNo), det, no, ArgInsts, ModuleInfo, Context,
+	goal_util__generate_simple_call(BuiltinModule, "compare", predicate,
+		Args, mode_no(ModeNo), det, no, ArgInsts, ModuleInfo, Context,
 		CmpGoal0),
 	CmpGoal0 = CmpExpr - CmpInfo0,
 	goal_info_get_nonlocals(CmpInfo0, CmpNonLocals0),
@@ -1386,8 +1386,9 @@
 		%
 		{ goal_info_get_context(GoalInfo0, GContext) },
 		{ generate_simple_call(mercury_private_builtin_module, 
-			"builtin_unify_pred", [XVar, YVar], mode_no(0),
-			semidet, no, [], ModuleInfo, GContext, Call0 - _) },
+			"builtin_unify_pred", predicate, [XVar, YVar],
+			mode_no(0), semidet, no, [], ModuleInfo,
+			GContext, Call0 - _) },
 		simplify__goal_2(Call0, GoalInfo0, Call1, GoalInfo),
 		{ Call = Call1 - GoalInfo },
 		{ ExtraGoals = [] }
@@ -1462,7 +1463,7 @@
 	ArgVars = [TypeInfoVar, XVar, YVar],
 	goal_info_get_context(GoalInfo, Context),
 	goal_util__generate_simple_call(mercury_public_builtin_module,
-		"unify", ArgVars, mode_no(0), semidet, no, [],
+		"unify", predicate, ArgVars, mode_no(0), semidet, no, [],
 		ModuleInfo, Context, Call).
 
 :- pred simplify__call_specific_unify(type_ctor::in, list(prog_var)::in,
Index: table_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/table_gen.m,v
retrieving revision 1.50
diff -u -b -r1.50 table_gen.m
--- table_gen.m	13 May 2003 09:24:41 -0000	1.50
+++ table_gen.m	29 May 2003 15:12:23 -0000
@@ -1739,8 +1739,8 @@
 generate_call(PredName, Args, Detism, MaybeFeature, InstMap,
 		ModuleInfo, Context, CallGoal) :-
 	mercury_table_builtin_module(BuiltinModule),
-	goal_util__generate_simple_call(BuiltinModule, PredName, Args, 
-		only_mode, Detism, MaybeFeature, InstMap, ModuleInfo,
+	goal_util__generate_simple_call(BuiltinModule, PredName, predicate,
+		Args, only_mode, Detism, MaybeFeature, InstMap, ModuleInfo,
 		Context, CallGoal).
 
 :- pred append_fail(hlds_goal::in, hlds_goal::out) is det.
Index: type_ctor_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/type_ctor_info.m,v
retrieving revision 1.39
diff -u -b -r1.39 type_ctor_info.m
--- type_ctor_info.m	14 May 2003 00:10:03 -0000	1.39
+++ type_ctor_info.m	29 May 2003 15:12:23 -0000
@@ -162,8 +162,8 @@
 		Compare = proc(ComparePredId, CompareProcId)
 	;
 		lookup_builtin_pred_proc_id(ModuleInfo,
-			mercury_private_builtin_module, "unused", 0,
-			only_mode, PredId, ProcId),
+			mercury_private_builtin_module, "unused",
+			predicate, 0, only_mode, PredId, ProcId),
 		Unused = proc(PredId, ProcId),
 		Unify = Unused,
 		Compare = Unused
Index: typecheck.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/typecheck.m,v
retrieving revision 1.339
diff -u -b -r1.339 typecheck.m
--- typecheck.m	27 May 2003 05:57:22 -0000	1.339
+++ typecheck.m	29 May 2003 15:12:23 -0000
@@ -682,8 +682,9 @@
 		CalleeName = "no_clauses"
 	),
 	pred_info_context(PredInfo, Context),
-	generate_simple_call(PrivateBuiltin, CalleeName, [PredNameVar],
-		only_mode, det, no, [], ModuleInfo, Context, CallGoal),
+	generate_simple_call(PrivateBuiltin, CalleeName, predicate,
+		[PredNameVar], only_mode, det, no, [], ModuleInfo,
+		Context, CallGoal),
 	%
 	% Combine the unification and call into a conjunction
 	%
Index: unify_proc.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unify_proc.m,v
retrieving revision 1.121
diff -u -b -r1.121 unify_proc.m
--- unify_proc.m	27 May 2003 05:57:22 -0000	1.121
+++ unify_proc.m	29 May 2003 15:12:23 -0000
@@ -834,8 +834,8 @@
 		"Cast_HeadVar", 1, CastVar1),
 	unify_proc__make_fresh_named_var_from_type(EqvType,
 		"Cast_HeadVar", 2, CastVar2),
-	unify_proc__build_cast(H1, CastVar1, Context, Cast1Goal),
-	unify_proc__build_cast(H2, CastVar2, Context, Cast2Goal),
+	{ generate_unsafe_cast(H1, CastVar1, Context, Cast1Goal) },
+	{ generate_unsafe_cast(H2, CastVar2, Context, Cast2Goal) },
 	{ create_atomic_unification(CastVar1, var(CastVar2), Context,
 		explicit, [], UnifyGoal) },
 
@@ -924,10 +924,10 @@
 				"Cast_HeadVar", 1, CastVar1),
 			unify_proc__make_fresh_named_var_from_type(IntType,
 				"Cast_HeadVar", 2, CastVar2),
-			unify_proc__build_cast(H1, CastVar1, Context,
-				Cast1Goal),
-			unify_proc__build_cast(H2, CastVar2, Context,
-				Cast2Goal),
+			{ generate_unsafe_cast(H1, CastVar1, Context,
+				Cast1Goal) },
+			{ generate_unsafe_cast(H2, CastVar2, Context,
+				Cast2Goal) },
 			unify_proc__build_call("builtin_compare_int",
 				[Res, CastVar1, CastVar2], Context,
 				CompareGoal),
@@ -1006,8 +1006,8 @@
 		"Cast_HeadVar", 1, CastVar1),
 	unify_proc__make_fresh_named_var_from_type(EqvType,
 		"Cast_HeadVar", 2, CastVar2),
-	unify_proc__build_cast(H1, CastVar1, Context, Cast1Goal),
-	unify_proc__build_cast(H2, CastVar2, Context, Cast2Goal),
+	{ generate_unsafe_cast(H1, CastVar1, Context, Cast1Goal) },
+	{ generate_unsafe_cast(H2, CastVar2, Context, Cast2Goal) },
 	unify_proc__build_call("compare", [Res, CastVar1, CastVar2],
 		Context, CompareGoal),
 
@@ -1552,15 +1552,6 @@
 
 %-----------------------------------------------------------------------------%
 
-:- pred unify_proc__build_cast(prog_var, prog_var, prog_context, hlds_goal,
-			unify_proc_info, unify_proc_info).
-:- mode unify_proc__build_cast(in, in, in, out, in, out) is det.
-
-unify_proc__build_cast(InArg, OutArg, Context, Goal) -->
-	{ goal_info_init(Context, GoalInfo) },
-	{ Goal = generic_call(unsafe_cast, [InArg, OutArg],
-			[in_mode, out_mode], det) - GoalInfo }.
-
 :- pred unify_proc__build_call(string, list(prog_var), prog_context, hlds_goal,
 			unify_proc_info, unify_proc_info).
 :- mode unify_proc__build_call(in, in, in, out, in, out) is det.
@@ -1578,8 +1569,9 @@
 	;
 		MercuryBuiltin = mercury_private_builtin_module
 	},
-	{ goal_util__generate_simple_call(MercuryBuiltin, Name, ArgVars,
-		mode_no(0), erroneous, no, [], ModuleInfo, Context, Goal) }.
+	{ goal_util__generate_simple_call(MercuryBuiltin, Name, predicate,
+		ArgVars, mode_no(0), erroneous, no, [], ModuleInfo,
+		Context, Goal) }.
 
 :- pred unify_proc__build_specific_call((type)::in, special_pred_id::in,
 	list(prog_var)::in, instmap_delta::in, determinism::in,
cvs diff: Diffing notes
--------------------------------------------------------------------------
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