[m-rev.] diff: delete cell number field in create rvals
Zoltan Somogyi
zs at cs.mu.OZ.AU
Fri May 2 08:41:59 AEST 2003
compiler/llds.m:
Delete the cell number field from create rvals, since we don't need
it anymore.
compiler/*.m:
Conform to the change above, and simplify predicate interfaces by
deleting arguments whose sole purpose was the allocation of cell
numbers.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/code_exprn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_exprn.m,v
retrieving revision 1.66
diff -u -b -r1.66 code_exprn.m
--- compiler/code_exprn.m 15 Mar 2003 03:08:43 -0000 1.66
+++ compiler/code_exprn.m 1 May 2003 21:15:41 -0000
@@ -422,7 +422,7 @@
code_exprn__filter_out_reg_depending(Rvals0, Vars, Rvals),
set__empty(Rvals)
).
-code_exprn__rval_depends_on_reg(create(_, Rvals, _, _, _, _, Reuse), Vars) :-
+code_exprn__rval_depends_on_reg(create(_, Rvals, _, _, _, Reuse), Vars) :-
code_exprn__args_depend_on_reg([Reuse | Rvals], Vars).
code_exprn__rval_depends_on_reg(mkword(_Tag, Rval), Vars) :-
code_exprn__rval_depends_on_reg(Rval, Vars).
@@ -624,7 +624,7 @@
code_exprn__add_rval_reg_dependencies(lval(Lval)) -->
code_exprn__add_lval_reg_dependencies(Lval).
code_exprn__add_rval_reg_dependencies(var(_Var)) --> [].
-code_exprn__add_rval_reg_dependencies(create(_, Rvals, _, _, _, _, Reuse)) -->
+code_exprn__add_rval_reg_dependencies(create(_, Rvals, _, _, _, Reuse)) -->
code_exprn__add_arg_reg_dependencies([Reuse | Rvals]).
code_exprn__add_rval_reg_dependencies(mkword(_Tag, Rval)) -->
code_exprn__add_rval_reg_dependencies(Rval).
@@ -697,7 +697,7 @@
code_exprn__rem_rval_reg_dependencies(lval(Lval)) -->
code_exprn__rem_lval_reg_dependencies(Lval).
code_exprn__rem_rval_reg_dependencies(var(_Var)) --> [].
-code_exprn__rem_rval_reg_dependencies(create(_, Rvals, _, _, _, _, Reuse)) -->
+code_exprn__rem_rval_reg_dependencies(create(_, Rvals, _, _, _, Reuse)) -->
code_exprn__rem_arg_reg_dependencies([Reuse | Rvals]).
code_exprn__rem_rval_reg_dependencies(mkword(_Tag, Rval)) -->
code_exprn__rem_rval_reg_dependencies(Rval).
@@ -926,18 +926,15 @@
code_exprn__expr_is_constant(Expr0, Vars, ExprnOpts, Expr).
code_exprn__expr_is_constant(create(Tag, Args0, ArgTypes, StatDyn,
- Label, Msg, Reuse),
- Vars, ExprnOpts, NewRval) :-
+ Msg, Reuse), Vars, ExprnOpts, NewRval) :-
Reuse = no,
( StatDyn = must_be_static ->
- NewRval = create(Tag, Args0, ArgTypes, StatDyn,
- Label, Msg, Reuse)
+ NewRval = create(Tag, Args0, ArgTypes, StatDyn, Msg, Reuse)
;
ExprnOpts = nlg_asm_sgt_ubf(_, _, StaticGroundTerms, _),
StaticGroundTerms = yes,
code_exprn__args_are_constant(Args0, Vars, ExprnOpts, Args),
- NewRval = create(Tag, Args, ArgTypes, StatDyn,
- Label, Msg, Reuse)
+ NewRval = create(Tag, Args, ArgTypes, StatDyn, Msg, Reuse)
).
code_exprn__expr_is_constant(var(Var), Vars, ExprnOpts, Rval) :-
@@ -1266,7 +1263,7 @@
code_exprn__rval_is_real_create(Rval) -->
(
- { Rval = create(_, _, _, _, _, _, _) },
+ { Rval = create(_, _, _, _, _, _) },
code_exprn__get_vars(Vars0),
code_exprn__get_options(ExprnOpts),
{ \+ code_exprn__expr_is_constant(Rval, Vars0, ExprnOpts, _) }
@@ -1291,10 +1288,7 @@
code_exprn__construct_code(Lval, VarName, Rval0, Code) -->
{ exprn_aux__simplify_rval(Rval0, Rval) },
- (
- { Rval = create(Tag, Rvals, ArgTypes, _StatDyn, _Label,
- Msg, Reuse) }
- ->
+ ( { Rval = create(Tag, Rvals, ArgTypes, _StatDyn, Msg, Reuse) } ->
{ require(unify(Reuse, no),
"code_exprn__construct_code: structure reuse not yet implemented") },
@@ -1405,7 +1399,7 @@
;
RvalX = unop(_, _)
;
- RvalX = create(_, _, _, _, _, _, _)
+ RvalX = create(_, _, _, _, _, _)
;
RvalX = mkword(_, _)
}
Index: compiler/code_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_gen.m,v
retrieving revision 1.110
diff -u -b -r1.110 code_gen.m
--- compiler/code_gen.m 21 Mar 2003 05:52:04 -0000 1.110
+++ compiler/code_gen.m 1 May 2003 21:48:34 -0000
@@ -37,23 +37,20 @@
:- import_module ll_backend__code_info.
:- import_module ll_backend__llds.
-:- import_module list, io, counter.
+:- import_module list, io.
% Translate a HLDS module to LLDS.
-:- pred generate_code(module_info::in, module_info::out,
- global_data::in, global_data::out, list(c_procedure)::out,
- io__state::di, io__state::uo) is det.
+:- pred generate_code(module_info::in, global_data::in, global_data::out,
+ list(c_procedure)::out, io__state::di, io__state::uo) is det.
% Translate a HLDS procedure to LLDS, threading through
% the data structure that records information about layout
- % structures and the counter for ensuring the uniqueness
- % of cell numbers.
+ % structures.
:- pred generate_proc_code(pred_info::in, proc_info::in,
proc_id::in, pred_id::in, module_info::in,
- global_data::in, global_data::out, counter::in, counter::out,
- c_procedure::out) is det.
+ global_data::in, global_data::out, c_procedure::out) is det.
% Translate a HLDS goal to LLDS.
@@ -111,44 +108,43 @@
% Standard library modules
:- import_module bool, char, int, string.
:- import_module map, assoc_list, set, term, libs__tree, std_util, require.
-:- import_module varset.
+:- import_module counter, varset.
%---------------------------------------------------------------------------%
-generate_code(ModuleInfo0, ModuleInfo, GlobalData0, GlobalData, Procedures) -->
+generate_code(ModuleInfo0, !GlobalData, Procedures) -->
% get a list of all the predicate ids
% for which we are going to generate code.
{ module_info_predids(ModuleInfo0, PredIds) },
% now generate the code for each predicate
- generate_pred_list_code(ModuleInfo0, ModuleInfo,
- GlobalData0, GlobalData, PredIds, Procedures).
+ generate_pred_list_code(ModuleInfo0, !GlobalData, PredIds,
+ Procedures).
% Translate a list of HLDS predicates to LLDS.
-:- pred generate_pred_list_code(module_info::in, module_info::out,
+:- pred generate_pred_list_code(module_info::in,
global_data::in, global_data::out,
list(pred_id)::in, list(c_procedure)::out,
io__state::di, io__state::uo) is det.
-:- pred generate_maybe_pred_code(module_info::in, module_info::out,
- global_data::in, global_data::out, pred_id::in, list(c_procedure)::out,
- io__state::di, io__state::uo) is det.
-
-generate_pred_list_code(ModuleInfo, ModuleInfo, GlobalData, GlobalData,
- [], []) --> [].
-generate_pred_list_code(ModuleInfo0, ModuleInfo, GlobalData0, GlobalData,
- [PredId | PredIds], Predicates) -->
- generate_maybe_pred_code(ModuleInfo0, ModuleInfo1,
- GlobalData0, GlobalData1, PredId, Predicates0),
- generate_pred_list_code(ModuleInfo1, ModuleInfo,
- GlobalData1, GlobalData, PredIds, Predicates1),
+generate_pred_list_code(_ModuleInfo, !GlobalData, [], []) --> [].
+generate_pred_list_code(ModuleInfo, !GlobalData, [PredId | PredIds],
+ Predicates) -->
+ generate_maybe_pred_code(ModuleInfo, !GlobalData, PredId,
+ Predicates0),
+ generate_pred_list_code(ModuleInfo, !GlobalData, PredIds,
+ Predicates1),
{ list__append(Predicates0, Predicates1, Predicates) }.
+:- pred generate_maybe_pred_code(module_info::in,
+ global_data::in, global_data::out, pred_id::in,
+ list(c_procedure)::out, io__state::di, io__state::uo) is det.
+
% Note that some of the logic of generate_maybe_pred_code is duplicated
% by mercury_compile__backend_pass_by_preds, so modifications here may
% also need to be repeated there.
-generate_maybe_pred_code(ModuleInfo0, ModuleInfo, GlobalData0, GlobalData,
+generate_maybe_pred_code(ModuleInfo0, GlobalData0, GlobalData,
PredId, Predicates) -->
{ module_info_preds(ModuleInfo0, PredInfos) },
% get the pred_info structure for this predicate
@@ -162,7 +158,6 @@
}
->
{ Predicates = [] },
- { ModuleInfo = ModuleInfo0 },
{ GlobalData = GlobalData0 }
;
{ module_info_globals(ModuleInfo0, Globals0) },
@@ -189,20 +184,14 @@
% Since they may be opt_imported into other
% modules, we must switch off the tracing
% of such preds on a pred-by-pred basis.
- globals__get_trace_level(Globals0, TraceLevel),
globals__set_trace_level_none(Globals0, Globals1),
module_info_set_globals(ModuleInfo0, Globals1,
ModuleInfo1),
- generate_pred_code(ModuleInfo1, ModuleInfo2,
+ generate_pred_code(ModuleInfo1,
GlobalData0, GlobalData,
- PredId, PredInfo, ProcIds, Predicates),
- module_info_globals(ModuleInfo2, Globals2),
- globals__set_trace_level(Globals2, TraceLevel,
- Globals),
- module_info_set_globals(ModuleInfo2, Globals,
- ModuleInfo)
+ PredId, PredInfo, ProcIds, Predicates)
;
- generate_pred_code(ModuleInfo0, ModuleInfo,
+ generate_pred_code(ModuleInfo0,
GlobalData0, GlobalData,
PredId, PredInfo, ProcIds, Predicates)
}
@@ -210,38 +199,31 @@
% Translate a HLDS predicate to LLDS.
-:- pred generate_pred_code(module_info::in, module_info::out,
- global_data::in, global_data::out, pred_id::in, pred_info::in,
- list(proc_id)::in, list(c_procedure)::out) is det.
+:- pred generate_pred_code(module_info::in, global_data::in, global_data::out,
+ pred_id::in, pred_info::in, list(proc_id)::in, list(c_procedure)::out)
+ is det.
-generate_pred_code(ModuleInfo0, ModuleInfo, GlobalData0, GlobalData,
+generate_pred_code(ModuleInfo, GlobalData0, GlobalData,
PredId, PredInfo, ProcIds, Code) :-
- module_info_get_cell_counter(ModuleInfo0, CellCounter0),
- generate_proc_list_code(ProcIds, PredId, PredInfo, ModuleInfo0,
- GlobalData0, GlobalData, CellCounter0, CellCounter,
- [], Code),
- module_info_set_cell_counter(ModuleInfo0, CellCounter, ModuleInfo).
+ generate_proc_list_code(ProcIds, PredId, PredInfo, ModuleInfo,
+ GlobalData0, GlobalData, [], Code).
% Translate all the procedures of a HLDS predicate to LLDS.
:- pred generate_proc_list_code(list(proc_id)::in, pred_id::in, pred_info::in,
module_info::in, global_data::in, global_data::out,
- counter::in, counter::out,
list(c_procedure)::in, list(c_procedure)::out) is det.
generate_proc_list_code([], _PredId, _PredInfo, _ModuleInfo,
- GlobalData, GlobalData, CellCounter, CellCounter,
- Procs, Procs).
+ GlobalData, GlobalData, Procs, Procs).
generate_proc_list_code([ProcId | ProcIds], PredId, PredInfo, ModuleInfo0,
- GlobalData0, GlobalData, CellCounter0, CellCounter,
- Procs0, Procs) :-
+ GlobalData0, GlobalData, Procs0, Procs) :-
pred_info_procedures(PredInfo, ProcInfos),
map__lookup(ProcInfos, ProcId, ProcInfo),
generate_proc_code(PredInfo, ProcInfo, ProcId, PredId, ModuleInfo0,
- GlobalData0, GlobalData1, CellCounter0, CellCounter1, Proc),
+ GlobalData0, GlobalData1, Proc),
generate_proc_list_code(ProcIds, PredId, PredInfo, ModuleInfo0,
- GlobalData1, GlobalData, CellCounter1, CellCounter,
- [Proc | Procs0], Procs).
+ GlobalData1, GlobalData, [Proc | Procs0], Procs).
%---------------------------------------------------------------------------%
@@ -263,7 +245,7 @@
%---------------------------------------------------------------------------%
generate_proc_code(PredInfo, ProcInfo, ProcId, PredId, ModuleInfo,
- GlobalData0, GlobalData, CellCounter0, CellCounter, Proc) :-
+ GlobalData0, GlobalData, Proc) :-
proc_info_interface_determinism(ProcInfo, Detism),
proc_info_interface_code_model(ProcInfo, CodeModel),
proc_info_goal(ProcInfo, Goal),
@@ -293,15 +275,14 @@
% needed for model_non procedures only if we are doing
% execution tracing.
code_info__init(SaveSuccip, Globals, PredId, ProcId, PredInfo,
- ProcInfo, FollowVars, ModuleInfo, CellCounter0,
- OutsideResumePoint, TraceSlotInfo, CodeInfo0),
+ ProcInfo, FollowVars, ModuleInfo, OutsideResumePoint,
+ TraceSlotInfo, CodeInfo0),
% Generate code for the procedure.
generate_category_code(CodeModel, Goal, OutsideResumePoint,
TraceSlotInfo, CodeTree, MaybeTraceCallLabel, FrameInfo,
CodeInfo0, CodeInfo),
code_info__get_max_reg_in_use_at_trace(MaxTraceReg, CodeInfo, _),
- code_info__get_cell_counter(CellCounter, CodeInfo, _),
globals__get_trace_level(Globals, TraceLevel),
code_info__get_created_temp_frame(CreatedTempFrame, CodeInfo, _),
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.274
diff -u -b -r1.274 code_info.m
--- compiler/code_info.m 16 Mar 2003 08:01:26 -0000 1.274
+++ compiler/code_info.m 1 May 2003 21:36:11 -0000
@@ -89,7 +89,7 @@
% stack slots used for tracing purposes.
:- pred code_info__init(bool::in, globals::in, pred_id::in, proc_id::in,
pred_info::in, proc_info::in, follow_vars::in, module_info::in,
- counter::in, resume_point_info::out, trace_slot_info::out,
+ resume_point_info::out, trace_slot_info::out,
code_info::out) is det.
% Get the globals table.
@@ -146,15 +146,6 @@
:- pred code_info__get_label_counter(counter::out,
code_info::in, code_info::out) is det.
- % The current value of the counter we use to give
- % each "create" rval its unique cell number, for use
- % in case the cell can be allocated statically.
-:- pred code_info__get_cell_counter(counter::out,
- code_info::in, code_info::out) is det.
-
-:- pred code_info__set_cell_counter(counter::in,
- code_info::in, code_info::out) is det.
-
% Get the flag that indicates whether succip is used or not.
:- pred code_info__get_succip_used(bool::out,
code_info::in, code_info::out) is det.
@@ -338,8 +329,6 @@
label_num_src :: counter,
% Counter for the local labels used
% by this procedure.
- cell_num_src :: counter,
- % Counter for cells in this proc.
store_succip :: bool,
% do we need to store succip?
label_info :: map(label, internal_layout_info),
@@ -387,8 +376,8 @@
%---------------------------------------------------------------------------%
code_info__init(SaveSuccip, Globals, PredId, ProcId, PredInfo, ProcInfo,
- FollowVars, ModuleInfo, CellCounter, ResumePoint,
- TraceSlotInfo, CodeInfo) :-
+ FollowVars, ModuleInfo, ResumePoint, TraceSlotInfo,
+ CodeInfo) :-
proc_info_get_initial_instmap(ProcInfo, ModuleInfo, InstMap),
proc_info_liveness_info(ProcInfo, Liveness),
proc_info_interface_code_model(ProcInfo, CodeModel),
@@ -464,7 +453,6 @@
),
code_info_persistent(
counter__init(1),
- CellCounter,
SaveSuccip,
LayoutMap,
0,
@@ -515,7 +503,6 @@
code_info__get_temps_in_use(CI^code_info_loc_dep^temps_in_use, CI, CI).
code_info__get_fail_info(CI^code_info_loc_dep^fail_info, CI, CI).
code_info__get_label_counter(CI^code_info_persistent^label_num_src, CI, CI).
-code_info__get_cell_counter(CI^code_info_persistent^cell_num_src, CI, CI).
code_info__get_succip_used(CI^code_info_persistent^store_succip, CI, CI).
code_info__get_layout_info(CI^code_info_persistent^label_info, CI, CI).
code_info__get_max_temp_slot_count(CI^code_info_persistent^stackslot_max,
@@ -544,8 +531,6 @@
code_info__set_fail_info(FI, CI, CI^code_info_loc_dep^fail_info := FI).
code_info__set_label_counter(LC, CI,
CI^code_info_persistent^label_num_src := LC).
-code_info__set_cell_counter(CC, CI,
- CI^code_info_persistent^cell_num_src := CC).
code_info__set_succip_used(SU, CI, CI^code_info_persistent^store_succip := SU).
code_info__set_layout_info(LI, CI, CI^code_info_persistent^label_info := LI).
code_info__set_max_temp_slot_count(TM, CI,
@@ -671,10 +656,6 @@
:- pred code_info__get_next_label(label, code_info, code_info).
:- mode code_info__get_next_label(out, in, out) is det.
- % Generate the next cell number in sequence.
-:- pred code_info__get_next_cell_number(int, code_info, code_info).
-:- mode code_info__get_next_cell_number(out, in, out) is det.
-
% Note that the succip slot is used, and thus cannot be
% optimized away.
:- pred code_info__succip_is_used(code_info, code_info).
@@ -900,11 +881,6 @@
{ code_util__make_internal_label(ModuleInfo, PredId, ProcId, N,
Label) }.
-code_info__get_next_cell_number(N) -->
- code_info__get_cell_counter(C0),
- { counter__allocate(N, C0, C) },
- code_info__set_cell_counter(C).
-
code_info__succip_is_used -->
code_info__set_succip_used(yes).
@@ -3373,21 +3349,20 @@
code_info__assign_cell_to_var(Var, Ptag, Vector, TypeMsg, Code) -->
code_info__get_var_locns_info(VarInfo0),
- code_info__get_next_cell_number(CellNum),
{
VarInfo0 = exprn_info(Exprn0),
% XXX Later we will need to worry about
% whether the cell must be unique or not.
Reuse = no,
Rval = create(Ptag, Vector, uniform(no), can_be_either,
- CellNum, TypeMsg, Reuse),
+ TypeMsg, Reuse),
code_exprn__cache_exprn(Var, Rval, Exprn0, Exprn),
VarInfo = exprn_info(Exprn),
Code = empty
;
VarInfo0 = var_locn_info(VarLocInfo0),
- var_locn__assign_cell_to_var(Var, Ptag, Vector, CellNum,
- TypeMsg, Code, VarLocInfo0, VarLocInfo),
+ var_locn__assign_cell_to_var(Var, Ptag, Vector, TypeMsg,
+ Code, VarLocInfo0, VarLocInfo),
VarInfo = var_locn_info(VarLocInfo)
},
code_info__set_var_locns_info(VarInfo).
Index: compiler/code_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/code_util.m,v
retrieving revision 1.144
diff -u -b -r1.144 code_util.m
--- compiler/code_util.m 15 Mar 2003 07:11:55 -0000 1.144
+++ compiler/code_util.m 1 May 2003 21:18:58 -0000
@@ -393,7 +393,7 @@
code_util__lvals_in_rval(lval(Lval), [Lval | Lvals]) :-
code_util__lvals_in_lval(Lval, Lvals).
code_util__lvals_in_rval(var(_), []).
-code_util__lvals_in_rval(create(_, _, _, _, _, _, _), []).
+code_util__lvals_in_rval(create(_, _, _, _, _, _), []).
code_util__lvals_in_rval(mkword(_, Rval), Lvals) :-
code_util__lvals_in_rval(Rval, Lvals).
code_util__lvals_in_rval(const(_), []).
Index: compiler/dupelim.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/dupelim.m,v
retrieving revision 1.54
diff -u -b -r1.54 dupelim.m
--- compiler/dupelim.m 15 Mar 2003 03:08:45 -0000 1.54
+++ compiler/dupelim.m 1 May 2003 21:19:05 -0000
@@ -477,7 +477,7 @@
Rval1 = var(_),
error("var in standardize_rval")
;
- Rval1 = create(_, _, _, _, _, _, _),
+ Rval1 = create(_, _, _, _, _, _),
Rval = Rval1
;
Rval1 = mkword(_, _),
@@ -809,7 +809,7 @@
Rval1 = var(_),
error("var in most_specific_rval")
;
- Rval1 = create(_, _, _, _, _, _, _),
+ Rval1 = create(_, _, _, _, _, _),
Rval2 = Rval1,
Rval = Rval1
;
Index: compiler/exprn_aux.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/exprn_aux.m,v
retrieving revision 1.46
diff -u -b -r1.46 exprn_aux.m
--- compiler/exprn_aux.m 18 Mar 2003 02:43:35 -0000 1.46
+++ compiler/exprn_aux.m 1 May 2003 21:19:54 -0000
@@ -179,7 +179,7 @@
exprn_aux__rval_contains_lval(lval(Lval0), Lval) :-
exprn_aux__lval_contains_lval(Lval0, Lval).
-exprn_aux__rval_contains_lval(create(_, Rvals, _, _, _, _, Reuse), Lval) :-
+exprn_aux__rval_contains_lval(create(_, Rvals, _, _, _, Reuse), Lval) :-
exprn_aux__args_contain_lval([Reuse | Rvals], Lval).
exprn_aux__rval_contains_lval(mkword(_, Rval), Lval) :-
exprn_aux__rval_contains_lval(Rval, Lval).
@@ -238,7 +238,7 @@
Rval0 = lval(Lval),
exprn_aux__lval_contains_rval(Lval, Rval)
;
- Rval0 = create(_, Rvals, _, _, _, _, Reuse),
+ Rval0 = create(_, Rvals, _, _, _, Reuse),
exprn_aux__args_contain_rval([Reuse | Rvals], Rval)
;
Rval0 = mkword(_, Rval1),
@@ -280,7 +280,7 @@
exprn_aux__vars_in_rval(lval(Lval), Vars) :-
exprn_aux__vars_in_lval(Lval, Vars).
exprn_aux__vars_in_rval(var(Var), [Var]).
-exprn_aux__vars_in_rval(create(_, Rvals, _, _, _, _, Reuse), Vars) :-
+exprn_aux__vars_in_rval(create(_, Rvals, _, _, _, Reuse), Vars) :-
exprn_aux__vars_in_args([Reuse | Rvals], Vars).
exprn_aux__vars_in_rval(mkword(_, Rval), Vars) :-
exprn_aux__vars_in_rval(Rval, Vars).
@@ -599,13 +599,12 @@
Rval = Rval0,
N = N0
;
- Rval0 = create(Tag, Rvals0, ArgTypes, StatDyn,
- Num, Msg, Reuse0),
+ Rval0 = create(Tag, Rvals0, ArgTypes, StatDyn, Msg, Reuse0),
exprn_aux__substitute_lval_in_args(OldLval, NewLval,
Rvals0, Rvals, N0, N1),
exprn_aux__substitute_lval_in_arg(OldLval, NewLval,
Reuse0, Reuse, N1, N),
- Rval = create(Tag, Rvals, ArgTypes, StatDyn, Num, Msg, Reuse)
+ Rval = create(Tag, Rvals, ArgTypes, StatDyn, Msg, Reuse)
;
Rval0 = mkword(Tag, Rval1),
exprn_aux__substitute_lval_in_rval_count(OldLval, NewLval,
@@ -790,13 +789,12 @@
Rval = Rval0
;
Rval0 = create(Tag, Rvals0, ATs, StatDyn,
- Num, Msg, Reuse0),
+ Msg, Reuse0),
exprn_aux__substitute_rval_in_args(OldRval, NewRval,
Rvals0, Rvals),
exprn_aux__substitute_rval_in_arg(OldRval, NewRval,
Reuse0, Reuse),
- Rval = create(Tag, Rvals, ATs, StatDyn,
- Num, Msg, Reuse)
+ Rval = create(Tag, Rvals, ATs, StatDyn, Msg, Reuse)
;
Rval0 = mkword(Tag, Rval1),
exprn_aux__substitute_rval_in_rval(OldRval, NewRval,
@@ -992,7 +990,7 @@
exprn_aux__simplify_rval_2(Rval0, Rval) :-
(
Rval0 = lval(field(MaybeTag, Base, Field)),
- Base = create(Tag, Args, _, _, _, _, _),
+ Base = create(Tag, Args, _, _, _, _),
(
MaybeTag = yes(Tag)
;
@@ -1007,15 +1005,14 @@
->
Rval = lval(field(MaybeTag, Rval2, Num))
;
- Rval0 = create(Tag, Args0, ArgTypes, StatDyn,
- CNum, Msg, Reuse0),
+ Rval0 = create(Tag, Args0, ArgTypes, StatDyn, Msg, Reuse0),
exprn_aux__simplify_args(Args0, Args),
exprn_aux__simplify_arg(Reuse0, Reuse),
( Args \= Args0
; Reuse \= Reuse0
)
->
- Rval = create(Tag, Args, ArgTypes, StatDyn, CNum, Msg, Reuse)
+ Rval = create(Tag, Args, ArgTypes, StatDyn, Msg, Reuse)
;
Rval0 = unop(UnOp, Rval1),
exprn_aux__simplify_rval_2(Rval1, Rval2)
@@ -1063,7 +1060,7 @@
exprn_aux__rval_addrs(lval(Lval), CodeAddrs, DataAddrs) :-
exprn_aux__lval_addrs(Lval, CodeAddrs, DataAddrs).
exprn_aux__rval_addrs(var(_Var), [], []).
-exprn_aux__rval_addrs(create(_, MaybeRvals, _, _, _, _, Reuse),
+exprn_aux__rval_addrs(create(_, MaybeRvals, _, _, _, Reuse),
CodeAddrs, DataAddrs) :-
exprn_aux__maybe_rval_list_addrs([Reuse | MaybeRvals],
CodeAddrs, DataAddrs).
Index: compiler/hlds_module.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/hlds_module.m,v
retrieving revision 1.84
diff -u -b -r1.84 hlds_module.m
--- compiler/hlds_module.m 28 Apr 2003 11:56:47 -0000 1.84
+++ compiler/hlds_module.m 1 May 2003 21:09:03 -0000
@@ -32,7 +32,7 @@
:- import_module parse_tree__prog_data.
:- import_module recompilation.
-:- import_module relation, map, std_util, list, set, multi_map, counter.
+:- import_module relation, map, std_util, list, set, multi_map.
:- implementation.
@@ -222,14 +222,6 @@
ctor_field_table, module_info).
:- mode module_info_set_ctor_field_table(in, in, out) is det.
- % The cell count is used as a unique cell number for
- % constants in the generated C code.
-:- pred module_info_get_cell_counter(module_info, counter).
-:- mode module_info_get_cell_counter(in, out) is det.
-
-:- pred module_info_set_cell_counter(module_info, counter, module_info).
-:- mode module_info_set_cell_counter(in, in, out) is det.
-
:- pred module_info_get_maybe_recompilation_info(module_info,
maybe(recompilation_info)).
:- mode module_info_get_maybe_recompilation_info(in, out) is det.
@@ -539,12 +531,6 @@
assertion_table :: assertion_table,
exclusive_table :: exclusive_table,
ctor_field_table :: ctor_field_table,
- cell_counter :: counter,
- % cell count, passed into code_info
- % and used to generate unique label
- % numbers for constant terms in the
- % generated C code
-
maybe_recompilation_info :: maybe(recompilation_info)
).
@@ -646,7 +632,7 @@
ModuleInfo = module(ModuleSubInfo, PredicateTable, Requests,
UnifyPredMap, QualifierInfo, Types, Insts, Modes, Ctors,
ClassTable, SuperClassTable, InstanceTable, AssertionTable,
- ExclusiveTable, FieldNameTable, counter__init(1), RecompInfo).
+ ExclusiveTable, FieldNameTable, RecompInfo).
%-----------------------------------------------------------------------------%
@@ -666,7 +652,6 @@
module_info_assertion_table(MI, MI ^ assertion_table).
module_info_exclusive_table(MI, MI ^ exclusive_table).
module_info_ctor_field_table(MI, MI ^ ctor_field_table).
-module_info_get_cell_counter(MI, MI ^ cell_counter).
module_info_get_maybe_recompilation_info(MI, MI ^ maybe_recompilation_info).
%-----------------------------------------------------------------------------%
@@ -688,7 +673,6 @@
module_info_set_assertion_table(MI, A, MI ^ assertion_table := A).
module_info_set_exclusive_table(MI, PXT, MI ^ exclusive_table := PXT).
module_info_set_ctor_field_table(MI, CF, MI ^ ctor_field_table := CF).
-module_info_set_cell_counter(MI, CC, MI ^ cell_counter := CC).
module_info_set_maybe_recompilation_info(MI, I,
MI ^ maybe_recompilation_info := I).
Index: compiler/jumpopt.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/jumpopt.m,v
retrieving revision 1.64
diff -u -b -r1.64 jumpopt.m
--- compiler/jumpopt.m 15 Mar 2003 03:08:54 -0000 1.64
+++ compiler/jumpopt.m 1 May 2003 21:20:03 -0000
@@ -793,9 +793,9 @@
jumpopt__short_labels_rval(var(_), _, _) :-
error("var rval in jumpopt__short_labels_rval").
jumpopt__short_labels_rval(
- create(Tag, Rvals0, ArgTypes, StatDyn, Cell, Type, Reuse0),
+ create(Tag, Rvals0, ArgTypes, StatDyn, Type, Reuse0),
Instrmap,
- create(Tag, Rvals, ArgTypes, StatDyn, Cell, Type, Reuse)) :-
+ create(Tag, Rvals, ArgTypes, StatDyn, Type, Reuse)) :-
jumpopt__short_labels_maybe_rvals(Rvals0, Instrmap, Rvals),
jumpopt__short_labels_maybe_rval(Reuse0, Instrmap, Reuse).
jumpopt__short_labels_rval(mkword(Tag, Rval0), Instrmap,
Index: compiler/livemap.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/livemap.m,v
retrieving revision 1.55
diff -u -b -r1.55 livemap.m
--- compiler/livemap.m 18 Mar 2003 02:43:37 -0000 1.55
+++ compiler/livemap.m 1 May 2003 21:20:07 -0000
@@ -496,7 +496,7 @@
),
opt_util__lval_access_rvals(Lval, AccessRvals),
livemap__make_live_in_rvals(AccessRvals, Live1, Live).
-livemap__make_live_in_rval(create(_, _, _, _, _, _, _), Live, Live).
+livemap__make_live_in_rval(create(_, _, _, _, _, _), Live, Live).
% All terms inside creates in the optimizer must be static.
livemap__make_live_in_rval(mkword(_, Rval), Live0, Live) :-
livemap__make_live_in_rval(Rval, Live0, Live).
Index: compiler/ll_pseudo_type_info.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/ll_pseudo_type_info.m,v
retrieving revision 1.7
diff -u -b -r1.7 ll_pseudo_type_info.m
--- compiler/ll_pseudo_type_info.m 15 Mar 2003 03:08:55 -0000 1.7
+++ compiler/ll_pseudo_type_info.m 1 May 2003 21:36:44 -0000
@@ -26,10 +26,8 @@
:- import_module ll_backend__llds.
:- import_module parse_tree__prog_data.
-:- import_module counter.
-
% ll_pseudo_type_info__construct_typed_pseudo_type_info(Type,
- % NumUnivQTvars, ExistQVars, Rval, LldsType, LabelNum0, LabelNum)
+ % NumUnivQTvars, ExistQVars, Rval, LldsType)
%
% Given a Mercury type (`Type'), this predicate returns an rval
% (`Rval') giving the pseudo type info for that type, plus the
@@ -41,20 +39,15 @@
% or is the special value -1, meaning that all variables in the type
% are universally quantified. ExistQVars is the list of existentially
% quantified type variables of the constructor in question.
- %
- % The int arguments (`LabelNum0' and `LabelNum') are label numbers for
- % generating `create' rvals with.
:- pred ll_pseudo_type_info__construct_typed_llds_pseudo_type_info((type)::in,
- int::in, existq_tvars::in, rval::out, llds_type::out,
- counter::in, counter::out) is det.
+ int::in, existq_tvars::in, rval::out, llds_type::out) is det.
% This is the same as the previous predicate, but does not return
% the LLDS type.
:- pred ll_pseudo_type_info__construct_llds_pseudo_type_info((type)::in,
- int::in, existq_tvars::in, rval::out, counter::in, counter::out)
- is det.
+ int::in, existq_tvars::in, rval::out) is det.
%-----------------------------------------------------------------------------%
@@ -66,106 +59,100 @@
:- import_module std_util, list, bool, int.
ll_pseudo_type_info__construct_llds_pseudo_type_info(Type, NumUnivQTvars,
- ExistQTvars, Pseudo, C0, C) :-
+ ExistQTvars, Pseudo) :-
ll_pseudo_type_info__construct_typed_llds_pseudo_type_info(Type,
- NumUnivQTvars, ExistQTvars, Pseudo, _LldsType, C0, C).
+ NumUnivQTvars, ExistQTvars, Pseudo, _LldsType).
ll_pseudo_type_info__construct_typed_llds_pseudo_type_info(Type, NumUnivQTvars,
- ExistQTvars, PseudoRval, LldsType, C0, C) :-
+ ExistQTvars, PseudoRval, LldsType) :-
pseudo_type_info__construct_pseudo_type_info(Type, NumUnivQTvars,
ExistQTvars, Pseudo),
- convert_pseudo_type_info(Pseudo, PseudoRval, LldsType, C0, C).
+ convert_pseudo_type_info(Pseudo, PseudoRval, LldsType).
:- pred convert_pseudo_type_info(rtti_pseudo_type_info::in,
- rval::out, llds_type::out, counter::in, counter::out) is det.
+ rval::out, llds_type::out) is det.
-convert_pseudo_type_info(Pseudo, Rval, LldsType, C0, C) :-
+convert_pseudo_type_info(Pseudo, Rval, LldsType) :-
(
Pseudo = type_var(Int),
Rval = const(int_const(Int)),
- LldsType = integer,
- C = C0
+ LldsType = integer
;
Pseudo = plain_arity_zero_pseudo_type_info(RttiTypeCtor),
DataAddr = rtti_addr(RttiTypeCtor, pseudo_type_info(Pseudo)),
Rval = const(data_addr_const(DataAddr)),
- LldsType = data_ptr,
- C = C0
+ LldsType = data_ptr
;
Pseudo = plain_pseudo_type_info(RttiTypeCtor, Args),
convert_compound_pseudo_type_info(RttiTypeCtor, [], Args,
- Rval, LldsType, C0, C)
+ Rval, LldsType)
;
Pseudo = var_arity_pseudo_type_info(VarArityId, Args),
list__length(Args, Arity),
ArityArg = yes(const(int_const(Arity))),
RttiTypeCtor = var_arity_id_to_rtti_type_ctor(VarArityId),
convert_compound_pseudo_type_info(RttiTypeCtor, [ArityArg],
- Args, Rval, LldsType, C0, C)
+ Args, Rval, LldsType)
).
:- pred convert_plain_type_info(rtti_type_info::in,
- rval::out, llds_type::out, counter::in, counter::out) is det.
+ rval::out, llds_type::out) is det.
-convert_plain_type_info(TypeInfo, Rval, LldsType, C0, C) :-
+convert_plain_type_info(TypeInfo, Rval, LldsType) :-
(
TypeInfo = plain_arity_zero_type_info(RttiTypeCtor),
DataAddr = rtti_addr(RttiTypeCtor, type_info(TypeInfo)),
Rval = const(data_addr_const(DataAddr)),
- LldsType = data_ptr,
- C = C0
+ LldsType = data_ptr
;
TypeInfo = plain_type_info(RttiTypeCtor, Args),
convert_compound_type_info(RttiTypeCtor, [], Args,
- Rval, LldsType, C0, C)
+ Rval, LldsType)
;
TypeInfo = var_arity_type_info(VarArityId, Args),
list__length(Args, Arity),
ArityArg = yes(const(int_const(Arity))),
RttiTypeCtor = var_arity_id_to_rtti_type_ctor(VarArityId),
convert_compound_type_info(RttiTypeCtor, [ArityArg],
- Args, Rval, LldsType, C0, C)
+ Args, Rval, LldsType)
).
:- pred convert_compound_pseudo_type_info(rtti_type_ctor::in,
list(maybe(rval))::in, list(rtti_maybe_pseudo_type_info)::in,
- rval::out, llds_type::out, counter::in, counter::out) is det.
+ rval::out, llds_type::out) is det.
convert_compound_pseudo_type_info(RttiTypeCtor, ArgRvals0, Args,
- Rval, LldsType, C0, C) :-
+ Rval, LldsType) :-
TypeCtorInfoDataAddr = rtti_addr(RttiTypeCtor, type_ctor_info),
TypeCtorInfoRval = yes(const(data_addr_const(TypeCtorInfoDataAddr))),
LldsType = data_ptr,
- counter__allocate(CNum, C0, C1),
- list__map_foldl((pred(A::in, yes(AR)::out, CS0::in, CS::out) is det :-
+ list__map((pred(A::in, yes(AR)::out) is det :-
(
A = pseudo(PTI),
- convert_pseudo_type_info(PTI, AR, _LldsType, CS0, CS)
+ convert_pseudo_type_info(PTI, AR, _LldsType)
;
A = plain(TI),
- convert_plain_type_info(TI, AR, _LldsType, CS0, CS)
+ convert_plain_type_info(TI, AR, _LldsType)
)
- ), Args, ArgRvals1, C1, C),
+ ), Args, ArgRvals1),
list__append(ArgRvals0, ArgRvals1, ArgRvals),
Reuse = no,
Rval = create(0, [TypeCtorInfoRval | ArgRvals],
- uniform(no), must_be_static, CNum, "type_info", Reuse).
+ uniform(no), must_be_static, "type_info", Reuse).
:- pred convert_compound_type_info(rtti_type_ctor::in, list(maybe(rval))::in,
- list(rtti_type_info)::in, rval::out, llds_type::out,
- counter::in, counter::out) is det.
+ list(rtti_type_info)::in, rval::out, llds_type::out) is det.
-convert_compound_type_info(RttiTypeCtor, ArgRvals0, Args,
- Rval, LldsType, C0, C) :-
- TypeCtorInfoData = type_info(plain_arity_zero_type_info(RttiTypeCtor)),
+convert_compound_type_info(RttiTypeCtor, ArgRvals0, Args, Rval, LldsType) :-
+ TypeCtorInfoData =
+ type_info(plain_arity_zero_type_info(RttiTypeCtor)),
TypeCtorInfoDataAddr = rtti_addr(RttiTypeCtor, TypeCtorInfoData),
TypeCtorInfoRval = yes(const(data_addr_const(TypeCtorInfoDataAddr))),
LldsType = data_ptr,
- counter__allocate(CNum, C0, C1),
- list__map_foldl((pred(A::in, yes(AR)::out, CS0::in, CS::out) is det :-
- convert_plain_type_info(A, AR, _LldsType, CS0, CS)
- ), Args, ArgRvals1, C1, C),
+ list__map((pred(A::in, yes(AR)::out) is det :-
+ convert_plain_type_info(A, AR, _LldsType)
+ ), Args, ArgRvals1),
list__append(ArgRvals0, ArgRvals1, ArgRvals),
Reuse = no,
Rval = create(0, [TypeCtorInfoRval | ArgRvals],
- uniform(no), must_be_static, CNum, "type_info", Reuse).
+ uniform(no), must_be_static, "type_info", Reuse).
Index: compiler/llds.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds.m,v
retrieving revision 1.292
diff -u -b -r1.292 llds.m
--- compiler/llds.m 30 Apr 2003 18:15:44 -0000 1.292
+++ compiler/llds.m 1 May 2003 21:22:48 -0000
@@ -765,9 +765,9 @@
% stage after code generation.
; create(tag, list(maybe(rval)), create_arg_types,
- static_or_dynamic, int, string, maybe(rval))
+ static_or_dynamic, string, maybe(rval))
% create(Tag, Arguments, MaybeArgTypes, StaticOrDynamic,
- % LabelNumber, CellKind, CellToReuse):
+ % CellKind, CellToReuse):
% A `create' instruction is used during code generation
% for creating a term, either on the heap or
% (if the term is constant) as a static constant.
@@ -790,10 +790,6 @@
% statically unless all of its components are statically
% allocated as well).
%
- % The label number is needed for the case when
- % we can construct the term at compile-time
- % and just reference the label.
- %
% The string argument gives the name of the type constructor
% of the function symbol of which this is a cell, for use
% in memory profiling.
@@ -1061,7 +1057,7 @@
llds__lval_type(Lval, Type).
llds__rval_type(var(_), _) :-
error("var unexpected in llds__rval_type").
-llds__rval_type(create(_, _, _, _, _, _, _), data_ptr).
+llds__rval_type(create(_, _, _, _, _, _), data_ptr).
%
% Note that create and mkword must both be of type data_ptr,
% not of type word, to ensure that static consts containing
Index: compiler/llds_common.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_common.m,v
retrieving revision 1.49
diff -u -b -r1.49 llds_common.m
--- compiler/llds_common.m 1 May 2003 06:08:11 -0000 1.49
+++ compiler/llds_common.m 1 May 2003 21:22:56 -0000
@@ -531,8 +531,7 @@
Rval0 = var(_),
error("var rval found in llds_common__process_rval")
;
- Rval0 = create(Tag, Args, ArgTypes, StatDyn,
- _LabelNo, _Msg, _Reuse),
+ Rval0 = create(Tag, Args, ArgTypes, StatDyn, _Msg, _Reuse),
( StatDyn \= must_be_dynamic ->
llds_common__process_create(Tag, Args, ArgTypes, Rval,
Info0, Info)
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.210
diff -u -b -r1.210 llds_out.m
--- compiler/llds_out.m 30 Apr 2003 18:15:44 -0000 1.210
+++ compiler/llds_out.m 1 May 2003 21:23:04 -0000
@@ -2194,7 +2194,7 @@
{ N = N2 },
{ DeclSet = DeclSet2 }
).
-output_rval_decls(create(_, _, _, _, _, _, _), _, _, _, _, _, _) -->
+output_rval_decls(create(_, _, _, _, _, _), _, _, _, _, _, _) -->
% These should have all been converted to data_addrs by llds_common.
{ error("output_rval_decls: create") }.
output_rval_decls(mem_addr(MemRef), FirstIndent, LaterIndent,
@@ -3418,7 +3418,7 @@
;
output_lval(Lval)
).
-output_rval(create(_, _, _, _, _, _, _)) -->
+output_rval(create(_, _, _, _, _, _)) -->
% These should have all been converted to data_addrs by llds_common.
{ error("output_rval: create") }.
output_rval(var(_)) -->
Index: compiler/lookup_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/lookup_switch.m,v
retrieving revision 1.45
diff -u -b -r1.45 lookup_switch.m
--- compiler/lookup_switch.m 15 Mar 2003 03:08:56 -0000 1.45
+++ compiler/lookup_switch.m 1 May 2003 21:24:51 -0000
@@ -269,7 +269,7 @@
lookup_switch__rval_is_constant(Exprn1, ExprnOpts).
lookup_switch__rval_is_constant(mkword(_, Exprn0), ExprnOpts) :-
lookup_switch__rval_is_constant(Exprn0, ExprnOpts).
-lookup_switch__rval_is_constant(create(_, Args, _, StatDyn, _, _, _),
+lookup_switch__rval_is_constant(create(_, Args, _, StatDyn, _, _),
ExprnOpts) :-
(
StatDyn = must_be_static
@@ -362,7 +362,7 @@
lookup_switch__generate_bitvec_test(Index, CaseVals, Start, _End,
CheckCode) -->
lookup_switch__get_word_bits(WordBits, Log2WordBits),
- generate_bit_vec(CaseVals, Start, WordBits, BitVec),
+ { generate_bit_vec(CaseVals, Start, WordBits, BitVec) },
%
% Optimize the single-word case:
@@ -373,7 +373,7 @@
% low bits specify which bit.
%
{
- BitVec = create(_, [yes(SingleWord)], _, _, _, _, _)
+ BitVec = create(_, [yes(SingleWord)], _, _, _, _)
->
Word = SingleWord,
BitNum = Index
@@ -419,22 +419,20 @@
log2_rounded_down(X) = Log :-
int__log2(X + 1, Log + 1). % int__log2 rounds up
-:- pred generate_bit_vec(case_consts::in, int::in, int::in, rval::out,
- code_info::in, code_info::out) is det.
+:- pred generate_bit_vec(case_consts::in, int::in, int::in, rval::out) is det.
% we generate the bitvector by iterating through the cases
% marking the bit for each case. (We represent the bitvector
% here as a map from the word number in the vector to the bits
% for that word.
-generate_bit_vec(CaseVals, Start, WordBits, BitVec) -->
- { map__init(Empty) },
- { generate_bit_vec_2(CaseVals, Start, WordBits, Empty, BitMap) },
- { map__to_assoc_list(BitMap, WordVals) },
- { generate_bit_vec_args(WordVals, 0, Args) },
- code_info__get_next_cell_number(CellNo),
- { Reuse = no },
- { BitVec = create(0, Args, uniform(no), must_be_static,
- CellNo, "lookup_switch_bit_vector", Reuse) }.
+generate_bit_vec(CaseVals, Start, WordBits, BitVec) :-
+ map__init(Empty),
+ generate_bit_vec_2(CaseVals, Start, WordBits, Empty, BitMap),
+ map__to_assoc_list(BitMap, WordVals),
+ generate_bit_vec_args(WordVals, 0, Args),
+ Reuse = no,
+ BitVec = create(0, Args, uniform(no), must_be_static,
+ "lookup_switch_bit_vector", Reuse).
:- pred generate_bit_vec_2(case_consts::in, int::in, int::in,
map(int, int)::in, map(int, int)::out) is det.
@@ -496,10 +494,9 @@
{ map__lookup(Map, Var, Vals0) },
{ list__sort(Vals0, Vals) },
{ construct_args(Vals, 0, Args) },
- code_info__get_next_cell_number(CellNo),
{ Reuse = no },
{ ArrayTerm = create(0, Args, uniform(no), must_be_static,
- CellNo, "lookup_switch_data", Reuse) },
+ "lookup_switch_data", Reuse) },
{ LookupLval = field(yes(0), ArrayTerm, Index) },
code_info__assign_lval_to_var(Var, LookupLval, Code),
{ require(tree__is_empty(Code),
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.284
diff -u -b -r1.284 mercury_compile.m
--- compiler/mercury_compile.m 30 Apr 2003 18:15:45 -0000 1.284
+++ compiler/mercury_compile.m 1 May 2003 21:50:36 -0000
@@ -2264,7 +2264,7 @@
:- mode mercury_compile__backend_pass_by_phases(in, out, in, out, out, di, uo)
is det.
-mercury_compile__backend_pass_by_phases(HLDS51, HLDS99,
+mercury_compile__backend_pass_by_phases(HLDS51, HLDS90,
GlobalData0, GlobalData, LLDS) -->
globals__io_lookup_bool_option(verbose, Verbose),
globals__io_lookup_bool_option(statistics, Stats),
@@ -2291,19 +2291,13 @@
mercury_compile__allocate_store_map(HLDS65, Verbose, Stats, HLDS68),
mercury_compile__maybe_dump_hlds(HLDS68, "68", "store_map"),
- mercury_compile__maybe_goal_paths(HLDS68, Verbose, Stats, HLDS72),
- mercury_compile__maybe_dump_hlds(HLDS72, "72", "goal_path"),
-
- maybe_report_sizes(HLDS72),
-
- { HLDS90 = HLDS72 },
+ mercury_compile__maybe_goal_paths(HLDS68, Verbose, Stats, HLDS90),
mercury_compile__maybe_dump_hlds(HLDS90, "90", "precodegen"),
mercury_compile__generate_code(HLDS90, GlobalData0, Verbose, Stats,
- HLDS99, GlobalData1, LLDS1),
- mercury_compile__maybe_dump_hlds(HLDS99, "99", "codegen"),
+ GlobalData1, LLDS1),
- mercury_compile__maybe_generate_stack_layouts(HLDS99, GlobalData1,
+ mercury_compile__maybe_generate_stack_layouts(HLDS90, GlobalData1,
LLDS1, Verbose, Stats, GlobalData),
% mercury_compile__maybe_dump_global_data(GlobalData),
@@ -2490,10 +2484,8 @@
write_proc_progress_message(
"% Generating low-level (LLDS) code for ",
PredId, ProcId, ModuleInfoSimplify),
- { module_info_get_cell_counter(ModuleInfoSimplify, CellCounter0) },
{ generate_proc_code(PredInfo, ProcInfo, ProcId, PredId,
- ModuleInfoSimplify, GlobalData0, GlobalData1,
- CellCounter0, CellCounter, ProcCode0) },
+ ModuleInfoSimplify, GlobalData0, GlobalData1, ProcCode0) },
{ globals__lookup_bool_option(Globals, optimize, Optimize) },
(
{ Optimize = yes },
@@ -2508,8 +2500,7 @@
PredId, ProcId, ModuleInfoSimplify),
{ continuation_info__maybe_process_proc_llds(Instructions, PredProcId,
ModuleInfoSimplify, GlobalData1, GlobalData) },
- { module_info_set_cell_counter(ModuleInfoSimplify, CellCounter,
- ModuleInfo) }.
+ { ModuleInfo = ModuleInfoSimplify }.
%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%
@@ -3405,15 +3396,15 @@
).
:- pred mercury_compile__generate_code(module_info, global_data, bool, bool,
- module_info, global_data, list(c_procedure), io__state, io__state).
-:- mode mercury_compile__generate_code(in, in, in, in, out, out, out, di, uo)
+ global_data, list(c_procedure), io__state, io__state).
+:- mode mercury_compile__generate_code(in, in, in, in, out, out, di, uo)
is det.
mercury_compile__generate_code(HLDS0, GlobalData0, Verbose, Stats,
- HLDS, GlobalData, LLDS) -->
+ GlobalData, LLDS) -->
maybe_write_string(Verbose, "% Generating code...\n"),
maybe_flush_output(Verbose),
- generate_code(HLDS0, HLDS, GlobalData0, GlobalData, LLDS),
+ generate_code(HLDS0, GlobalData0, GlobalData, LLDS),
maybe_write_string(Verbose, "% done.\n"),
maybe_report_stats(Stats).
Index: compiler/middle_rec.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/middle_rec.m,v
retrieving revision 1.92
diff -u -b -r1.92 middle_rec.m
--- compiler/middle_rec.m 15 Mar 2003 03:08:58 -0000 1.92
+++ compiler/middle_rec.m 1 May 2003 21:25:38 -0000
@@ -504,7 +504,7 @@
Rval = var(_),
error("var found in middle_rec__find_used_registers_rval")
;
- Rval = create(_, MaybeRvals, _, _, _, _, Reuse),
+ Rval = create(_, MaybeRvals, _, _, _, Reuse),
middle_rec__find_used_registers_maybe_rvals(
[Reuse | MaybeRvals], Used0, Used)
;
Index: compiler/opt_debug.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/opt_debug.m,v
retrieving revision 1.128
diff -u -b -r1.128 opt_debug.m
--- compiler/opt_debug.m 30 Apr 2003 18:15:45 -0000 1.128
+++ compiler/opt_debug.m 1 May 2003 21:25:58 -0000
@@ -267,7 +267,7 @@
opt_debug__dump_rval(const(C), Str) :-
opt_debug__dump_const(C, C_str),
string__append_list(["const(", C_str, ")"], Str).
-opt_debug__dump_rval(create(T, MA, _, U, L, _, _), Str) :-
+opt_debug__dump_rval(create(T, MA, _, U, _, _), Str) :-
string__int_to_string(T, T_str),
opt_debug__dump_maybe_rvals(MA, 3, MA_str),
(
@@ -280,9 +280,8 @@
U = must_be_dynamic,
U_str = "dynamic"
),
- string__int_to_string(L, L_str),
string__append_list(["create(", T_str, ", ", MA_str, ", ",
- U_str, ", ", L_str, ")"], Str).
+ U_str, ")"], Str).
opt_debug__dump_rval(unop(O, N), Str) :-
opt_debug__dump_unop(O, O_str),
opt_debug__dump_rval(N, N_str),
Index: compiler/opt_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/opt_util.m,v
retrieving revision 1.118
diff -u -b -r1.118 opt_util.m
--- compiler/opt_util.m 18 Mar 2003 02:43:40 -0000 1.118
+++ compiler/opt_util.m 1 May 2003 21:26:18 -0000
@@ -687,7 +687,7 @@
opt_util__lval_refers_stackvars(Lval, Refers).
opt_util__rval_refers_stackvars(var(_), _) :-
error("found var in rval_refers_stackvars").
-opt_util__rval_refers_stackvars(create(_, Rvals, _, _, _, _, _), Refers) :-
+opt_util__rval_refers_stackvars(create(_, Rvals, _, _, _, _), Refers) :-
opt_util__rvals_refer_stackvars(Rvals, Refers).
opt_util__rval_refers_stackvars(mkword(_, Rval), Refers) :-
opt_util__rval_refers_stackvars(Rval, Refers).
@@ -1588,7 +1588,7 @@
opt_util__touches_nondet_ctrl_rval(lval(Lval), Touch) :-
opt_util__touches_nondet_ctrl_lval(Lval, Touch).
opt_util__touches_nondet_ctrl_rval(var(_), no).
-opt_util__touches_nondet_ctrl_rval(create(_, _, _, _, _, _, _), no).
+opt_util__touches_nondet_ctrl_rval(create(_, _, _, _, _, _), no).
opt_util__touches_nondet_ctrl_rval(mkword(_, Rval), Touch) :-
opt_util__touches_nondet_ctrl_rval(Rval, Touch).
opt_util__touches_nondet_ctrl_rval(const(_), no).
@@ -1670,7 +1670,7 @@
opt_util__rvals_free_of_lval(Rvals, Forbidden).
opt_util__rval_free_of_lval(var(_), _) :-
error("found var in opt_util__rval_free_of_lval").
-opt_util__rval_free_of_lval(create(_, _, _, _, _, _, _), _).
+opt_util__rval_free_of_lval(create(_, _, _, _, _, _), _).
opt_util__rval_free_of_lval(mkword(_, Rval), Forbidden) :-
opt_util__rval_free_of_lval(Rval, Forbidden).
opt_util__rval_free_of_lval(const(_), _).
@@ -2005,9 +2005,10 @@
opt_util__replace_labels_lval(Lval0, ReplMap, Lval).
opt_util__replace_labels_rval(var(Var), _, var(Var)).
opt_util__replace_labels_rval(
- create(Tag, Rvals, ArgTypes, StatDyn, N, Msg, Reuse), _,
- create(Tag, Rvals, ArgTypes, StatDyn, N, Msg, Reuse)).
-opt_util__replace_labels_rval(mkword(Tag, Rval0), ReplMap, mkword(Tag, Rval)) :-
+ create(Tag, Rvals, ArgTypes, StatDyn, Msg, Reuse), _,
+ create(Tag, Rvals, ArgTypes, StatDyn, Msg, Reuse)).
+opt_util__replace_labels_rval(mkword(Tag, Rval0), ReplMap,
+ mkword(Tag, Rval)) :-
opt_util__replace_labels_rval(Rval0, ReplMap, Rval).
opt_util__replace_labels_rval(const(Const0), ReplMap, const(Const)) :-
opt_util__replace_labels_rval_const(Const0, ReplMap, Const).
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.79
diff -u -b -r1.79 stack_layout.m
--- compiler/stack_layout.m 30 Apr 2003 18:15:45 -0000 1.79
+++ compiler/stack_layout.m 1 May 2003 21:41:12 -0000
@@ -35,7 +35,7 @@
:- import_module ll_backend__llds.
:- import_module parse_tree__prog_data.
-:- import_module std_util, list, map, counter.
+:- import_module std_util, list, map.
:- pred stack_layout__generate_llds(module_info::in, module_info::out,
global_data::in, list(comp_gen_c_data)::out,
@@ -44,8 +44,7 @@
:- pred stack_layout__construct_closure_layout(proc_label::in, int::in,
closure_layout_info::in, proc_label::in, module_name::in,
string::in, int::in, string::in, list(maybe(rval))::out,
- create_arg_types::out, comp_gen_c_data::out,
- counter::in, counter::out) is det.
+ create_arg_types::out, comp_gen_c_data::out) is det.
% Construct a representation of a variable location as a 32-bit
% integer.
@@ -550,10 +549,7 @@
{ prog_rep__represent_proc(HeadVars, Goal, InstMap, VarTypes,
ModuleInfo, ProcRep) },
{ type_to_univ(ProcRep, ProcRepUniv) },
- stack_layout__get_cell_counter(CellCounter0),
- { static_term__term_to_rval(ProcRepUniv, MaybeProcRepRval,
- CellCounter0, CellCounter) },
- stack_layout__set_cell_counter(CellCounter)
+ { static_term__term_to_rval(ProcRepUniv, MaybeProcRepRval) }
),
{
MaybeCallLabel = yes(CallLabelPrime),
@@ -780,25 +776,20 @@
{ stack_layout__sort_livevals(LiveLvals, SortedLiveLvals) },
stack_layout__construct_liveval_arrays(SortedLiveLvals,
EncodedLength, LiveValRval, NamesRval),
- stack_layout__get_cell_counter(C0),
{ stack_layout__construct_tvar_vector(TVarLocnMap,
- TypeParamRval, C0, C) },
- stack_layout__set_cell_counter(C).
+ TypeParamRval) }.
:- pred stack_layout__construct_tvar_vector(map(tvar, set(layout_locn))::in,
- rval::out, counter::in, counter::out) is det.
+ rval::out) is det.
-stack_layout__construct_tvar_vector(TVarLocnMap, TypeParamRval, C0, C) :-
+stack_layout__construct_tvar_vector(TVarLocnMap, TypeParamRval) :-
( map__is_empty(TVarLocnMap) ->
- TypeParamRval = const(int_const(0)),
- C = C0
+ TypeParamRval = const(int_const(0))
;
stack_layout__construct_tvar_rvals(TVarLocnMap,
Vector, VectorTypes),
- counter__allocate(CNum, C0, C),
Reuse = no,
- TypeParamRval = create(0, Vector, VectorTypes,
- must_be_static, CNum,
+ TypeParamRval = create(0, Vector, VectorTypes, must_be_static,
"stack_layout_type_param_locn_vector", Reuse)
).
@@ -984,10 +975,9 @@
{ LocnArgTypes = [IntArrayLength - yes(uint_least32),
ByteArrayLength - yes(uint_least8)] },
{ list__append(AllTypeTypes, LocnArgTypes, ArgTypes) },
- stack_layout__get_next_cell_number(CNum1),
{ Reuse = no },
{ TypeLocnVector = create(0, TypeLocnVectorRvals,
- initial(ArgTypes, none), must_be_static, CNum1,
+ initial(ArgTypes, none), must_be_static,
"stack_layout_locn_vector", Reuse) },
stack_layout__get_trace_stack_layout(TraceStackLayout),
@@ -995,10 +985,9 @@
{ list__foldl(AddRevNums, AllArrayInfo,
[], RevVarNumRvals) },
{ list__reverse(RevVarNumRvals, VarNumRvals) },
- stack_layout__get_next_cell_number(CNum2),
{ NumVector = create(0, VarNumRvals,
uniform(yes(uint_least16)), must_be_static,
- CNum2, "stack_layout_var_num_vector", Reuse) }
+ "stack_layout_var_num_vector", Reuse) }
;
{ NumVector = const(int_const(0)) }
).
@@ -1081,9 +1070,8 @@
% the data structures we build here.
stack_layout__construct_closure_layout(CallerProcLabel, SeqNo,
- ClosureLayoutInfo, ClosureProcLabel,
- ModuleName, FileName, LineNumber, GoalPath,
- Rvals, ArgTypes, Data, C0, C) :-
+ ClosureLayoutInfo, ClosureProcLabel, ModuleName,
+ FileName, LineNumber, GoalPath, Rvals, ArgTypes, Data) :-
DataAddr = layout_addr(
closure_proc_id(CallerProcLabel, SeqNo, ClosureProcLabel)),
Data = layout_data(closure_proc_id_data(CallerProcLabel, SeqNo,
@@ -1092,9 +1080,8 @@
ProcIdType = 1 - yes(data_ptr),
ClosureLayoutInfo = closure_layout_info(ClosureArgs, TVarLocnMap),
stack_layout__construct_closure_arg_rvals(ClosureArgs,
- MaybeClosureArgRvals, ClosureArgTypes, C0, C1),
- stack_layout__construct_tvar_vector(TVarLocnMap, TVarVectorRval,
- C1, C),
+ MaybeClosureArgRvals, ClosureArgTypes),
+ stack_layout__construct_tvar_vector(TVarLocnMap, TVarVectorRval),
MaybeTVarVectorRval = yes(TVarVectorRval),
TVarVectorType = 1 - yes(data_ptr),
Rvals = [MaybeProcIdRval, MaybeTVarVectorRval | MaybeClosureArgRvals],
@@ -1102,13 +1089,12 @@
none).
:- pred stack_layout__construct_closure_arg_rvals(list(closure_arg_info)::in,
- list(maybe(rval))::out, initial_arg_types::out,
- counter::in, counter::out) is det.
+ list(maybe(rval))::out, initial_arg_types::out) is det.
stack_layout__construct_closure_arg_rvals(ClosureArgs, ClosureArgRvals,
- ClosureArgTypes, C0, C) :-
- list__map_foldl(stack_layout__construct_closure_arg_rval,
- ClosureArgs, MaybeArgRvalsTypes, C0, C),
+ ClosureArgTypes) :-
+ list__map(stack_layout__construct_closure_arg_rval,
+ ClosureArgs, MaybeArgRvalsTypes),
assoc_list__keys(MaybeArgRvalsTypes, MaybeArgRvals),
list__map(stack_layout__add_one, MaybeArgRvalsTypes, ArgRvalTypes),
list__length(MaybeArgRvals, Length),
@@ -1116,10 +1102,10 @@
ClosureArgTypes = [1 - yes(integer) | ArgRvalTypes].
:- pred stack_layout__construct_closure_arg_rval(closure_arg_info::in,
- pair(maybe(rval), llds_type)::out, counter::in, counter::out) is det.
+ pair(maybe(rval), llds_type)::out) is det.
stack_layout__construct_closure_arg_rval(ClosureArg,
- yes(ArgRval) - ArgRvalType, C0, C) :-
+ yes(ArgRval) - ArgRvalType) :-
ClosureArg = closure_arg_info(Type, _Inst),
% For a stack layout, we can treat all type variables as
@@ -1131,7 +1117,7 @@
NumUnivQTvars = -1,
ll_pseudo_type_info__construct_typed_llds_pseudo_type_info(Type,
- NumUnivQTvars, ExistQTvars, ArgRval, ArgRvalType, C0, C).
+ NumUnivQTvars, ExistQTvars, ArgRval, ArgRvalType).
:- pred stack_layout__add_one(pair(maybe(rval), llds_type)::in,
pair(int, maybe(llds_type))::out) is det.
@@ -1173,22 +1159,17 @@
PTIVectorRval, TVarVectorRval) -->
{ TableArgInfos = table_arg_infos(Args, TVarSlotMap) },
{ list__length(Args, NumPTIs) },
- stack_layout__get_cell_counter(C0),
- { list__map_foldl(stack_layout__construct_table_arg_pti_rval,
- Args, MaybePTIRvalTypes, C0, C1) },
+ { list__map(stack_layout__construct_table_arg_pti_rval,
+ Args, MaybePTIRvalTypes) },
{ list__map(stack_layout__add_one, MaybePTIRvalTypes, PTITypes) },
{ assoc_list__keys(MaybePTIRvalTypes, MaybePTIRvals) },
{ PTIVectorTypes = initial(PTITypes, none) },
- { counter__allocate(CNum, C1, C2) },
{ Reuse = no },
{ PTIVectorRval = create(0, MaybePTIRvals, PTIVectorTypes,
- must_be_static, CNum,
- "stack_layout_table_ptis", Reuse) },
+ must_be_static, "stack_layout_table_ptis", Reuse) },
{ map__map_values(stack_layout__convert_slot_to_locn_map,
TVarSlotMap, TVarLocnMap) },
- { stack_layout__construct_tvar_vector(TVarLocnMap, TVarVectorRval,
- C2, C) },
- stack_layout__set_cell_counter(C).
+ { stack_layout__construct_tvar_vector(TVarLocnMap, TVarVectorRval) }.
:- pred stack_layout__convert_slot_to_locn_map(tvar::in, table_locn::in,
set(layout_locn)::out) is det.
@@ -1204,16 +1185,15 @@
LvalLocns = set__make_singleton_set(LvalLocn).
:- pred stack_layout__construct_table_arg_pti_rval(
- table_arg_info::in, pair(maybe(rval), llds_type)::out,
- counter::in, counter::out) is det.
+ table_arg_info::in, pair(maybe(rval), llds_type)::out) is det.
stack_layout__construct_table_arg_pti_rval(ClosureArg,
- yes(ArgRval) - ArgRvalType, C0, C) :-
+ yes(ArgRval) - ArgRvalType) :-
ClosureArg = table_arg_info(_, _, Type),
ExistQTvars = [],
NumUnivQTvars = -1,
ll_pseudo_type_info__construct_typed_llds_pseudo_type_info(Type,
- NumUnivQTvars, ExistQTvars, ArgRval, ArgRvalType, C0, C).
+ NumUnivQTvars, ExistQTvars, ArgRval, ArgRvalType).
%---------------------------------------------------------------------------%
@@ -1269,8 +1249,6 @@
{ Rval = const(data_addr_const(DataAddr)) }.
stack_layout__represent_live_value_type(var(_, _, Type, _), Rval, LldsType)
-->
- stack_layout__get_cell_counter(C0),
-
% For a stack layout, we can treat all type variables as
% universally quantified. This is not the argument of a
% constructor, so we do not need to distinguish between type
@@ -1279,9 +1257,7 @@
{ ExistQTvars = [] },
{ NumUnivQTvars = -1 },
{ ll_pseudo_type_info__construct_typed_llds_pseudo_type_info(Type,
- NumUnivQTvars, ExistQTvars,
- Rval, LldsType, C0, C) },
- stack_layout__set_cell_counter(C).
+ NumUnivQTvars, ExistQTvars, Rval, LldsType) }.
%---------------------------------------------------------------------------%
@@ -1627,13 +1603,6 @@
stack_layout__get_module_info(ModuleInfo),
{ module_info_name(ModuleInfo, ModuleName) }.
-:- pred stack_layout__get_cell_counter(counter::out,
- stack_layout_info::in, stack_layout_info::out) is det.
-
-stack_layout__get_cell_counter(CellCounter) -->
- stack_layout__get_module_info(ModuleInfo),
- { module_info_get_cell_counter(ModuleInfo, CellCounter) }.
-
:- pred stack_layout__add_table_data(layout_data::in,
stack_layout_info::in, stack_layout_info::out) is det.
@@ -1671,23 +1640,6 @@
map__det_insert(LabelSet0, Label, layout_addr(LayoutName), LabelSet),
LI = ((LI0 ^ internal_layouts := InternalLayouts)
^ label_set := LabelSet).
-
-:- pred stack_layout__get_next_cell_number(int::out,
- stack_layout_info::in, stack_layout_info::out) is det.
-
-stack_layout__get_next_cell_number(CellNum) -->
- stack_layout__get_cell_counter(CellCounter0),
- { counter__allocate(CellNum, CellCounter0, CellCounter) },
- stack_layout__set_cell_counter(CellCounter).
-
-:- pred stack_layout__set_cell_counter(counter::in,
- stack_layout_info::in, stack_layout_info::out) is det.
-
-stack_layout__set_cell_counter(CellCounter) -->
- stack_layout__get_module_info(ModuleInfo0),
- { module_info_set_cell_counter(ModuleInfo0, CellCounter,
- ModuleInfo) },
- stack_layout__set_module_info(ModuleInfo).
:- pred stack_layout__set_module_info(module_info::in,
stack_layout_info::in, stack_layout_info::out) is det.
Index: compiler/static_term.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/static_term.m,v
retrieving revision 1.4
diff -u -b -r1.4 static_term.m
--- compiler/static_term.m 15 Mar 2003 03:09:10 -0000 1.4
+++ compiler/static_term.m 1 May 2003 21:41:20 -0000
@@ -19,10 +19,9 @@
:- import_module ll_backend__llds.
-:- import_module counter, std_util.
+:- import_module std_util.
-:- pred static_term__term_to_rval(univ::in, maybe(rval)::out,
- counter::in, counter::out) is det.
+:- pred static_term__term_to_rval(univ::in, maybe(rval)::out) is det.
%---------------------------------------------------------------------------%
@@ -32,65 +31,50 @@
:- import_module deconstruct, list, require.
-static_term__term_to_rval(Univ, Rval, CellCounter0, CellCounter) :-
+static_term__term_to_rval(Univ, Rval) :-
( deconstruct__get_functor_info(Univ, FunctorInfo) ->
- static_term__functor_info_to_rval(FunctorInfo, Rval,
- CellCounter0, CellCounter)
+ static_term__functor_info_to_rval(FunctorInfo, Rval)
;
error("static_term__term_to_rval: unexpected kind of term")
).
:- pred static_term__functor_info_to_rval(functor_tag_info::in,
- maybe(rval)::out, counter::in, counter::out) is det.
+ maybe(rval)::out) is det.
-static_term__functor_info_to_rval(FunctorInfo, MaybeRval,
- CellCounter0, CellCounter) :-
+static_term__functor_info_to_rval(FunctorInfo, MaybeRval) :-
(
FunctorInfo = functor_integer(Int),
- MaybeRval = yes(const(int_const(Int))),
- CellCounter = CellCounter0
+ MaybeRval = yes(const(int_const(Int)))
;
FunctorInfo = functor_float(Float),
- MaybeRval = yes(const(float_const(Float))),
- CellCounter = CellCounter0
+ MaybeRval = yes(const(float_const(Float)))
;
FunctorInfo = functor_string(String),
- MaybeRval = yes(const(string_const(String))),
- CellCounter = CellCounter0
+ MaybeRval = yes(const(string_const(String)))
;
FunctorInfo = functor_enum(Enum),
- MaybeRval = yes(const(int_const(Enum))),
- CellCounter = CellCounter0
+ MaybeRval = yes(const(int_const(Enum)))
;
FunctorInfo = functor_local(Ptag, Sectag),
MaybeRval = yes(mkword(Ptag,
- unop(mkbody, const(int_const(Sectag))))),
- CellCounter = CellCounter0
+ unop(mkbody, const(int_const(Sectag)))))
;
FunctorInfo = functor_remote(Ptag, Sectag, Args),
MaybeSectagRval = yes(const(int_const(Sectag))),
- list__map_foldl(static_term__term_to_rval,
- Args, MaybeArgRvals, CellCounter0, CellCounter1),
- counter__allocate(CNum, CellCounter1, CellCounter),
+ list__map(static_term__term_to_rval, Args, MaybeArgRvals),
Reuse = no,
MaybeRval = yes(create(Ptag, [MaybeSectagRval | MaybeArgRvals],
- uniform(no), must_be_static, CNum,
- "static_term", Reuse))
+ uniform(no), must_be_static, "static_term", Reuse))
;
FunctorInfo = functor_unshared(Ptag, Args),
- list__map_foldl(static_term__term_to_rval,
- Args, MaybeArgRvals, CellCounter0, CellCounter1),
- counter__allocate(CNum, CellCounter1, CellCounter),
+ list__map(static_term__term_to_rval, Args, MaybeArgRvals),
Reuse = no,
MaybeRval = yes(create(Ptag, MaybeArgRvals,
- uniform(no), must_be_static, CNum,
- "static_term", Reuse))
+ uniform(no), must_be_static, "static_term", Reuse))
;
FunctorInfo = functor_notag(Univ),
- static_term__term_to_rval(Univ, MaybeRval,
- CellCounter0, CellCounter)
+ static_term__term_to_rval(Univ, MaybeRval)
;
FunctorInfo = functor_equiv(Univ),
- static_term__term_to_rval(Univ, MaybeRval,
- CellCounter0, CellCounter)
+ static_term__term_to_rval(Univ, MaybeRval)
).
Index: compiler/string_switch.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/string_switch.m,v
retrieving revision 1.41
diff -u -b -r1.41 string_switch.m
--- compiler/string_switch.m 15 Mar 2003 03:09:10 -0000 1.41
+++ compiler/string_switch.m 1 May 2003 21:30:05 -0000
@@ -52,13 +52,11 @@
code_info__get_next_label(LoopLabel),
code_info__get_next_label(FailLabel),
code_info__get_next_label(JumpLabel),
- code_info__get_next_cell_number(NextSlotsTableNo),
- code_info__get_next_cell_number(StringTableNo),
{
% Determine how big to make the hash table.
- % Currently we round the number of cases up to the nearest power
- % of two, and then double it. This should hopefully ensure that
- % we don't get too many hash collisions.
+ % Currently we round the number of cases up to the nearest
+ % power of two, and then double it. This should hopefully
+ % ensure that we don't get too many hash collisions.
%
list__length(Cases, NumCases),
int__log2(NumCases, LogNumCases),
@@ -99,10 +97,10 @@
{
Reuse = no,
NextSlotsTable = create(0, NextSlots, uniform(no),
- must_be_static, NextSlotsTableNo,
+ must_be_static,
"string_switch_next_slots_table", Reuse),
StringTable = create(0, Strings, uniform(no),
- must_be_static, StringTableNo,
+ must_be_static,
"string_switch_string_table", Reuse),
HashLookupCode = node([
comment("hashed string switch") -
Index: compiler/unify_gen.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/unify_gen.m,v
retrieving revision 1.125
diff -u -b -r1.125 unify_gen.m
--- compiler/unify_gen.m 16 Mar 2003 08:01:31 -0000 1.125
+++ compiler/unify_gen.m 1 May 2003 21:39:28 -0000
@@ -634,11 +634,9 @@
yes(const(string_const(RLProcNameStr))),
yes(const(string_const(InputSchemaStr)))
] },
- code_info__get_next_cell_number(AditiCallCellNo),
{ Reuse = no },
{ AddrConst = create(0, AditiCallArgs, uniform(no),
- must_be_static, AditiCallCellNo,
- "aditi_call_info", Reuse) }
+ must_be_static, "aditi_call_info", Reuse) }
;
{ EvalMethod = (aditi_top_down) },
% XXX Need to work out how to encode the procedure
@@ -657,19 +655,16 @@
{ goal_path_to_string(GoalPath, GoalPathStr) },
code_info__get_cur_proc_label(CallerProcLabel),
code_info__get_next_closure_seq_no(SeqNo),
- code_info__get_cell_counter(C0),
{ stack_layout__construct_closure_layout(CallerProcLabel,
SeqNo, ClosureInfo, ProcLabel, ModuleName,
FileName, LineNumber, GoalPathStr,
ClosureLayoutMaybeRvals, ClosureLayoutArgTypes,
- Data, C0, C) },
+ Data) },
code_info__add_closure_layout(Data),
- code_info__set_cell_counter(C),
- code_info__get_next_cell_number(ClosureLayoutCellNo),
{ Reuse = no },
{ ClosureLayout = create(0, ClosureLayoutMaybeRvals,
ClosureLayoutArgTypes, must_be_static,
- ClosureLayoutCellNo, "closure_layout", Reuse) },
+ "closure_layout", Reuse) },
{ list__length(Args, NumArgs) },
{ proc_info_arg_info(ProcInfo, ArgInfo) },
{ unify_gen__generate_pred_args(Args, ArgInfo, PredArgs) },
Index: compiler/var_locn.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/var_locn.m,v
retrieving revision 1.7
diff -u -b -r1.7 var_locn.m
--- compiler/var_locn.m 15 Mar 2003 03:09:14 -0000 1.7
+++ compiler/var_locn.m 1 May 2003 21:32:46 -0000
@@ -1,4 +1,4 @@
-%---------------------------------------------------------------------------%
+
% Copyright (C) 2000-2003 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
@@ -148,14 +148,14 @@
:- pred var_locn__assign_expr_to_var(prog_var::in, rval::in, code_tree::out,
var_locn_info::in, var_locn_info::out) is det.
-% var_locn__assign_cell_to_var(Var, Ptag, Vector, CellNum, TypeMsg, Code,
+% var_locn__assign_cell_to_var(Var, Ptag, Vector, TypeMsg, Code,
% VarLocnInfo0, VarLocnInfo)
% Generates code to assign to Var a pointer, tagged by Ptag, to
% the cell whose contents are given by the other arguments,
% and updates the state of VarLocnInfo0 accordingly.
:- pred var_locn__assign_cell_to_var(prog_var::in, tag::in,
- list(maybe(rval))::in, int::in, string::in, code_tree::out,
+ list(maybe(rval))::in, string::in, code_tree::out,
var_locn_info::in, var_locn_info::out) is det.
% var_locn__place_var(Var, Lval, Code, VarLocnInfo0, VarLocnInfo)
@@ -673,9 +673,10 @@
_MaybeExprRval, _UsingVars, _DeadOrAlive) },
(
{ MaybeConstBaseVarRval = yes(BaseVarRval) },
- { BaseVarRval = create(Ptag, BaseVarArgs, _,_,_,_,_) }
+ { BaseVarRval = create(Ptag, BaseVarArgs, _,_,_,_) }
->
- { list__index0_det(BaseVarArgs, Offset, SelectedArg) },
+ { list__index0_det(BaseVarArgs, Offset,
+ SelectedArg) },
{ MaybeConstRval = SelectedArg },
{ Lvals = set__map(var_locn__add_field_offset(
yes(Ptag), const(int_const(Offset))),
@@ -782,10 +783,10 @@
%----------------------------------------------------------------------------%
-var_locn__assign_cell_to_var(Var, Ptag, Vector, CellNum, TypeMsg, Code) -->
+var_locn__assign_cell_to_var(Var, Ptag, Vector, TypeMsg, Code) -->
{ Reuse = no },
{ CellRval0 = create(Ptag, Vector, uniform(no), can_be_either,
- CellNum, TypeMsg, Reuse) },
+ TypeMsg, Reuse) },
(
var_locn__get_var_state_map(VarStateMap),
var_locn__get_exprn_opts(ExprnOpts),
@@ -844,7 +845,7 @@
{ Rval = Rval0 },
{ EvalCode = empty },
{ Comment = "assigning field from const" }
- ; { Rval0 = create(_, _, _, _, _, _, _) } ->
+ ; { Rval0 = create(_, _, _, _, _, _) } ->
{ Rval = Rval0 },
{ EvalCode = empty },
{ Comment = "assigning field from const struct" }
@@ -1845,21 +1846,18 @@
mkword(Tag, Expr)) :-
var_locn__expr_is_constant(Expr0, VarStateMap, ExprnOpts, Expr).
-var_locn__expr_is_constant(create(Tag, Args0, ArgTypes, StatDyn,
- Label, Msg, Reuse),
+var_locn__expr_is_constant(create(Tag, Args0, ArgTypes, StatDyn, Msg, Reuse),
VarStateMap, ExprnOpts, NewRval) :-
Reuse = no,
( StatDyn = must_be_static ->
- NewRval = create(Tag, Args0, ArgTypes, StatDyn,
- Label, Msg, Reuse)
+ Args = Args0
;
ExprnOpts = nlg_asm_sgt_ubf(_, _, StaticGroundTerms, _),
StaticGroundTerms = yes,
var_locn__args_are_constant(Args0, VarStateMap, ExprnOpts,
- Args),
- NewRval = create(Tag, Args, ArgTypes, StatDyn,
- Label, Msg, Reuse)
- ).
+ Args)
+ ),
+ NewRval = create(Tag, Args, ArgTypes, StatDyn, Msg, Reuse).
var_locn__expr_is_constant(var(Var), VarStateMap, ExprnOpts, Rval) :-
map__search(VarStateMap, Var, State),
@@ -2009,7 +2007,7 @@
{ Code = empty }
;
% If we get here, the cell must be a constant.
- { Rval0 = create(_, _, _, _, _, _, _) },
+ { Rval0 = create(_, _, _, _, _, _) },
{ Rval = Rval0 },
{ Code = empty }
;
@@ -2164,7 +2162,7 @@
var_locn__lval_depends_on_search_lval(Lval, SearchLval).
var_locn__rval_depends_on_search_lval(var(_Var), _SearchLval) :-
error("var_locn__rval_depends_on_search_lval: var").
-var_locn__rval_depends_on_search_lval(create(_, Rvals, _, _, _, _, Reuse),
+var_locn__rval_depends_on_search_lval(create(_, Rvals, _, _, _, Reuse),
SearchLval) :-
var_locn__args_depend_on_search_lval([Reuse | Rvals], SearchLval).
var_locn__rval_depends_on_search_lval(mkword(_Tag, Rval), SearchLval) :-
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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