mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-19 15:54:18 +00:00
Add field names for the proc_layout_info type.
Estimated hours taken: 1 compiler/continuation_info.m: Add field names for the proc_layout_info type. compiler/optimize.m: Use the new field names.
This commit is contained in:
@@ -61,28 +61,37 @@
|
||||
%
|
||||
:- type proc_layout_info
|
||||
---> proc_layout_info(
|
||||
label, % The entry label.
|
||||
determinism, % Determines which stack is used.
|
||||
int, % Number of stack slots.
|
||||
maybe(int), % Location of succip on stack.
|
||||
maybe(label), % If the trace level is not none,
|
||||
% this contains the label associated
|
||||
% with the call event, whose stack
|
||||
% layout says which variables were
|
||||
% live and where on entry.
|
||||
int, % The number of the highest numbered
|
||||
entry_label :: label,
|
||||
% Determines which stack is used.
|
||||
detism :: determinism,
|
||||
% Number of stack slots.
|
||||
stack_slot_count :: int,
|
||||
% Location of succip on stack.
|
||||
succip_slot :: maybe(int),
|
||||
% If the trace level is not none, this
|
||||
% contains the label associated with
|
||||
% the call event, whose stack layout
|
||||
% gives the locations of the input
|
||||
% arguments on procedure entry, for
|
||||
% use in implementing retry in the
|
||||
% debugger.
|
||||
call_label :: maybe(label),
|
||||
% The number of the highest numbered
|
||||
% rN register that can contain useful
|
||||
% information during a call to MR_trace
|
||||
% from within this procedure.
|
||||
trace_slot_info,% Info about the stack slots used
|
||||
max_trace_reg :: int,
|
||||
% Info about the stack slots used
|
||||
% for tracing.
|
||||
bool, % Do we require the procedure id
|
||||
trace_slot_info :: trace_slot_info,
|
||||
% Do we require the procedure id
|
||||
% section of the procedure layout
|
||||
% to be present, even if the option
|
||||
% procid_stack_layout is not set?
|
||||
proc_label_layout_info
|
||||
need_proc_id :: bool,
|
||||
% Info for each internal label,
|
||||
% needed for basic_stack_layouts.
|
||||
internal_map :: proc_label_layout_info
|
||||
).
|
||||
|
||||
%
|
||||
@@ -338,7 +347,7 @@ continuation_info__process_proc_llds(PredProcId, Instructions,
|
||||
|
||||
% Get all the continuation info from the call instructions.
|
||||
global_data_get_proc_layout(GlobalData0, PredProcId, ProcLayoutInfo0),
|
||||
ProcLayoutInfo0 = proc_layout_info(A, B, C, D, E, F, G, H, Internals0),
|
||||
Internals0 = ProcLayoutInfo0^internal_map,
|
||||
GetCallInfo = lambda([Instr::in, Call::out] is semidet, (
|
||||
Instr = call(Target, label(ReturnLabel), LiveInfo, Context, _)
|
||||
- _Comment,
|
||||
@@ -350,7 +359,7 @@ continuation_info__process_proc_llds(PredProcId, Instructions,
|
||||
list__foldl(continuation_info__process_continuation(WantReturnInfo),
|
||||
Calls, Internals0, Internals),
|
||||
|
||||
ProcLayoutInfo = proc_layout_info(A, B, C, D, E, F, G, H, Internals),
|
||||
ProcLayoutInfo = ProcLayoutInfo0^internal_map := Internals,
|
||||
global_data_update_proc_layout(GlobalData0, PredProcId, ProcLayoutInfo,
|
||||
GlobalData).
|
||||
|
||||
|
||||
@@ -53,8 +53,7 @@ optimize__proc(CProc0, GlobalData, CProc) -->
|
||||
global_data_maybe_get_proc_layout(GlobalData, PredProcId,
|
||||
ProcLayout)
|
||||
->
|
||||
ProcLayout = proc_layout_info(_, _, _, _, _, _, _, _,
|
||||
LabelMap),
|
||||
LabelMap = ProcLayout^internal_map,
|
||||
map__sorted_keys(LabelMap, LayoutLabels),
|
||||
set__sorted_list_to_set(LayoutLabels, LayoutLabelSet)
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user