Commit Graph

5 Commits

Author SHA1 Message Date
Julien Fischer
06263977eb Enable all of hard_coded/java_test.
tests/hard_coded/java_test.m:
     Enable the commented out bits of this test: they now work.

     Update syntax throughout.
2016-04-26 15:49:13 +10:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Peter Wang
c053f90088 Allow inlining of Java foreign_procs.
Branches: main, 10.04

Allow inlining of Java foreign_procs.

This revealed a problem with directly using the `succeeded' flag directly as
the success indicator in Java foreign_procs.  When the code of the foreign_proc
becomes a nested function, and after nested functions are eliminated, there may
not be a variable called `succeeded' in that context; it is moved into
environment struct, and the transformation is not able to update handwritten
code to reflect that.  The solution is to declare a local variable for the
foreign_proc, let the handwritten code assign that, then assign its final
value to the `succeeded' flag with an MLDS statement.

We take the opportunity to name the local variable `SUCCESS_INDICATOR', in
line with other backends.

compiler/inlining.m:
        Allow inlining of Java foreign_procs.

compiler/ml_foreign_proc_gen.m:
        In the code generated for semidet Java foreign_procs, declare a local
        `SUCCESS_INDICATOR' variable and assign its value to the `succeeded'
        flag afterwards.

        Add braces to give the foreign_proc variables a limited scope.

compiler/make_hlds_warn.m:
        Conform to renaming.

doc/reference_manual.texi:
        Update documentation for the renaming of the `succeeded' variable.

library/array.m:
library/bitmap.m:
library/builtin.m:
library/char.m:
library/construct.m:
library/dir.m:
library/exception.m:
library/float.m:
library/int.m:
library/io.m:
library/math.m:
library/private_builtin.m:
library/rtti_implementation.m:
library/string.m:
library/thread.m:
library/time.m:
library/type_desc.m:
library/version_array.m:
        Conform to renaming.

        Fix problems with Java foreign_procs that may now be copied into other
        modules when intermodule optimisation is enabled, some by disallowing
        the procedures from being duplicated, some by making referenced
        classes/fields `public'.

        [Some of the `may_not_duplicate' attributes may not indicate actual
        problems, just that it seems not worthwhile inlining calls to the
        procedure.]

extras/solver_types/library/any_array.m:
tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/external_unification_pred.m:
tests/hard_coded/java_test.m:
tests/hard_coded/redoip_clobber.m:
tests/hard_coded/user_compare.m:
tests/valid/exported_foreign_type2.m:
tests/warnings/warn_succ_ind.m:
tests/warnings/warn_succ_ind.exp3:
        Conform to renaming.
2010-05-07 03:12:27 +00:00
Peter Wang
c2b1704378 Fix I/O problems in Java backend.
Branches: main

Fix I/O problems in Java backend.

library/io.m:
        Don't write to System.out directly in io.write_*/3.  io.write_*/4
        works with a stream layered on top of System.out, and mixing the two
        sets of predicates results output coming out in the wrong order.

        In MR_MercuryFileStruct.put and MR_MercuryFileStruct.write flush a
        text output stream if a newline is written, otherwise the user is
        liable to not see any output at all (the buffering is very
        aggressive).

tests/hard_coded/csharp_test.m:
tests/hard_coded/java_test.m:
        Update some old :- pragma foreign_* syntax.
2009-05-07 07:42:16 +00:00
Fergus Henderson
6829b9db37 Document the Java foreign language interface.
Estimated hours taken: 4
Branches: main

doc/reference_manual.texi:
	Document the Java foreign language interface.

	A few minor changes elsewhere in the foreign language interfacing
	chapter.  In particular, be consistent about how the language
	name is specified in foreign language interfacing pragmas.

tests/hard_coded/Mmakefile:
tests/hard_coded/java_test.m:
tests/hard_coded/java_test.exp:
	Add a test of the Java foreign language interface.

tests/hard_coded/Mmakefile:
tests/hard_coded/csharp_test.m:
tests/hard_coded/csharp_test.exp:
	Enable the test of the C# foreign language interface.
2003-12-05 05:15:14 +00:00