mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 21:35:49 +00:00
7fe94d85371324f79661d5eb81fb49ee0c01ac88
7 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
94af772351 |
Copy files which are needed to build the boehm_gc using MSVC.
Estimated hours taken: 0.1 Branches: main scripts/prepare_tmp_dir_grade_part: Copy files which are needed to build the boehm_gc using MSVC. |
||
|
|
9ec86d6a6d |
The objective of this diff is to switch from a table of solver events built
Estimated hours taken: 32
Branches: main
The objective of this diff is to switch from a table of solver events built
into the compiler (and eventually the debugger) into a table of events
defined by a file provided by the user to the compiler, which the compiler
then records in the executable for use by the debugger.
The current design, for speed of implementation, uses temporary files parsed
by a bison-generated parser. Since the compiler needs to be able to invoke
the parser even if it is compiled in a non-debug grade, the parser is in
a new library, the eventspec library, that is always linked into the Mercury
compiler and is always linked into any Mercury program with debugging enabled
(but is of course linked only once into a Mercury compiler which has debugging
enabled).
Modify the debugger to give it the ability to print the attributes of
user-defined events (for now, only the non-synthesized attributes).
Implement a new debugger command, "user", which goes to the next user-defined
event.
configure.in:
Require flex and and bison to be available.
doc/user_guide.texi:
Document user defined events and the new debugger capabilities.
doc/mdb_categories:
Include "user" in the list of forward movement commands.
Fix some earlier omissions in that list.
runtime/mercury_stack_layout.h:
Include an event number in the user-defined event structure.
Include a string representing an event set specification in module
layout structures.
runtime/mercury_stack_layout.h:
runtime/mercury_trace_base.[ch]:
runtime/mercury_types.h
Switch from solver events to user events in names.
runtime/mercury_trace_term.[ch]:
Provide a representation of flat terms, for use in representing
the calls that generate synthesized attributes.
Ensure that exported field names have an MR_ prefix.
browser/cterm.m:
Conform to the change to runtime/mercury_trace_term.h.
scripts/c2init.in:
scripts/ml.in:
Include the eventspec library in programs compiled with debugging
enabled.
compiler/Mmakefile:
Include the eventspec library in the compiler.
compiler/options.m:
Add a new option, --event-spec-file-name, that allows the user to
specify the set of user-defined events the program may use.
compiler/handle_options.m:
Set this optimization from an environment variable (which may be
set by the mmc script) if the new option is not explicitly given.
compiler/prog_data.m:
Define the data structures for the compiler's representation of the
event set specification.
Move some definitions around to group them more logically.
compiler/hlds_module.m:
Include the event set specification as a new field in the module_info.
compiler/prog_event.m:
Add the code for invoking the parser in the eventspec library,
and for converting the simple term output by the parser to the
compiler own representation, which contains more information
(to wit, the types of the function attributes) and which has had
a whole bunch of semantic checks done on it (e.g. whether synthesized
attributes depend on themselves or on nonexistent attributes).
Provide a function to generate a canonicalized version of the event
specification file.
compiler/module_qual.m:
compiler/equiv_type.m:
Process event spec specifications as well as items, to module qualify
the names of the types of event arguments, and expanding out
equivalence types.
In equiv_type.m, rename some variables to make clear what kind of info
they represent.
compiler/mercury_compile.m:
Process the event set specification file if one has been selected:
read it in, module qualify it, expand its equivalence types, and add
to the module_info.
compiler/compile_target_code.m:
Include the event_spec library when linking debuggable executables.
compiler/call_gen.m:
compiler/continuation_info.m:
compiler/trace_gen.m:
compiler/trace_params.m:
mdbcomp/prim_data.m:
mdbcomp/trace_counts.m:
runtime/mercury_goto.h:
Generate user-defined events instead of solver events.
compiler/layout.m:
compiler/layout_out.m:
compiler/stack_layout.m:
Include a canonicalized version of the event specification file
in the module layout if the module has any user-defined events.
compiler/code_info.m:
compiler/llds_out.m:
compiler/modes.m:
compiler/modules.m:
compiler/opt_debug.m:
compiler/typecheck.m:
Conform to the changes above.
compiler/passes_aux.m:
Rename a predicate to avoid an ambiguity.
trace/Mmakefile:
Add the definition and rules required to build the eventspec library.
trace/mercury_event_scanner.l:
trace/mercury_event_parser.y:
A scanner and a parser for reading in event spec specifications.
trace/mercury_event_spec_missing.h:
Provide the declarations that should be (but aren't) provided by
flex and bison.
trace/mercury_event_spec.[ch]:
The main module of the eventspec library. Provides functions to read
in event set specifications from a file, and to write them out as a
Mercury term in the form needed by the compiler.
trace/mercury_trace_tables.c:
If the module layouts being registered include event set
specifications, then check their consistency. Make the specification
and the consistency indication available to other modules.
trace/mercury_trace_internal.c:
During initialization, if the modules contain a consistent set of event
set specifications, then read that specification into the debugger.
(We don't yet make use of this information.)
Add an extra mdb command, "user", which goes forward to the next
user-defined event.
trace/mercury_trace.[ch]:
trace/mercury_trace_cmd_forward.[ch]:
Implement the new mdb command.
trace/mercury_trace_vars.[ch]:
For user-defined events, include the attributes' values among the
values that can be printed or browsed.
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_declarative.c:
Minor changes.
scripts/scripts/prepare_tmp_dir_grade_part:
Copy the .y and .l files to the tmp dir we use for installs.
tools/bootcheck:
Copy the .y and .l files of the trace directory to stage 2.
tools/lmc.in:
Include the eventspec library when linking debuggable executables.
tests/debugger/user_event.{m,inp,exp}:
tests/debugger/user_event_spec:
New test case to test the new functionality.
tests/debugger/Mercury.options:
tests/debugger/Mmakefile:
Enable the new test case.
tests/debugger/completion.exp:
Expect the new "user" mdb command in the completion output.
|
||
|
|
1b8dd4920d |
Fix a typo: s/tmpdir/tmp_dir/
Estimated hours taken: 0.1 Branches: main scripts/prepare_tmp_dir_grade_part: Fix a typo: s/tmpdir/tmp_dir/ Remove libatomic_ops*.a when copying the boehm_gc directory. |
||
|
|
f1cbb3dec6 |
Copy libatomic_ops-related files into tmp_dir when installing grades.
Estimated hours taken: 0.5 Branches: main scripts/prepare_tmp_dir_grade_part: Copy libatomic_ops-related files into tmp_dir when installing grades. compiler/notes/upgrade_boehm_gc.html: Add more tips. |
||
|
|
d124cad510 |
Reduce the amount of clutter on mgnuc command lines by moving arguments that
Estimated hours taken: 4 Branches: main Reduce the amount of clutter on mgnuc command lines by moving arguments that are always the same for a given directory into a file that is always consulted by mgnuc in the current directory. scripts/mgnuc.in: Always include as C compiler arguments the contents of a file named .mgnuc_copts in the current directory, if it exists. (It is named .mgnuc_copts instead of .mgnuc_opts because it may not contain general mgnuc options, such as --no-mercury-stdlib-dir.) Mmake.workspace: Comment out the additions of search paths to CFLAGS. */Mmakefile: Delete the additions of search paths to CFLAGS. */.mgnuc_copts: New files containing the directory-specific search paths, and in some cases the required macro definitions. These replace what was taken out of Mmake.workspace and */Mmakefile. In some cases, the old search paths included inappropriate directories; the .mgnuc_copt files don't. tests/.mgnuc_copts.ws: New files containing the directory-specific search paths; bootcheck makes tests/.mgnuc_copts from it. */.nocopyright: Don't require copyright notices in .mgnuc_copts files. tools/bootcheck: Copy the various .mgnuc_copts files from the stage1 to stages 2 and 3. They aren't needed in stage3 right now, but that may change. Create tests/.mgnuc_copts. browser/util.m: Delete an unused and inappropriate #include. scripts/Mmake.rules: Use a single invocation of mkdir -p to create all subdirectories needed by Java. Update a piece of documentation. scripts/Mmakefile: Reorganize the process of invoking config.status to avoid invoking it on inappropriate files, and to ensure the right permissions on the files it is invoked on. scripts/prepare_tmp_dir_grade_part: Copy the .mgnuc_copts files when populating tmp_dir. |
||
|
|
d56de30e9d |
Remove most of the junk from the command lines executed by make when building
Estimated hours taken: 12 Branches: main Remove most of the junk from the command lines executed by make when building the compiler and by bootcheck when building test cases. We do this by moving the junk into files consulted via the --flags option. After this change, it is actually possible to see in a glance not just which files are being compiled but also with which options. The size of the output (measured in bytes) from a bootcheck is now only about 40% of what is was before. configure.in: Remember the path to the bootstrap compiler and the flags it should be invoked with separately. Put the flags into the FLAGS files in various directories. Test whether the default install directory actually exists, so that the -L and -R linker options referring to this directory are passed to the C compiler only if it does. Mmake.common.in: Comment out a bunch of additions of MCFLAGS, the ones whose contents are now in FLAGS files. Conform to the changes in configure.in. Add a template rule for the dependencies of the FLAGS files. Mmake.workspace: Comment out a bunch of additions of MCFLAGS, the ones whose contents are now in FLAGS files. In some cases, add references to the FLAGS files. Mmakefile: When rebuilding Mmake.common, rebuild only Mmake.common, not all files created by configure. analysis/ANALYSIS_FLAGS.in: browser/MDB_FLAGS.in: compiler/COMP_FLAGS.in: deep_profiler/PROF_FLAGS.in: library/LIB_FLAGS.in: mdbcomp/MDBCOMP_FLAGS.in: profiler/DEEP_FLAGS.in: slice/SLICE_FLAGS.in: tests/TESTS_FLAGS.in: Add these files, which each contain the junk flags (the flags which are the same on every invocation and mostly just clutter up compiler command lines) that are needed on each compiler invocation in the relevant directory. Besides the results of configuration (word size etc), and the paths to other parts of the system, these files mostly control which warnings are enabled. Restrict the list of directories in -I options to what is sensible; for example, don't specify -I../analysis in the deep_profiler directory. */.nocopyright: Don't require copyright notices in FLAGS files, since that would make them invalid. library/INTER_FLAGS: Add this file, which contains the flags enabled with intermodule optimization. tests/WS_FLAGS.ws: Add this file. Unlike the .in files, which processed by config.status based on the results of autoconfiguration, this one is processed to specify the location of the workspace being tested. analysis/Mmakefile: browser/Mmakefile: compiler/Mmakefile: deep_profiler/Mmakefile: library/Mmakefile: mdbcomp/Mmakefile: profiler/Mmakefile: tests/Mmakefile: Include the relevant directory's FLAGS file on the command line, to replace all the additions to MCFLAGS in ../Mmake.common and in ../Mmake.workspace, and in some cases, the directory-specific Mmakefile itself. Build the directory's FLAGS file before executing the depend target, since most compiler options beyond --generate-dependencies come from there. Delete the FLAGS files generated by config.status when doing "make clean". tests/Mmakefile: Allow the environment to define DIFF_OPTS. runtime/Mmakefile: Use an option to tell config.status what to rebuild, not some environment variables. tests/invalid/Mercury.options: For two test cases, reset an option that is set in tests/WS_FLAGS, to match the options the affected tests were compiled with before. tests/invalid/*.err2: Update these expected files to account for the use of error_util in error messages by previous changes to the compiler. These expected output files are used only with --use-subdirs. tests/warnings/Mmakefile: For all test cases, reset an option that is set in tests/WS_FLAGS, to match the options the tests were compiled with before. scripts/prepare_tmp_dir_grade_part Copy the flags files when creating the subdirectories of tmp_dir. scripts/mgnuc.in: Provide a mechanism, a per-directory .mgnuc_opts file, for specifying the options that are required for every C file in a directory. The intention is to use this for -I../library etc, but this is not done yet; one thing at a time. tools/bootcheck: Copy the FLAGS files when creating stage2 and stage3. Don't specify the compiler options that are now in FLAGS files. Fill in the location of the workspace in tests/WS_FLAGS before running the tests. Provide a mechanism (a file ~/.bootcheck_diff_opts) to allow the user to specify what options to invoke diff with. Move the setting of MMAKE_USE_SUBDIRS and MMAKE_USE_MMC_MAKE after we have built stage1, and always copy the profilers if --use-subdirs is set. The old ways of doing things caused problems if bootcheck was given --use-subdirs but stage1 doesn't use subdirs: the bootcheck modified the stage1 slice, profiler and deep_profiler directories. |
||
|
|
6b0fb566ce |
Move the mdbcomp library to its own directory.
Estimated hours taken: 12 Branches: main Move the mdbcomp library to its own directory. To make this change less painful to test, improve the way we handle installs. browser/mdbcomp.m: browser/mer_mdbcomp.m: browser/prim_data.m: browser/program_representation.m: browser/trace_counts.m: Move these files to the mdbcomp directory. browser/Mmakefile: browser/Mercury.options: mdbcomp/Mmakefile: mdbcomp/Mercury.options: Split the contents of the old Mmakefile and Mercury.options file in the browser directory between these files as appropriate. Simplify away the stuff not needed now that there is only one library per directory. Make the browser directory see the relevant files from the mdbcomp directory. Mmake.common.in: Separate out the prefixes allowed in the browser and the mdbcomp directories. Mmake.workspace: Set up a make variable to refer to the mdbcomp directory. Adjust references to the mdbcomp library to point to its new location. Mmakefile: Make invocations visit the mdbcomp library as necessary. Improve the way we install grades. Making temporary backups of the directories modified by the install process is unsatisfactory for two reasons. First, if the install fails, the cleanup script, which is necessary for user friendliness, destroys any evidence of the cause. Second, the restore of the backup wasn't perfect, e.g. it left the .d files modified to depend on .mih files, which don't exist in LLDS grades, and also left altered timestamps. This diff changes the install process to make a single tmp_dir subdirectory of the workspace, with all the work of install_grade being done inside tmp_dir. The original directories aren't touched at all. */Mmakefile: Adjust references to the browser directory to refer to the mdbcomp directory instead or as well. scripts/Mmake.rules: */Mmakefile: Make it easier to debug Mmakefiles. Previously, creating a Mmake.makefile with mmake -s and invoking "make -d" ignored the most fundamental rules of mmake, because Mmake.rules was treating an unset MMAKE_USE_MMC_MAKE as if it were set to "yes", simply because it was different from "no". This diff changes it to treat an unset MMAKE_USE_MMC_MAKE as if it were set to "no", which is a more sensible default. scripts/prepare_tmp_dir_fixed_part.in: scripts/scripts/prepare_tmp_dir_grade_part: Two new scripts that each do half the work of preparing tmp_dir for the real work of the install_grade make target. The fixed_part script prepares the parts of tmp_dir that are grade-independent, while the grade_part scripts prepares the parts that are grade-dependent. configure.in: Test C files in the mdbcomp directory to see whether they need to be recompiled after reconfiguration. Create prepare_tmp_dir_fixed_part from prepare_tmp_dir_fixed_part.in. compiler/*.m: runtime/mercury_wrapper.c: Update the references to the moved files. compiler/notes/overall_design.html: Mention the new directory. |