Commit Graph

17179 Commits

Author SHA1 Message Date
Julien Fischer
d256d24ea5 Drop support for OSF/1.
configure.ac:
	Drop support for OSF/1.

	Delete more IRIX stuff.

configure.ac:
runtime/mercury_conf.h.in:
runtime/mercury_thread.h:
	Delete workarounds required when using the Digital Unix pthreads
	library.

Mmake.common.in:
runtime/mercury_wrapper.c:
	Delete stuff for IRIX.

README.OSF1:
	Delete this file.

.README.in:
	Delete the pointers to the readme files for IRIX and OSF/1.

NEWS:
	Announce the dropping of support for OSF/1.
2014-06-16 15:08:05 +10:00
Julien Fischer
77e527f92b Minor rewording of README.{AIX,HPUX}.
README.AIX:
	As above.

README.HPUX:
	As above, plus fix a cut-and-paste error.
2014-06-16 13:56:43 +10:00
Julien Fischer
da68ce71cc Delete files resurrected by the conversion to git.
scripts/ml.sh:
scripts/mmake.sh:
	As above.
2014-06-16 13:47:23 +10:00
Julien Fischer
c10c96661a Drop support for Mercury on IRIX.
IRIX itself is more or less dead and the Mercury support for it has not been
tested for many years.

configure.ac:
compiler/notes/overall_design.m:
doc/user_guide.texi:
scripts/mgnuc.in:
	As above.

NEWS:
	Announce the above.
2014-06-16 13:44:12 +10:00
Julien Fischer
e37d5c5eab Structured errors for getopt and getopt_io.
The getopt and getopt_io modules use strings to describe errors that occur
during option processing.  There are a couple of problems with doing this:

(1) it makes some assumptions about how client programs want to word, and to a
large extent, format these error messages.

(2) it assumes that the error messages are in English.

This diff changes the getopt and getopt_io modules to use structured
representations of errors instead of strings.  This structured representation
is defined by the new option_error/1 type.  We introduce new versions of the
various process_options predicates that are suffixed with "_se" (standing for
"structured error") that return values of type option_error/1 when an error occurs.
A new function, option_error_to_string/1, converts option_error/1 values into
the strings that the getopt and getopt_io modules previously generated.  The
existing process_options predicates are just wrappers around all of this for
the purposes of backwards compatibility.

The new option_error/1 type returns more information than existing error
messages require, for example, where possible we return both the element of the
option enumeration involved and a string giving the option as it actually
appeared on the command line.

library/getopt.m:
library/getopt_io.m:
	Add predicates and types for structured errors as described above.

	Group function clauses together with the corresponding predicate
	ones.

	Avoid unnecessary differences between these two modules in a few
	spots.

NEWS:
	Announce the above changes.
2014-06-16 12:12:33 +10:00
Julien Fischer
9ab33965be Merge branch 'version-14_01-branch' 2014-06-03 09:53:08 +10:00
Paul Bone
e6d0b4e994 Fix mandelbrot's --help message.
Fix a missing newline and document the --parallel option.

benchmarks/progs/mandelbrot/mandelbrot.m:
    As above.
