Replace a dummy pred_id in a trace goal.

compiler/polymorphism.m:
	Replace a dummy pred_id in a trace goal to that which was
	intended, judging by the preceding comment.
Fix inst for constant type_infos.

The inst for type_infos entered into the const_struct database did not
count the type_ctor_info argument, thus the cons_id arity was off by one.
Bug #297.

compiler/polymorphism.m:
        Account for the type_ctor_info when making the inst for a constant
        type_info.

tests/hard_coded/Mercury.options:
tests/hard_coded/Mmakefile:
tests/hard_coded/type_info_const_inst.exp:
tests/hard_coded/type_info_const_inst.m:
        Add test case.

NEWS:
        Announce the change.
Detection of standard library grades.

Currently, the set of installed standard library grades is hardcoded in
Mercury's configuration file (and some other spots, but they are not relevant
here).  This change modifies the compiler so it can scan the standard library
directory at runtime in order to determine what library grades are installed.
This removes the need for the set of library grades to be specified in the
configuration file at all.  Adding or removing grades from an existing
installation should now not require changes to any configuration files
(provided you don't use mmake -- see below).

In the case where the library grades are specified in the Mercury.config file
and library grade detection is also enabled, the detected grades will override
any --libgrade settings from the Mercury.config file.

Detection of library grades is not supported with mmake and I don't have any
plans to support it.  mmake will just use the set of grades with which the
installation was configured.

compiler/options.m:
	Add a new option `--detect-libgrades' that can be used to control
	the new feature.  For now, this is a developer-only option and is
	disabled by default -- I will document it properly when it is enabled
	by default.

compiler/mercury_compile.m:
	Scan the standard library directory to see what grades are installed
	and set the options necessary to make the set of library grades those
	that were detected.

compiler/options_file.m:
	Add a predicate for looking up the value of the MERCURY_STDLIB_DIR
	variable.
Workaround crashes in parallel grades with gcc 4.6+ (bug #294)

configure.ac:
    Test for and enable --fno-reorder-functions which works around this
    issue.
Merge branch 'version-13_05-branch'
Fix a bug with --detect-libgrades and --make.

compiler/mercury_compile.m:
	Ensure that any extra flags introduced by --detect-libgrades
	get put into mmc --make's option cache.  If this does not
	happen the correct set of library grades will not be passed
	to processes invoked by mmc --make.

	Add --verbose and --very-verbose output to library grade
	detection.
Enable library grade detection by default.

Use -R instead of -r with cp by default.

Fix some documentation errors.

compiler/options.m:
	Enable library grade detection by default.

	Document the --no-detect-libgrades option.

	Make the default install command dir option, -R,
	rather than -r.  The former is more portable.

scripts/Mercury.config.in:
	Do not hardcode the set of library grades at configuration time.

compiler/mercury_compile.m:
	Do not clear the library grade set before adding any detected
	grades since doing so also prevents additional grades being
	specified via the LIBGRADES variable.

doc/user_guide.texi:
	Document --no-detect-libgrades.

	Replace some uses of `:' as a module qualifier.

	Fix a typo: s/outut/output/.
Fix compiler abort during liveness detection.

The compiler would abort during liveness detection on an if-then-else goal
with an unreachable Then branch, due to the Then goal not having its
liveness-related fields initialised.  Bug #51.

compiler/liveness.m:
	    As above.

tests/valid/Mercury.options:
tests/valid/Mmakefile:
tests/valid/bug51.m:
	    Add test case.

NEWS:
	    Announce the change.
Merge branch 'version-13_05-branch'
Disable library grade detection when building Mercury itself.

Library grade detection causes the library installation for the csharp grade
(and probably any grades that use mmc --make) to fail.  (There is likely
a better solution than this, e.g. making --no-mercury-stdlib-dir imply
--no-detect-libgrades, but the handling of command line options in this
part of the compiler is pretty convoluted, so I will look into that
separately.)

browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
	As above.
Check that the compiler supports --no-detect-libgrades.

configure.ac:
	As above.
Fix another problem with --detect-libgrades and --make.

Uses of --no-libgrade and --libgrade in Mercury.options files should override
any detected library grades.  For example, in a directory with a Mercury.options
file that contains

   MCFLAGS = --no-libgrade

we should expect "mmc --output-libgrades" to print nothing.  This was not the case.

compiler/mercury_compile.m:
	Do not combine the detected library grade flags with the ones from
	the command line options.  We need to keep them separate because
	they must be injected into the overall set of command line options
	before any flags from Mercury.options files.

	Add a note about a theoretical problem with DEFAULT_MCFLAGS and
	detected library grades.  It is not a problem in practice because
	the entire point of detected library grades was to avoid passing
	any information about library grades via DEFAULT_MCFLAGS.

	Thread the set of flags from detected grades down to places where
	they are needed.

	If the library grade set is empty, don't print out a single newline
	with --output-libgrades.

compiler/make.m:
compiler/make.program_target.m:
compiler/make.util.m:
	Pass the set of detected grade flags to where they are needed.