Fix bug #309

Make existential casts from dummy types assign the value NULL rather than
reading a bogus value.

Bug #309 occurs when a dummy type is existentially quantified and the
resulting existentially typed value needs to get placed on the stack for
some reason.  The stack slot chosen in these cases has a negative stack slot
number, as it was allocated for the dummy typed value, this can cause the
code generator to crash.

We fix this by transforming an existential cast from a dummy type to an
assignment of the value zero during LLDS code generation.  Normally these
casts are transformed to copies from the old variable's rval into the new
variable's lval.  This fixes the problem because a constant such as zero
does not need a stack slot.  Using zero rather than an arbitrary value (that
may have been left in a register) may also minimise the amount of pointers
kept to memory that could be freed.

compiler/call_gen.m:
    As above.

tests/valid/exists_dummy.m:
tests/valid/Mmakefile:
    Added a test case for bug #309
Make Mercury compile with Visual Studio 2013 (MSVC 12.0).

Fix some problems that were preventing the system from compiling properly with
MSVC.

(1) Visual Studio 2013 no longer includes the files NtWin32.Mak and Win32.Mak
which are required for building the Boehm GC with MSVC.  (This appears to be an
issue with upstream Boehm as well.)  The workaround here is to reference the
copies of this files included with the Windows 7 SDK.  (This appears to be the
official Microsoft workaround for dealing with this problem for now.)

(2) Disable support for `--c-debug' when using MSVC.  Using this option causes
MSVC to emit .pdb (Program Data Base), that contain the symbol information for
an object files.  This causes a variety of problems:

   (i) parallel builds are contending for the vc*.pdb file shared by all the
   object files in a directory causing compilation to abort.  (Compiling with
   the -FS option is another solution to this -- it causes the compiler to
   serialize access to the .pdb file -- but at the cost of slowing down
   compilation.)

   (ii) .pdb files are not cleaned up by realclean; compilation will abort
   if a pdb file generated by a different version of MSVC is encountered.

   (iii) we don't install the .pdb files alongside the libraries anyway.
   This can be a source of linker warnings.  (And shutting up the Microsoft
   linker seems to be very difficult indeed ...)

   (iv) compiling with -Zi (apparently) inhibits some C compiler optimizations.

Compiling with the older -Z7 (MSVC 7 style debugging info) option is another
alternative.  Using that option causes MSVC to include symbol information in
the object files, instead of in a separate file.

For now (i.e. the 14.01 release), disabling `--c-debug' for MSVC is the
simplest way of addressing the above issues.

README.MS-VisualC:
	Describe the problem with NtWin32.Mak and Visual Studio 2013 and
	provide two possible workarounds.

	Mention that `--c-debug' is not currently supported with MSVC and how
	to re-enable it.

	Simplify some of the instructions for setting up the build environment.

configure.ac:
scripts/mgnuc.in:
	Disable `--c-debug' with MSVC.

scripts/prepare_install_dir.in:
	Copy all makefile fragments for nmake into the boehm_gc directory for
	the library grade installation.  (This is in case the user copies
	NtWin32.Mak etc into the boehm_gc directory as per the second of
	the workarounds in README.MS-VisualC.)

slice/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	Clean up any .pdb files.  Note that one is generated for each
	executable (regardless of whether -Zi is given to cl or not).
 	In addition, if -Zi is given to cl, there will be file named
	vc<version>.pdb generated (where <version> is the version of MSVC being
	used.)
Avoid compiler warnings from MSVC in generated code.

runtime/mercury_float.h:
	Avoid warnings from MSVC about the types of the formal and actual parameters
	of calls to MR_float_from_dword differing.  The formal parameters have type
	MR_Word, but the Mercury compiler doesn't emit casts for the arguments.
	(For GCC and clang, MR_float_from_dword is defined as a macro and the
	necessary casts occur in its body.)  The fix is to rename the function
	version of MR_float_from_dword and make MR_float_from_dword a forwarding macro
	that inserts the necessary casts.
Avoid C compiler warnings on OS X with Xcode 5.

In the mgnuc script, do not use the name of the C compiler to determine its
type since on OS X with Xcode 5 the executable "gcc" is actually clang.
Instead use the value of C_COMPILER_TYPE determined by the configure script to
set C compiler type, as elsewhere in the Mercury system.

Incorrectly identifying the C compiler type was resulting in lots of
compilation warnings because we were using the warning flags intended for GCC
with clang.  Further warnings were being generated because GCC-only
optimization flags would also be passed to clang.

scripts/mgnuc.in:
	As above.
Update README.MacOS.

Update README.MacOS to cover version 10.9  (Xcode 5).

