tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
Estimated hours taken: 2
Branches: main
Implement impure functions as attributes of user events.
trace/mercury_event_spec.[ch]:
Allow the representation of such attributes in C code, and add the code
to write out such attributes.
trace/mercury_event_scanner.l:
trace/mercury_event_parser.y:
Implement the scanning and parsing of such attributes.
compiler/prog_event.m:
Modify the type of the terms generated by trace/mercury_event_spec.c
to include a pure/impure indication for function attributes.
Take this into account when generating the types of function
attributes.
Simplify some code by eliminating a redundant lookup in a map.
tests/debugger/synth_attr.{m,exp}:
Convert this line to four-space indentation, and update the expected
output to reflect the vim mode line at the top.
tests/debugger/synth_attr_impure.{m,inp,exp}:
tests/debugger/synth_attr_impure_spec:
New test case (a modified version of the synth_attr test case)
to test the new functionality.
tests/debugger/Mercury.options:
tests/debugger/Mmakefile:
Enable the new test case.
In the Mmakefile, delete some redundant 2>&1 constructs that were
apparantly created by careless cut-and-paste.
Estimated hours taken: 3
Branches: main
Replace names of the form "HeadVar__n" with meaningful names in a larger class
of cases than we do currently.
compiler/typecheck.m:
Implement the change above.
compiler/clause_to_proc.m:
compiler/hlds_clauses.m:
compiler/simplify.m:
Fix some minor issues I found while looking for the right piece of code
to change.
tests/debugger/queens.{inp,exp,exp2}:
Extend the input to the test case to print the names of the arguments
of the nodiag predicate (whose head variables are now named "B" and
"D", not HeadVar__1 and HeadVar__2).
Expect fewer conjuncts in the top-level conjunction, since the
unifications HeadVar__1 = B and HeadVar__2 = D can now be
optimized away.
tests/debugger/higher_order.exp:
tests/debugger/synth_attr.exp:
tests/debugger/user_event.exp:
tests/debugger/user_event_shallow.exp:
Update variable names and/or goal paths as for queens.
tests/debugger/higher_order.exp2:
Document that this file is not currently used.
Estimated hours taken: 2
Branches: main
Eliminate some code duplication by unifying the two goal_path types have had
until now: one in mdbcomp/program_representation.m and compiler/hlds_goal.m,
which differed in only one detail (whether we record the total number of arms
in a switch). The new type is in program_representation.m, but with the
definition from goal_path.m.
Add a "step_" prefix to the function symbols of the goal_path_step type,
to avoid ambiguity with the hlds goals the steps describe.
Turn the predicates operating on goal_paths into functions for greater
convenience of use.
mdbcomp/program_representation.m:
compiler/hlds_goal.m:
Make the change described above.
browser/*.m:
compiler/*.m:
mdbcomp/*.m:
slice/*.m:
Conform to the change above.
tests/debugger/*.exp:
Expect the extra information now available for goal path steps
describing switches.
Estimated hours taken: 32
Branches: main
Implement synthesized attributes at user events.
doc/user_guide.texi:
Document synthesized attributes.
runtime/mercury_stack_layout.h:
Include information about synthesized attributes in layout structures.
Move the the information about user events that is not specific to a
given event occurrence to a central table of user event specifications
in the module layout structure, to reduce the space overhead, and allow
a future Ducasse style execution monitor to look up information about
each event without having to search all label layout structures (e.g.
when compiling a set of user commands about what to do at each event
into a state machine).
Update the current layout structure version number.
Introduce a named type to represent HLDS variable numbers in layout
structures.
runtime/mercury_types.h:
Add typedefs for the new types in mercury_stack_layout.h.
compiler/prog_data.m:
compiler/prog_event.m:
Record the call that synthesizes synthesized attributes in terms of
attribute numbers (needed by the layout structures) as well as in terms
of attribute names (the user-friendly notation). Record some other
information now needed by the layout structures, e.g. the evaluation
order of synthesized attributes. (Previously, we computed this order
-in reverse- but then threw it away.)
Do not separate out non-synthesized attributes, now that we can handle
even synthesized ones. Return *all* attributes to call_gen.m.
Pass the filename of the event set specification file to the event
spec parser, for use in error messages.
Generate better error messages for semantic errors in event set
specifications.
compiler/continuation_info.m:
compiler/layout.m:
compiler/layout_out.m:
compiler/stack_layout.m:
Generate the new layout structures, the main changes being the
inclusion of synthesized attributes, and generating information about
event attribute names, types and maybe synthesis calls for all possible
events at once (for the module layout) instead of separately at each
user event occurrence.
In stack_layout.m, rename a couple of predicates to avoid ambiguities.
In layout_out.m, eliminate some repetitions of terms.
compiler/call_gen.m:
When processing event calls, match the supplied attributes against the
list of all attributes, and include information about the synthesized
attributes in the generated layout structures.
compiler/equiv_type.m:
compiler/module_qual.m:
Conform to the change in prog_data.m.
compiler/opt_debug.m:
Conform to the change in layout.m.
compiler/hlds_out.m:
Generate valid Mercury for event calls.
trace/mercury_event_spec.[ch]:
Record the name of the file being parsed, for use in syntax error
messages when the parser is invoked by the compiler.
Add a field for recording the line numbers of attributes, for use in
better error messages.
trace/mercury_event_parser.y:
trace/mercury_event_scanner.l:
Record the line numbers of attributes.
Modify the grammar for event set specifications to allow C-style
comments.
trace/mercury_trace_internal.c
Pass a dummy filename to mercury_event_spec. (The event set
specifications recorded in layout structures should be free of errors,
since the compiler generates them and it checked the original version
for errors.)
trace/mercury_trace_tables.[ch]:
Conform to the new design of layout structures, and record the extra
information now available.
trace/mercury_trace_vars.[ch]:
Record the values of attributes in two passes: first the
non-synthesized attributes, then the synthesized attributes
in the evaluation order recorded in the user event specification.
tests/debugger/synth_attr.{m,inp,exp}:
tests/debugger/synth_attr_spec:
New test case to test the debugger's handling of synthesized
attributes.
tests/debugger/Mmakefile:
tests/debugger/Mercury.options:
Enable the new test case.
tests/invalid/syntax_error_event.{m,err_exp}:
tests/invalid/syntax_error_event_spec:
New test case to test the handling of syntax errors in event set
specifications.
tests/invalid/synth_attr_error.{m,err_exp}:
tests/invalid/synth_attr_error_spec:
New test case to test the handling of semantic errors in event set
specifications.
tests/invalid/Mmakefile:
Enable the new test cases.