Estimated hours taken: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 5
Branches: main
analysis/analysis.file.m:
analysis/analysis.m:
Add support for "extra info" sections in `.analysis' files. These are
intended to contain any data that may be necessary but wouldn't fit as
answer patterns.
compiler/modules.m:
Add `.imdg' and `.request' to the list of extensions treated specially
by `make_file_name', so `--intermodule-analysis' works with
`--use-grade-subdirs'.
Estimated hours taken: 25
Branches: main
This patch improves the handling of libraries with the intermodule
analysis framework. `.analysis' files can now be installed into library
directories and used when analysing local modules.
analysis/analysis.m:
analysis/analysis.file.m:
compiler/mmc_analysis.m:
Separate the `module_id_to_file_name' method of the `compiler'
typeclass into `module_id_to_read_file_name' and
`module_id_to_write_file_name'. Add `module_is_local' method.
Change the calls to `module_id_to_file_name' appropriately for the
context. This allows us to find the `.analysis' files of library
modules.
Only write results, IMDG and request files for local modules.
Force `.analysis' files of the currently-analysed module to be written
out, even if it would be empty. This avoids us trying to reanalyse the
module later.
compiler/options.m:
Add internal compiler option `--local-module-id'.
compiler/make.dependencies.m:
Add `make_local_module_id_options' to build a list of
`--local-module-id' options.
compiler/make.module_target.m:
Add predicate `make_module_target_extra_options' so we can pass the
`--local-module-id' options.
compiler/make.program_target.m:
Analyse modules in bottom up order, according to the module dependency
graph. The current analyses don't support non-default call patterns,
so this should reduce the number of analysis passes to get (close to)
to a fixpoint.
Pass `--local-module-id' options when building analysis files, so the
analysis framework knows which modules are local.
Install `.analysis' files when installing libraries.
compiler/modules.m:
Make `.analysis', `.analysis_date', `.imdg' and `.request' files
architecture- or grade-specified so they go into grade directories
when `--use-grade-subdirs' is used.
Search for `.analysis' files in the same directories as `.opt' and
`.trans_opt' files.
Export predicate `add_module_relations' to help build module dependency
graphs.
compiler/mercury_compile.m:
Fix a bug where the unused argument optimisation pass was always being
run if `--intermodule-analysis' was enabled.
Estimated hours taken: 20
Branches: main
This patch mainly adds the ability to perform intermodule analysis of modules
as a separate step from code generation. It makes a start on automatic
reanalysis of modules if their .analysis files become invalid or suboptimal.
analysis/analysis.file.m:
analysis/analysis.m:
Add a predicate `read_module_overall_status' to read just the overall
status of an analysis file.
Fix a bug where analysis results were being discarded (upon reading) if
the module's overall status was `invalid'. We can't do that as then we
wouldn't know which results changed after reanalysis.
Touch a `FOO.analysis_date' file after module `FOO' is analysed.
This is needed to indicate the time at which `FOO' was last analysed,
as `FOO.analysis' can be modified at other times.
Add a mutable boolean variable `debug_analysis' that can be set
to enable debugging messages for the analysis framework.
compiler/handle_options.m:
compiler/options.m:
Add new compiler options `--make-analysis-registry',
`--debug-intermodule-analysis' and `--analysis-repeat'.
compiler/make.dependencies.m:
Add `.analysis' files as dependencies of compiled code files if
`--intermodule-analysis' is used.
compiler/make.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.util.m:
Add a `FOO.analyse' pseudo-target to `mmc --make'. This produces all
the `.analysis' files needed to compile the top-level module `FOO',
reanalysing modules until none of the `.analysis' files are invalid.
The `--analysis-repeat' option can also be used to force
`suboptimal' modules to be reanalysed a number of times.
Perform an analysis pass when building executables or libraries to make
sure that compilation does not proceed with invalid analysis files.
Treat `.analysis' files specially when checking whether they are out of
date. Analysis files require looking at their contents to determine
whether they are invalid (in which case they are out of date), or valid
(in which case we look at the timestamp of the corresponding
`.analysis_date' file).
compiler/mercury_compile.m:
Make `.analysis' be written out only when `--make-analysis-registry'
is used, like `--make-transitive-optimization-interface'.
`mmc --make' runs the compiler the `--make-analysis-registry'
option as appropriate.
compiler/exception_analysis.m:
compiler/trailing_analysis.m:
compiler/unused_args.m:
Only record intermodule dependencies and analysis results when
`--make-analysis-registry' is enabled, not when
`--intermodule-analysis' is enabled.
doc/user_guide.texi:
Document `--debug-intermodule-analysis' and `--analysis-repeat'.
Estimated hours taken: 45
Branches: main
Some work on the intermodule analysis framework. The main changes are that
modules and analysis results have statuses associated with them, which are
saved in the `.analysis' files, and there is now code to handle intermodule
dependency graphs (that record which modules are dependent on a particular
analysis result).
Automatic recompilation of modules that use out of date or invalid analysis
results from other modules is not handled yet.
analysis/README:
analysis/analysis.m:
analysis/analysis.file.m:
Remove the `FuncInfo' type variable everywhere. This was originally
designed to be used by analyses to store "extra" information that
would be passed from an analysis implementation through the analysis
framework, back to methods defined by the analysis implementation
itself.
The main problem was that `FuncInfo' made `Call' or `Answer' values
hard to compare, as a `FuncInfo' value always had to be present for a
comparison to be made (because the methods in the partial_order
typeclass required FuncInfos). One example of when this is hard to
satisfy is when we are ready to write everything out to disk at the
end of all analyses. At this step there is much comparing of Call
and Answer values, but this step is not invoked by any particular
analysis pass. To compare values we would need to get the FuncInfos
from somewhere, which means we would have to store FuncInfos in the
analysis_info maps as well. And any time you have two FuncInfos, you
need to choose one of the FuncInfos arbitrarily.
Since FuncInfos would have to be read/written with every Call and
Answer value, including IMDGs, I have changed it so that that any
information which might be be stored in a `FuncInfo' should be stored
in the corresponding `Call' value itself.
Change the format of analysis result files to include an overall
status for the module and a status for each analysis result. The
statuses record whether the module or analysis result could be
improved by further compilation, or if the module or analysis result
is no longer valid.
Add code to read and write intermodule dependency graphs (IMDGs). The
IMDG file for module M records all the modules which depend on an
analysis result for a procedure defined in M.
Bump analysis file format version numbers as they are incompatible
with earlier versions.
compiler/mercury_compile.m:
Make `mercury_compile_after_front_end' use state variables for
copies of the HLDS and update it to match changes in the intermodule
analysis framework.
compiler/mmc_analysis.m:
Add the trail usage analysis to the list of analyses to be used with
the intermodule analysis framework.
Update the entry for unused argument elimination.
Add predicate `module_id_func_id'.
compiler/add_pragma.m:
compiler/hlds_module.m:
compiler/trailing_analysis.m:
Make the trail usage analysis pass able to make use of the intermodule
analysis framework.
Associate each `trailing_status' in the `trailing_info' map with an
`analysis_status', i.e. whether it is optimal or not.
compiler/unused_args.m:
Update to match the removal of `FuncInfo' arguments and the
addition of analysis statuses.
Record the unused argument analysis result for a procedure even if
all of the procedures arguments are used, so that callers of the
procedure will know not to request more precise answers.
Record the dependence of the current module on analysis results from
other modules.
compiler/goal_util.m:
Add predicate `pred_proc_ids_from_goal/2'.
compiler/make.m:
compiler/make.dependencies.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/modules.m:
scripts/Mmake.vars.in:
Make `mmc --make' and `mmake' realclean `.analysis', `.imdg' and
`.request' files of non-library modules. Files for imported library
modules won't be deleted, but they probably shouldn't be generated in
the first place.
NEWS:
library/list.m:
Add a `list.map2_foldl2' predicate.
compiler/Mmakefile:
Add the `analysis' directory to the list of directories to be
processed by mtags.
Estimated hours taken: 3
Branches: main
This fixes some problems with building everything with `mmake --use-mmc-make'
on x86, or possibly any platform where shared libraries are supported.
Mmake.workspace:
Add "--mercury-linkage static" or "--mercury-linkage shared" to
`MCFLAGS' depending on whether the `LINK_STATIC' makefile variable is
yes or no.
analysis/ANALYSIS_FLAGS.in:
Add -L<dir> options so that the analysis library can find the boehm_gc,
runtime and standard library files when built in shared linking mode.
browser/Mercury.options:
Work around a problem with per-file variables and `mmake
--use-mmc-make'.
compiler/COMP_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
Remove "--linkage shared" from these files. The Mmakefiles in these
directories have "LINK_STATIC=yes" set. This was causing a link error
where the object files where being built with PIC but expected to
link against lib*.a files.
Estimated hours taken: 5
Branches: main
analysis/analysis.file.m:
Fix a bug in which only the first entry of an analysis file was being
parsed.
compiler/unused_args.m:
Fix `unused_args_answer_from_string' which was not reading in the
output of `unused_args_answer_to_string' correctly.
Disable an assertion in `fixup_unused_args' which seems to be invalid
with intermodule analysis.
Estimated hours taken: 0.3
Branches: main
Reduce even further the clutter of boring command line arguments.
scripts/mgnuc.in:
If a file named .mgnuc_opts exists in the current directory,
read mgnuc options from it. This mechanism is very similar to the
mechanism I added a while ago to get C compiler options from a
file named .mgnuc_copts.
Convert to four-space indentation.
scripts/mgnuc_file_opts.sh-subr:
New file containing most of the option handling code that used to be
in mgnuc.in. Now, it is is included in mgnuc twice: once for handling
options from the command line, once for handling options from
.mgnuc_opts files.
configure.in:
Set up configure to insert mgnuc_file_opts.sh-subr into mgnuc.
*/.mgnuc_opts:
New files specifying the --no-mercury-stdlibdir mgnuc option.
Mmake.workspace:
Don't pass --no-mercury-stdlibdir on command lines anymore, since this
is now taken care of by the .mgnuc_opts files.
Estimated hours taken: 30
Branches: main
Implement a procedure-local closure analysis that tracks the possible
values of higher-order valued variables within a procedure. We will
eventually replace this with a more sophisticated analysis that tracks
these values across procedure and module boundaries but we need something
of this capability now in order to continue development of the termination
and exception analyses.
This analysis is similar to that carried out by higher-order
specialization except here we do keep track of higher-order variables
that have multiple possible values.
compiler/closure_analysis.m:
Keep track of the possible values of higher-order variables
within a procedure. Annotate goals in the HLDS with this
information where it might prove useful.
compiler/hlds_goal.m:
Add an extra field to the goal_info that is designed
to hold the results of optional analysis passes. At
the moment this is only used to hold the results of
closure analysis.
compiler/options.m:
compiler/mercury_compile.m:
Add code to invoke the new analysis. Closure analysis
is stage 117, directly before exception analysis.
compiler/passes_aux.m:
Add a version of write_proc_progress_message, that does
not require the caller to deconstruct a pred_proc_id.
compiler/prog_type.m:
Add a predicate type_is_higher_order/1 that is similar
type_is_higher_order/5 except that it doesn't have any
outputs.
compiler/transform_hlds.m:
Include the new module.
doc/user_guide.texi:
Document the '--analyse-closures' and '--debug-closures'
options. The documentation is currently commented out until
closure analysis is useful for something.
doc/reference_manual.texi:
s/must have give a definition/must give a definition/
*/.cvsignore:
Have CVS ignore the various *_FLAGS files generated
by the configure script.
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.
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.
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.
Estimated hours taken: 1
Branches: main
Allow users to ensure that tags files always exist in the relevant directories
by setting the environment variable ALWAYS_MMAKE_TAGS_FILE.
runtime/Mmakefile:
trace/Mmakefile:
library/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
If TAGS_FILE_EXISTS is set to tags_file_exists, then make the default
action ensure the existence of the tags file. It would be too
expensive to remake the tags file every time mmake is run, but
just testing for its existence is cheap enough.
Fix the formatting of some rules.
Mmake.common.in:
Set TAGS_FILE_EXISTS to tags_file_exists if the environment variable
ALWAYS_MMAKE_TAGS_FILE is set.
Fix some documentation.
Estimated hours taken: 8
Branches: main
analysis/analysis.m:
browser/browse.m:
compiler/accumulator.m:
compiler/assertion.m:
compiler/atsort.m:
compiler/c_util.m:
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/code_gen.m:
compiler/code_model.m:
compiler/const_prop.m:
compiler/constraint.m:
compiler/dead_proc_elim.m:
compiler/delay_construct.m:
compiler/dependency_graph.m:
compiler/det_analysis.m:
compiler/det_report.m:
compiler/export.m:
compiler/fact_table.m:
compiler/follow_code.m:
compiler/graph_colour.m:
compiler/hlds_module.m:
compiler/inlining.m:
compiler/llds.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
compiler/ml_tailcall.m:
compiler/ml_unify_gen.m:
compiler/mmc_analysis.m:
compiler/mode_errors.m:
compiler/passes_aux.m:
compiler/post_typecheck.m:
compiler/size_prof.m:
compiler/switch_util.m:
compiler/table_gen.m:
compiler/term_errors.m:
compiler/transform_llds.m:
compiler/type_util.m:
compiler/unify_gen.m:
compiler/unneeded_code.m:
compiler/unused_args.m:
Bring these modules up to our current coding standards. Use predmode
declarations and state variable syntax where relevant. Reorder
arguments where this is needed for the use state variables. Make the
orders of predicate definitions correspond to the order of their
declarations. Replace some overly large lambda expressions with named
predicates. Convert some predicates to functions where this makes
their use more convenient. Use field access notation where convenient.
Fix any inconsistent indentation. Remove module prefixes on predicate
names where this is necessary to allow sane indentation.
In several places, use predicates from error_util.m to print error
messages. Apart from this, there are no changes in algorithms.
In some places, conform to the changes below.
compiler/error_util.m:
compiler/hlds_error_util.m:
Add new variants of existing predicates for use in some of the
changed modules above.
compiler/hlds_out.m:
Add some functions to convert values of some HLDS types as strings,
for use in preparing the arguments of the new calls to predicates in
error_util.m. Change the implementations of the predicates that print
values of those types to call those functions instead of allowing
code duplication.
compiler/llds.m:
Add some field names to allow use of field updates where relevant.
tests/invalid/assert_in_interface.err_exp:
tests/invalid/multisoln_func.err_exp:
tests/invalid/tricky_assert1.err_exp:
Update the expected outputs of these test cases to allow for them being
generated by error_util.m, and hence being better formatted than
before.
Estimated hours taken: 1
Branches: main
analysis/Mmakefile:
compiler/Mmakefile:
browser/Mmakefile:
profiler/Mmakefile:
Add `ils' target, for use by tools/bootcheck.
library/Mmakefile:
Add a missing dependency to ensure that we build all of the
`.int*' files for the `il' grade (it was forgetting to build
`library.int3').
Also, add a target to build the library as an executable,
so that you can run PEverify on it (PEverify doesn't
work properly on multi-file assemblies unless they
are executables).
Estimated hours taken: 3
Branches: main
Various fixes for the .NET back-end.
compiler/Mmakefile:
For IL grades, use editbin to set the stack size to 100M,
since the default (1M) is too small.
Also, don't try to build mlds_to_gcc in IL grades -- gcc.m won't
compile, because the IL grades don't support the C interface.
library/Mmakefile:
Add some missing dependencies.
profiler/Mmakefile:
deep_profiler/Mmakefile:
Conditionalize some dependencies that were bogus for IL grades.
library/.cvsignore:
compiler/.cvsignore:
profiler/.cvsignore:
deep_profiler/.cvsignore:
analysis/.cvsignore:
browser/.cvsignore:
samples/.cvsignore:
Various minor updates to ignore files produced when building in
IL grades.
Estimated hours taken: 80
Branches: main
A first implementation of the inter-module analysis framwork.
Currently only unused argument analysis is supported.
The current inter-module analysis scheme using `.trans_opt' files
has some major limitations. The compilation dependencies introduced
by `.trans_opt' files are too complicated for Mmake without major
limitations on which modules can use the contents of which `.trans_opt'
files. Also, the `.trans_opt' file system only computes greatest fixpoints,
which is often too weak to find opportunities for optimization.
A better solution is to provide a library which manually handles
the dependencies introduced by inter-module analysis, and can deal with
the complications introduced by cyclic module dependencies.
TODO:
- support other analyses, e.g. termination, type specialization
- dependency tracking and invalidation after source modifications
- garbage collection of unused versions
- least fixpoint analyses
analysis/Mmakefile:
analysis/mer_analysis.m:
analysis/analysis.m:
analysis/analysis.file.m:
The analysis library.
analysis/README:
Description and design documentation.
Mmake.workspace:
Mmakefile:
compiler/Mmakefile:
tools/bootcheck:
Link the analysis library into mercury_compile.
compiler/hlds_module.m:
Store analysis information in the module_info.
compiler/options.m:
doc/user_guide.texi:
Add an option `--intermodule-analysis'.
compiler/mercury_compile.m:
Call the analysis library to write the gathered
information at the end of a compilation.
compiler/unused_args.m:
Call the analysis library to retrieve information
about imported procedures. This replaces code which
used the `.opt' files.
Change the names created for unused arguments procedures
to include the arguments removed, rather than a sequence
number. I think Zoltan is working on a change to name
mangling, so I haven't updated the demangler.
compiler/prog_util.m:
Generate the new predicate names for unused_args.m.
library/std_util.m:
Add a polymorphic version of unit, which is useful
for binding type variables.
compiler/modules.m:
scripts/Mmake.vars.in:
Clean up files created by the analysis framework
in `mmake realclean'.
util/mdemangle.c:
profiler/demangle.m:
Document the change in the name mangling of procedures with
unused arguments.
configure.in:
Check for state variables and fixes for some typeclass bugs.
tests/warnings/Mmakefile:
tests/warnings/unused_args_analysis.{m,exp}:
Test case.
Estimated hours taken: 80
Branches: main
A first implementation of the inter-module analysis framwork.
Currently only unused argument analysis is supported.
The current inter-module analysis scheme using `.trans_opt' files
has some major limitations. The compilation dependencies introduced
by `.trans_opt' files are too complicated for Mmake without major
limitations on which modules can use the contents of which `.trans_opt'
files. Also, the `.trans_opt' file system only computes greatest fixpoints,
which is often too weak to find opportunities for optimization.
A better solution is to provide a library which manually handles
the dependencies introduced by inter-module analysis, and can deal with
the complications introduced by cyclic module dependencies.
TODO:
- support other analyses, e.g. termination, type specialization
- dependency tracking and invalidation after source modifications
- garbage collection of unused versions
- least fixpoint analyses
analysis/Mmakefile:
analysis/mer_analysis.m:
analysis/analysis.m:
analysis/analysis.file.m:
The analysis library.
analysis/README:
Description and design documentation.
Mmake.workspace:
Mmakefile:
compiler/Mmakefile:
tools/bootcheck:
Link the analysis library into mercury_compile.
compiler/hlds_module.m:
Store analysis information in the module_info.
compiler/options.m:
doc/user_guide.texi:
Add an option `--intermodule-analysis'.
compiler/mercury_compile.m:
Call the analysis library to write the gathered
information at the end of a compilation.
compiler/unused_args.m:
Call the analysis library to retrieve information
about imported procedures. This replaces code which
used the `.opt' files.
Change the names created for unused arguments procedures
to include the arguments removed, rather than a sequence
number. I think Zoltan is working on a change to name
mangling, so I haven't updated the demangler.
compiler/prog_util.m:
Generate the new predicate names for unused_args.m.
library/std_util.m:
Add a polymorphic version of unit, which is useful
for binding type variables.
compiler/modules.m:
scripts/Mmake.vars.in:
Clean up files created by the analysis framework
in `mmake realclean'.
util/mdemangle.c:
profiler/demangle.m:
Document the change in the name mangling of procedures with
unused arguments.
configure.in:
Check for state variables and fixes for some typeclass bugs.
tests/warnings/Mmakefile:
tests/warnings/unused_args_analysis.{m,exp}:
Test case.