README.MacOS:
	Add a contents section to the top of this file.

	Merge the sections covering Mac OS X 10.5 - 10.8 into one section that
	also covers 10.9.

	The source distribution will no longer be built in the none.gc grade.

	Add separate sections discussing Xcode 4 and Xcode 5 specific issues.

        Mention that Homebrew and Fink are also a source of GCC packages for
   	Mac OS X (in addition to MacPorts).

	Mac OS 10.3 was only supported on PowerPC machines, not as we seem
	to suggest here also Intel machines.
Conform to changes in libhwloc's API (Bug #289)

The 'cpuset' functions in libhwloc have been made more generic and renamed
to 'bitmap' functions.  This patch updates the Mercury runtime system
appropriately.

runtime/mercury_context.c:
    As above.

configure.ac:
    We now require at least version 1.1 of libhwloc (previously we required
    at least 1.0).
Merge fix for bug 302 onto 14.01 branch.

Merge commit '15cb7cf721ae2d04ce5bcd7702b63a41fd5c7b8c' into version-14_01-branch
Fix compilation errors in the tcltk binding.

Add the MR_ prefix to list_empty and list_tail calls.

extras/graphics/mercury_tcltk/mtcltk.m:
    In line 157, the MR_ prefix was missing from the list_empty and
    list_tail calls.
Mention portability improvements in 14.01 NEWS.

NEWS:
	As above.
Fix compilation errors in extras.

extras/curs/samples/demo.m:
extras/curs/samples/frogger.m:
extras/posix/hello.m:
	Update library calls where necessary.
Fix more compilation errors in extras.

extras/trailed_update/tr_store.m:
	Conform to runtime changes.

extras/gator/genotype.m:
extras/gator/phenotype.m:
extras/graphics/samples/maze/maze.m:
extras/trailed_update/samples/interpreter.m:
	Conform to standard library changes.
Fix extras/trailed_update/samples/vqueens.m.

extras/trailed_update/samples/vqueens.m:
	Use higher-order any insts to avoid the mode error in this module.

extras/trailed_update/var.m:
	Add extras modes to the freeze predicates that take closures with inst
	any.  (XXX This module could do with a re-write since Mercury now
	implements many of the features that had to be hacked around when
	it was written.)
Merge branch 'version-14_01_01-features' into version-14_01-branch
Merge branch 'version-14_01-branch'
Merge compiler notes

We had been maintaining two copies of these notes, this change attempts to
merge them into one set.  The cononical location for these notes is here in
compiler/notes/, they will be removed from the www repository.

I've also updated a number of URLs.

compiler/notes/allocation.html:
compiler/notes/bootstrapping.html:
compiler/notes/coding_standards.html:
compiler/notes/compiler_design.html:
compiler/notes/gc_and_c_code.html:
compiler/notes/glossary.html:
compiler/notes/release_checklist.html:
compiler/notes/reviews.html:
compiler/notes/todo.html:
compiler/notes/work_in_progress.html:
    Merge in differences with the versions of these files in the www
    repository.  Most differences are trivial.

compiler/notes/bytecode.html:
compiler/notes/c_coding_standard.html:
compiler/notes/developer_intro.html:
    Add files that were missing from the main repository but were on the
    website.
Update reviews document

We now use git and github rather than CVS.  I've updated our code review
process document to refer to git and its workflow rather than CVS.

I've also fixed some spelling errors and changed some formatting.

compiler/notes/reviews.html:
    As above.
Fix some documentation.

Fix some errors in the documentation of {string_writer,io}.{print,write}.

Clean up the formatting of the same documentation.

library/stream.string_writer.m:
	Fix a cut-and-paste errors: there is no string_writer.print/3
	predicate.

	s/pragma foreign_code/pragma foreign_type/ in a spot where
	the latter was meant.

	Refer to the destination stream as a string writer stream, rather
	than an output stream.

library/io.m:
	s/pragma foreign_code/pragma foreign_type/ in a spot where
	the latter was meant.
Fix a problem installing mfilterjavac on Windows.

mfilterjavac/Mmakefile:
	Don't accidentally drop the .exe extension in the install target.
Add io.{write,print}_line to the standard library.

Add the predicates io.write_line and io.print_line to the standard library.
These are versions of io.write and io.print respectively, that in addition to
printing their argument also print a final newline.  While this is no different
to calling io.{write,print} and then calling io.nl, it is a little more concise
which can be convenient in some circumstances.

library/io.m:
	Add the above predicates.

compiler/error_util.m:
	Avoid ambiguity with the write_line/3 predicate defined
	in this module.

NEWS:
	Announce the new predicates.

tests/hard_coded/write.m:
	Use up-to-date syntax in this module.

	Call write_line in a few spots.
Merge branch 'version-14_01-branch'