2014-05-28 14:59:56 +10:00
Paul Bone
0263fdd7c1 Merge branch 'readme'
Merge in the changes that introduce and fxiup the README.md file.
2014-05-28 14:29:21 +10:00
Paul Bone
0efd461861 Make Julien's review suggestions
README.md:
    Remove references to lcc (hasn't been tried with Mercury for years)
    and the old .NET backend from README.md (likely to cause confusion
    more than anything else).

README.md:
README.IRIX-5:
    Remove the references to IRIX-5 (including the file README.IRIX-5)
    completely.  IRIX is pretty much dead, this documentation is pretty
    much clutter at this point.

README.AIX:
README.HPUX:
    Replacing the contents of README.HPUX and README.AIX to say that
    Mercury (to the best of our knowledge) hasn't been tried with recent
    versions of those OSs.
2014-05-28 12:39:42 +10:00
Peter Wang
4a5b97ce4c Edit README.md
README.md:
    Fixed whitespace.

    Made more succinct.
2014-05-28 12:30:13 +10:00
Peter Wang
105779a305 Merge branch 'version-14_01-branch' 2014-05-27 16:21:49 +10:00
Peter Wang
992e5b37eb Merge branch 'version-14_01-branch' 2014-05-27 16:21:32 +10:00
Peter Wang
98629b177c Fix no_refs_to_deleted_labels failures.
MR_LOWLEVEL_DEBUG is set when compiling the no_refs_to_deleted_labels
test case to give MR_init_label macros some effect.  However
MR_LOWLEVEL_DEBUG implies MR_DEBUG_GOTOS, and leads to link errors if
the runtime was not built with MR_DEBUG_GOTOS.

tests/hard_coded/Mercury.options:
	Replace MR_LOWLEVEL_DEBUG with MR_DEBUG_LABEL_NAMES,
	implying MR_INSERT_LABELS but not MR_DEBUG_GOTOS.
2014-05-27 16:02:42 +10:00
Paul Bone
154cdf195b Make a number of changes to the README.md file
README.md:
    Reorder the list or README files to that they occur from most relevant
    to new users to least relevant.  In particular put commonly-used
    backends and platforms earlier in the list.

    Provide some introductory text that introduce the user to the multiple
    backends available.

    Add further links to more information such as the documentation.

    Add text so that the file reads more natrually.
2014-05-27 14:32:55 +10:00
Sebastian Godelet
23c47465d2 README.md changes
README.md:
    Changed intro to www.mercurylang.org introduction.

    Added a NOTES and LIMITATIONS section.

    Added a link to the README.bootstrap.
2014-05-27 14:31:36 +10:00
Sebastian Godelet
8a819ea004 Create README.md
(Commit log by Paul Bone)

Github will automatically format and display a file named README.md in the
root directory of any project.  This can be helpful to, at a minimum, direct
anyone browsing github to the project's website.  Sebastian has contributed
the following README.md.

README.md:
    New markdown-formatted README file for github.
2014-05-27 14:31:36 +10:00
Peter Wang
b7414177cf Merge fix for bug #330 into version-14_01-branch
Commit 5254245ae3 was inadvertently
merged onto version-14_01-branch but NOT the subsequent fix in
commit 8c72b1e5c0
2014-05-27 13:44:41 +10:00
Peter Wang
011e7688c7 Do not escape character strings in internal atom representation.
The internal representation of a character constant as an atom term
should not use escaped character syntax; the escaping should occur
when writing the external representation only.

compiler/hlds_out_mode.m:
compiler/intermod.m:
compiler/prog_util.m:
compiler/type_constraints.m:
compiler/typecheck.m:
	Fix instances of the bug.

tests/valid/Mercury.options
tests/valid/Mmakefile
tests/valid/intermod_char.m
tests/valid/intermod_char2.m
	Add test case.  The .opt file was invalid because the character
	in the clause head was doubly-escaped.
2014-05-26 15:28:53 +10:00
Paul Bone
1bb59e4be4 Merge branch 'version-14_01-branch'
Merge recent changes on the release branch into the master branch.  This
includes a couple of changes to the NEWS file plus a fix for resource leaks
in the dir standard library module.
2014-05-23 15:24:24 +10:00
Paul Bone
7a2396eec0 Add an option to mandelbrot to make it easier to test parallelism
Add a --parallel command line option to the mandelbrot benchmark that can be
given to use explicitly parallelised routines.  This makes it easier to turn
on and off explicit parallelism, depending on your testing needs.

benchmarks/progs/mandelbrot/mandelbrot.m:
    As above
2014-05-23 15:15:53 +10:00
Paul Bone
923ce41f53 Make the thread_barrier_test a conditional test.
When I added this test recently I forgot to make it condition on any grade
with a par component, or the java and csharp grades.  This patch fixes this.

tests/hard_coded/Mmakefile:
    As above.
2014-05-20 15:54:25 +10:00
Julien Fischer
08cf4e5787 Announce recent fixes to the MinGW and MinGW64 ports.
NEWS:
	As above.
2014-05-19 14:52:30 +10:00
Peter Wang
5982c44df9 Fix resource leaks in dir fold predicates.
The directory stream was not closed if dir.open succeeded in opening
the directory, but failing to read the first entry (which may be as
simple as an empty directory).

The directory stream was also not closed when dir.foldl2_process_dir2
returns an error value.

library/dir.m:
	As above.

tests/hard_coded/Mmakefile:
tests/hard_coded/dir_fold.exp:
tests/hard_coded/dir_fold.m:
	Add regression test.

NEWS:
	Announce change.
2014-05-19 14:52:30 +10:00
Julien Fischer
7fbfd779bf Re-enable executable stripping on Mac OS X.
configure.ac:
	Pass -x to strip when linking an executable against Mercury shared
	libraries on Mac OS X.

	Make the up-to-date check require {14.01.-beta,rotd}-2014-05-05
        or later.

scripts/Mercury.config.in:
	Set the default values of --strip-executable-{shared,static}-flags.
2014-05-19 14:52:30 +10:00
Paul Bone
4f46d28e67 Fixes for lex_demo.m
lex_demo.m wasn't compiling because io.print_line doesn't exist.  I also
found that drawing the "> " prompt wasn't working as expected.  This patch
fixes both these issues.

extras/lex/samples/lex_demo.m:
    As above.
2014-05-19 12:49:28 +10:00
Sebastian Godelet
05745a70bb Added the times operator for regular expressions, such that one can express
/[a-z]{10}/ in this way: `Regex = range('a', 'z') * 10'.

extras/lex/lex.m:
    Removed unused and unsafe str_foldr function,
    added (T * int) = regexp function.

extras/lex/samples/lex_demo.m:
    Removed whitespace in comments,
    added an input prompt,
    added a lexeme for '//' C++ comments using the new '*' operator.
2014-05-19 11:32:39 +10:00
Paul Bone
39caed9793 Add a test case for barriers and fix a bug.
This test case is based off Sebastian Godelet's work, which found a bug that
can occur when release/3 is called on a barrier and then other calls to
wait/3 are made.  The final call to wait/3 tries to execute the normal
'unblock the barrier' code and deadlocks there because the barrier is
already unlocked, specifically a value is already present in the "Go" mvar.
Thanks Sebastian for your test case.

library/thread.barrier.m:
    Handle release/3 properly: release/3 now sets the number of remaining
    threads to reach the barrier to zero, and wait/3 will determine why this
    iz zero (it's normally at least one), and if it is because release was
    called then no error is raised.  The other reasion why the number of
    remaining threads may be zero is because wait has been called too many
    times, in this case wait/3 will throw an exception.

tests/hard_coded/Mmakefile:
tests/hard_coded/thread_barrier_test.exp:
tests/hard_coded/thread_barrier_test.m:
    Add new test case.

tests/hard_coded/thread_test_utils.m
    This module contains code that may be useful for other concurrency
    tests.
2014-05-16 20:16:07 +10:00
Paul Bone
8ad499c685 Add barriers (for concurrency) to the standard library
Mission Critical IT has maintained a library of code for concurrent
programming.  We're happy to contribute this upstream to the Mercury
project starting with this module implementing barriers.

library/thread.barrier.m:
    Add the new module implementing barriers.

library/thread.m:
library/library.m:
    Add new module.

NEWS:
    Announce the new module.

library/thread.semaphore.m:
    Add a comment.
2014-05-16 20:15:32 +10:00
Julien Fischer
81e887e13b Announce recent fixes to the MinGW and MinGW64 ports.
NEWS:
	As above.
2014-05-13 15:43:08 +10:00
Peter Wang
9d347695c0 Fix resource leaks in dir fold predicates.
The directory stream was not closed if dir.open succeeded in opening
the directory, but failing to read the first entry (which may be as
simple as an empty directory).

The directory stream was also not closed when dir.foldl2_process_dir2
returns an error value.

library/dir.m:
	As above.

tests/hard_coded/Mmakefile:
tests/hard_coded/dir_fold.exp:
tests/hard_coded/dir_fold.m:
	Add regression test.

NEWS:
	Announce change.
2014-05-13 14:48:51 +10:00
Paul Bone
cb161d6155 Merge pull request #13 from mgudemann/integer_arithmetic
Add integer multiplication based on Karatsuba's algorithm
2014-05-11 14:22:30 +10:00
Julien Fischer
688df8e1b5 Re-enable executable stripping on Mac OS X.
configure.ac:
	Pass -x to strip when linking an executable against Mercury shared
	libraries on Mac OS X.

	Make the up-to-date check require {14.01.-beta,rotd}-2014-05-05
        or later.

scripts/Mercury.config.in:
	Set the default values of --strip-executable-{shared,static}-flags.
2014-05-06 14:36:53 +10:00
Julien Fischer
7037283418 Merge branch 'version-14_01-branch' 2014-05-05 17:14:59 +10:00
Julien Fischer
25f1e936a0 Fix executable stripping on Mac OS X.
Stripping executables on Mac OS X that were built with --mercury-linkage=shared
was resulting in the symbols for the global variables introduced for runtime
trace goal env flags being incorrectly removed.  We need to pass the "-x" flag
to strip to prevent this happening.  This diff adds the ability to pass
different flags to strip depending on the value of --mercury-linkage.

compiler/options.m:
	Add two new options, --strip-executable-{shared,static}-flags, that
	specify what flags are passed to the strip command when --mercury-linkage
	is set to shared or static respectively.

	Add a new option to test that the compiler is sufficiently up-to-date.

compiler/compile_target_code.m:
	Implement the new options.

doc/user_guide.texi:
	Document the new options.

NEWS:
	Adjust the entry for the --strip-executable-command option to mention
	the additional two new options.
2014-05-05 15:50:20 +10:00
Julien Fischer
af50f4e2a6 Merge branch 'version-14_01-branch' 2014-05-02 14:56:17 +10:00
Julien Fischer
96f188f34b Fix another build error on MinGW systems.
On MinGW system do not try to link against libpthread if that library is not
actually present on the system.  This is an issue in the compiler directory
because we link the compiler against the thread libraries regardless of the
grade.  This is due to the implementation of --make.

configure.ac:
	On MinGW, if we cannot find pthreads then set THREAD_LIBS to empty.
2014-05-01 15:32:28 +10:00
Julien Fischer
2d6e04826b Fix a build error on MinGW systems.
Some versions of the MinGW system headers rely on the types off_t and off64_t
being defined, but they will not be defined if -ansi is enabled.
(This seems to affect MinGW systems using GCC 4.8; I haven't checked other
GCC versions yet.)

configure.ac:
scripts/mgnuc.in:
	Do not compile with -ansi on MinGW systems.
2014-05-01 12:31:02 +10:00
Julien Fischer
ceb06a9ae8 Disable executable stripping on Mac OS X for now.
Currently attempting to run dynamically linked executables that are stripped
fails in the presence of programs that use env runtime trace goal conditions.
This is because stripping such executables with just "strip" (as we currently
do) removes the global variable introduced by env runtime trace goal
conditions.  (The long term fix is to invoke strip with the -x flag, but this
needs to be conditional on the value of --mercury-linkage and we currently
don't have the command line options to support that.)

configure.ac:
	Disable stripping of executables on Mac OS X.
2014-05-01 11:47:10 +10:00
Julien Fischer
208b99b879 Fix a problem that broke low-level C grades on Windows.
runtime/mercury_debug.c:
	Protect a reference to the memory zone hardmax with MR_PROTECTPAGE.
2014-04-30 12:11:27 +10:00
Julien Fischer
a9fbc1e528 Only define MR_nondetstack_inclusion_check in low-level C grades.
runtime/mercury_overflow.c:
	As above: compiling this function in high-level C grades
	will fail since it refers to fields of the MR_Context
	structure that do not exist in those grades.
2014-04-22 10:44:02 +10:00
Zoltan Somogyi
41e75fcc78 Fix breakage.
runtime/mercury_stacks.c:
   Fix typo.
2014-04-19 12:31:02 +10:00
Zoltan Somogyi
8d75bd09ea Fix comment. 2014-04-18 02:02:35 +10:00
Zoltan Somogyi
f6fafa150d Fix Mantis bug 314 for temp frames created by nondet procedures.
Also fix some bugs in related code, and improve the related debugging
infrastructure.

-------------------

runtime/mercury_stacks.[ch]:
   Fix bug 314 for temp frames created by nondet procedures. The fix will
   probably also work for *det* procedures that create temp frames on the
   nondet stack, but I can't think of a way to test that, because det
   procedures create such frames only in very specific circumstances,
   and I cannot think of a way to nest a recursive call inside those
   circumstances.

   The problem was that when we were creating new temp frames on
   the nondet stack, we did not check whether the current nondet stack segment
   had room for them. We now do.

   The stack trace tracing code needs to know the size of each nondet stack
   frame, since it uses the size to classify frames as temp or ordinary.
   The size is given by the difference in address between the address of the
   frame and the address of the previous frame. This difference would yield
   an incorrect size and hence an incorrect frame classification if a temp
   frame were allowed to have a frame on a different segment as its
   immediate predecessor.

   We prevent this by putting an ordinary (i.e. non-temp) frame at the bottom
   of every new nondet stack segment as a sentinel. We hand-build this frame,
   since it is not an "ordinary" ordinary frame. It is not created by a call,
   so it has no meaningful success continuation, and since it does not make
   any calls, no other frame's success continuation can point to it either.

   If backtracking reaches this sentinel frame, we use this fact to free
   all the segments beyond the one the sentinel frame is in, but keep the
   frame the sentinel frame is in, since we are likely to need it again.

   Document the reason why MR_incr_sp_leaf() does not have to check
   whether a new stack segment is needed. (See the fix to llds_out_instr.m
   below.)

runtime/mercury_stack_trace.[ch]:
   When traversing the nondet stack, treat the sentinel frame specially.
   We have to, since it is an ordinary frame (i.e. it is not a temp frame),
   but it is not an "ordinary" ordinary frame: it does not make calls,
   and hence calls cannot return to it, and it does not return to any
   other frame either. It therefore does not have the layout structures
   (label and proc) that the nondet stack traversal expects to find.

   Fix an old bug: the nondet stack traversal used a simple directional
   pointer comparison to check whether it has reached the bottom of the nondet
   stack. This is NOT guaranteed to work in the presence of stack segments:
   depending on exactly what addresses new stack segments get, a stack frame
   can have an address BELOW the address of the initial stack frame
   even if it is logically ABOVE that stack frame.

   Another old bug was that a difference between two pointers, which could
   be 64 bit, was stored in an int, which could be 32 bit.

   The nondet stack traversal code used a similar directional comparison
   to implement optionally stopping at an arbitrary point on the nondet stack.
   Fixing this facility (the limit_addr parameter of MR_dump_nondet_stack)
   while preserving reasonable efficiency would not be trivial, but it would
   also be pointless, since the facility is not actually used. This diff
   deletes the parameter instead.

   Move some loop invariant code out of its loop.

trace/mercury_trace_cmd_developer.c:
trace/mercury_trace_external.c:
   Don't pass the now-deleted parameter to mercury_stack_trace.c.

runtime/mercury_wrapper.c:
   Record the zone of the initial nondet stack frame, since the fix
   of mercury_stack_trace.c needs that info, and it is much more efficient
   to set it up just once.

tests/hard_coded/bug314.{m,exp}:
   The regression test for this bug.

tests/hard_coded/Mercury.options:
   Compile the new test case with the options it needs.

tests/hard_coded/Mmakefile:
   Enable the new test case.

-------------------

runtime/mercury_wrapper.c:
   The compiler knows the number of words in a stack frame it is creating,
   not necessarily the number of bytes (though it could put bounds on that
   from the number of tag bits). Since this size must sync with the runtime,
   change the runtime's variable holding this size to also be in words.

   Note that similar changes would also be beneficial for other sizes.

compiler/llds_out_instr.m:
   Conform to the change in mercury_wrapper.c, fixing an old bug
   (mercury_wrapper.c reserved 128 BYTES for leaf procedures, but
   llds_out_instr.m was using that space for procedures whose frames
   were up to 128 WORDS in size.)

compiler/mercury_memory.c:
   Conform to the change in mercury_wrapper.c.

-------------------

runtime/mercury_memory_zones.h:
   Instead of starting to use EVERY zone at a different offset, do this
   only for the INITIAL zones in each memory area, since only on these
   is it useful. When the program first starts up, it WILL be using
   the initial parts of the det stack, nondet stack and heap, so it is
   useful to make sure that these do not collide in the cache. However,
   when we allocate e.g. the second zone in e.g. the nondet stack, we are
   no more likely to be beating on the initial part of any segment
   of the det stack than on any other part of such segments.

   If a new debug macro, MR_DEBUG_STACK_SEGMENTS_SET_SIZE is set (to an int),
   use only that many words in each segment. This allows the segment switchover
   code to be exercised and debugged with smaller test cases.

runtime/mercury_conf_param.h:
   Document the MR_DEBUG_STACK_SEGMENTS_SET_SIZE macro.

   Convert this file to four-space indentation with tabs expanded.

-------------------

runtime/mercury_overflow.h:
   Make abort messages from overflows and underflows more useful by including
   more information.

runtime/mercury_overflow.c:
   Add a new function to help with the better abort messages.
   Since this file did not exist before, create it.

runtime/Mmakefile:
   Add the new source file to the list of source files.

-------------------

runtime/mercury_debug.[ch]:
   Fix problems with the formatting of the debugging output from existing
   functions.

   Add new functions for dumping info about memory zones.

   Factor out some common code.

   Convert the header file to four-space indentation.

-------------------

runtime/mercury_grade.c:
   Generate an error if stack segments are specified together with stack
   extension

-------------------

trace/.gitignore:
util/.gitignore:
tests/debugger/.gitignore:
   List some more files.

-------------------

runtime/mercury_context.c:
runtime/mercury_engine.[ch]:
runtime/mercury_misc.h:
compiler/notes/failure.html:
   Fix white space.
2014-04-18 02:02:35 +10:00
Zoltan Somogyi
91ce3a67a2 Avoid a compiler abort when people put a period in the middle of a clause.
The abort was caused by the fact that when the parser found an item that
looks like a fact for an undeclared predicate, such as the predicate ','/,
it created a hlds_pred filled with a clause_info in which terms that the
user intended to be goals are instead taken to be terms. Any reference
to predicates in those terms are taken by purity-checking to be higher order
references, which need a mode declaration. If the reference is to a predicate
(such as ,/2) whose declaration is implicit, that mode declaration will be
missing.

The fix has two parts. First, do not generate an abort in purity checking
when finding the mode declaration of a predicate or function in (what seems to
be) a higher order term is missing. Second, do not generate implicit
declarations for ,/2, since this is NEVER what the user wants.

A third part of this diff is an improvement in the contexts we record
for terms, for better error messages. I noticed the need for this when
looking at the compiler's output for the new cases.

compiler/post_typecheck.m:
   When finding an apparent reference to a predicate or function with
   no mode declarations, do not abort; instead, report an error.

compiler/purity.m:
   Record the error reported by post_typecheck.m.

compiler/add_clause.m:
   If we see a clause for `,'/2, do NOT treat it as implicitly defining
   a ,/2 predicate. Instead, generate a situation-specific error message that
   mentions the usual cause of the error.

compiler/add_pred.m:
   Clean up the predicates that add the implicit predicate declarations
   by making them both update module_infos, and by putting their arguments
   into a consistent order.

compiler/make_hlds_passes.m:
   Do likewise for a couple of predicates here.

compiler/add_pragma.m:
   Conform to the change to add_pred.m.

compiler/superhomogeneous.m:
   When expanding a term such as

      line 1: p(a,
      line 2: p(b,
      line 3: c))

   associate line 2 with the unification of a fresh variable with b,
   and line 3 with the unification of a fresh variable with c. We used
   to use the context of the top level term, which in this case is line 1,
   instead.

   This makes the compiler generate better (less misleading) output for the
   ref_to_implicit_pred.m test case below, as well as in many other cases.

compiler/state_var.m:
   When replacing !.X or !:X with a fresh variable term, copy the context
   of the original functor term to the new variable term. Before the change
   to superhomogeneous.m, this wasn't needed since the context of that term
   was ignored, but now we use it.

tests/invalid/ref_to_implicit_pred.{m,err_exp}:
   New test case to test the first part of the fix.

tests/invalid/ref_to_implicit_comma.{m,err_exp}:
   New test case to test the second part of the fix.

tests/invalid/Mmakefile:
   Enable both new test cases.

tests/hard_coded/impl_def_literal.{m,exp}:
   Update this expected output for the more accurate contexts we now
   generate, and update the comment in the source code accordingly.

tests/invalid/ambiguous_overloading_error.exp:
tests/invalid/max_error_line_width.err_exp:
tests/invalid/transitive_import_class.err_exp:
tests/warnings/ambiguous_overloading.exp:
   Update these expected outputs for the more accurate contexts we now
   generate.
2014-04-17 23:14:49 +10:00
Peter Wang
a0a7b64d16 Make mmc --make account for source files disappearing.
mmc --make prints a grave error message when the source file of a module
can no longer be found:

** Module `foo' is imported or included by module `bar'.
** dependencies for `Mercury/int3s/foo.int3' do not exist: foo.m
** This indicates a bug in `mmc --make'.

compiler/make.module_dep_file.m:
	Check that the source file of a local `.module_dep' file still
	exists.  If it doesn't, delete the `.module_dep' file and ignore
	the information it contains.
2014-04-02 15:59:55 +11:00
Julien Fischer
a8619a4b50 Merge branch 'version-14_01-branch' 2014-04-01 12:16:24 +11:00
Julien Fischer
7dece9f7c2 Avoid more warnings from clang.
runtime/mercury_bitmap.c:
runtime/mercury_memory.c:
mdbcomp/rtti_access.m:
	As above.
2014-03-31 14:52:38 +11:00
Peter Wang
2139573e87 Add foreign include files to makefile dependencies files.
List files included by pragma foreign_decl and pragma foreign_code
declarations in the makefile dependencies file (`.d') generated for
a module.

The written dependencies are more conservative than necessary
(e.g. C target files should not depend on Java include files),
but I don't think any more effort is warranted.

compiler/module_imports.m:
	Add get_foreign_include_files to return a list of include files
	from a list of items.

compiler/modules.m:
	Add foreign include files when initialising the module_imports
	structure in grab_imported_modules. Otherwise it will be empty
	when the `.d' file is automatically generated as a side-effect
	of generating target code.

compiler/write_deps_file.m:
	Write include files from the module_imports structure into the
	`.d' file.

doc/reference_manual.texi:
	Update manual.

tests/invalid/Mmakefile:
	Make `missing_file' a phony target.  This change makes `make'
	aware of the dependency and report the error, instead of
	running the test case that checks the compiler's reaction
	to the missing file.
2014-03-31 12:28:36 +11:00
Sebastian Godelet
33a24b86e2 Improve C# and Java shell script launchers.
The generated shell script to launch C# executables did not use absolute
paths.  The C# and Java shell scripts were missing some variable
quoting, leading to problems with paths containing spaces.

compiler/compile_target_code.m:
	Assign the script directory to DIR and use that to launch the
	CLI interpreter.

	Quote the CLI_INTERPRETER and executable filename.

compiler/module_cmds.m:
	Quote Mercury-generated CLASSPATH in case the directory contains
	spaces.

	Make DIR absolute in case the script is invoked from a
	subdirectory.
2014-03-31 11:32:59 +11:00
Peter Wang
e2912f3935 Fix duplicate error message from mmc --make.
mmc --make reports a duplicate error message when a dependency file
cannot be found, e.g.

** Error: file `./foo' not found: file `./foo' not found

make.dependencies.m:
	Fix the problem.
2014-03-31 11:27:57 +11:00