Commit Graph

7 Commits

Author SHA1 Message Date
Zoltan Somogyi
fdd141bf77 Clean up the tests in the other test directories.
tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
    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 tests
    that check compiler error messages, expect the new line numbers.

browser/cterm.m:
browser/tree234_cc.m:
    Import only one module per line.

tests/hard_coded/boyer.m:
    Fix something I missed.
2015-02-16 12:32:18 +11:00
Julien Fischer
f4139d8d69 Remove support for the old C interface. The parser still recognises the old
pragmas but it now emits an error message saying what pragma in the "new"
foreign language interface to use instead.  (That will be deleted after the
next release.)

Remove support for nondet foreign code from the implementation.

Add some bits from the old C interface chapter of the reference manual,
about linking with C object files and the c_pointer type, to the chapter
on the foreign language interface; delete the rest.

Add an illustration of simulating nondet foreign code with Mercury clauses
and (semi)deterministic foreign_procs.

doc/reference_manual.texi:
	Delete the old C interface chapter.

	Add a section on linking against C object files to the C specific
	section of the foreign language interface chapter.  (The old version of
	this was quite mmake-specific, the new version attempts to minimise
	this.)

	Mention the c_pointer type in section on C foreign types.

	Mention that nondet foreign_procs are not allowed.  Give an example
	to use foreign code and nondeterminism.

compiler/prog_io_pragma.m:
	Emit error messages when any of the pragmas used by the old C interface
	are encountered.

compiler/prog_item.m:
	Delete the parse tree representation of import pragmas.

compiler/gcc.m:
	Replace `:- pragma import' declarations with `:- pragma foreign_proc'
	declarations for C.

compiler/add_heap_ops.m:
compiler/add_trail_ops.m:
compiler/add_pragma.m:
compiler/deep_profiling.m:
compiler/det_analysis.m:
compiler/equiv_type.m:
compiler/erl_call_gen.m:
compiler/foreign.m:
compiler/goal_util.m:
compiler/hlds_out_goal.m:
compiler/make_hlds_passes.m:
compiler/make_hlds_warn.m:
compiler/mercury_to_mercury.m
compiler/ml_code_gen.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/polymorphism.m:
compiler/pragma_c_gen.m:
compiler/proc_gen.m:
compiler/prog_data.m:
compiler/recompilation.version.m:
	Delete stuff related the old C interface.

tests/hard_coded_Mmakefile:
tests/hard_coded/inline_nondet_pragma_c.*:
tests/hard_coded/nondet_c.*:
tests/hard_coded/nondet_pragma_c_bug.*:
tests/hard_coded/pragma_import.*:
	Delete these tests.  The features they exercise are no longer
	supported.

tests/*/*.m:
	Replace uses of the old C interface with the new.
2010-09-10 05:15:05 +00:00
Peter Ross
2a3cfce258 Fix spurious errors in the test cases so that they pass in the grade il.
Estimated hours taken: 2
Branches: main

Fix spurious errors in the test cases so that they pass in the grade il.

tests/valid/big_foreign_type.m:
	Add C# implementations of the foreign types.

tests/valid/int64.m:
tests/valid/liveness_nonlocals.m:
tests/valid/subtype_switch.m:
tests/valid/tabled_for_io.m:
tests/valid/two_pragma_c_codes.m:
tests/valid/zero_arity.m:
	Provide default implementations of C pragma foreign_code.

tests/valid/intermod_impure2.m:
	Provide an il implementation of C pragma foreign_code.

tests/valid/spurious_purity_warning.m:
	Fix some determinism warnings.

tests/valid/typeclass_inlining_bug.m:
	Remove an unneeded abstract type.
2002-11-07 12:52:59 +00:00
Simon Taylor
b7c4a317e9 Add MR_ prefixes to the remaining non-prefixed symbols.
Estimated hours taken: 4
Branches: main

Add MR_ prefixes to the remaining non-prefixed symbols.

This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.

runtime/mercury_std.h:
	Add MR_ prefixes to bool, TRUE, FALSE, max, min,
	streq, strdiff, strtest, strntest, strneq, strndiff,
	strntest, NO_RETURN.

	Delete a commented out definition of `reg'.

runtime/mercury_tags.h:
	Add an MR_ prefix to TAGBITS.

configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
	Add an MR_ prefix to PIC.

runtime/mercury_conf_param.h:
	Allow non-prefixed PIC and HIGHTAGS to be defined on
	the command line.

runtime/mercury_bootstrap.h:
	Add backwards compatibility definitions.

RESERVED_MACRO_NAMES:
	Remove the renamed macros.

compiler/export.m:
compiler/ml_code_gen.m:
	Use MR_bool rather than MR_Bool (MR_Bool is
	meant to be for references to the Mercury type
	bool__bool).

runtime/mercury_types.h:
	Add a comment the MR_Bool is for references to
	bool__bool.

*/*.c:
*/*.h:
*/*.m:
	Add MR_ prefixes.
2002-02-18 07:01:33 +00:00
Simon Taylor
c66cea0665 Add MR_ prefixes to uses of configuration macros.
Estimated hours taken: 2.5
Branches: main

Add MR_ prefixes to uses of configuration macros.
Bootcheck now succeeds with MR_NO_CONF_BACKWARDS_COMPAT.

Mmake.common.in:
	Define MR_NO_CONF_BACKWARDS_COMPAT when checking
	for namespace cleanliness.

RESERVED_MACRO_NAMES:
	Remove the configuration macros.

runtime/mercury_conf_bootstrap.h:
	Remove a duplicate definition of BOXED_FLOAT.

configure.in:
*/*.c:
*/*.h:
*/*.m:
	Add MR_ prefixes.
2002-02-13 09:56:49 +00:00
Simon Taylor
6e82f3847e Implement Fergus' suggestion for deciding when to add modes
Estimated hours taken: 2

Implement Fergus' suggestion for deciding when to add modes
for predicates with no arguments.

The following declarations result in a mode being added:
:- pred foo is semidet.

:- pred foo.
:- mode foo.

:- pred foo.
:- mode foo is semidet.

This declaration doesn't:
:- pred foo.

compiler/make_hlds.m:
	Remove code to add a default mode for a zero arity predicate
	with only a pred declaration with no determinism.

tests/invalid/bigtest.err_exp:
	Add a `no modes for predicate ...' error.

tests/invalid/missing_det_decls.m:
tests/invalid/missing_det_decls.err_exp:
	Add missing mode declarations.

tests/valid/Mmakefile:
	Pass --infer-modes to mmc when compiling zero_arity.m.

tests/valid/zero_arity.m:
	Add tests for each of the declaration combinations listed above.

tests/valid/det_inference.m:
	Add missing mode declarations.
1999-09-21 07:26:18 +00:00
Simon Taylor
7828cb3587 Allow separate mode declarations for predicates with no arguments
Estimated hours taken: 2

Allow separate mode declarations for predicates with no arguments
(previously they were considered to be duplicate mode declarations).
This avoids the need to special case such predicates when writing
out declarations for inter-module optimization.

If there is no mode declaration and the `:- pred' declaration does
not include the determinism, a default mode `:- mode foo.' is added.

Compilation of the browser directory with --intermodule-optimization
fails with a duplicate mode error without this change.

compiler/make_hlds.m:
	Handle default modes for zero arity predicates using a similar
	method to that used for the `in, in, ..., out' modes for functions,
	except that there will still be an error message if determinism
	inference is not enabled.

compiler/clause_to_proc.m:
	Rename `add_default_modes' to `add_default_func_modes',
	to avoid confusion with `add_default_zero_arity_pred_modes'
	in make_hlds.m.

compiler/modecheck_call.m:
compiler/post_typecheck.m:
	Remove some unnecessary calls to `add_default_mode'.
	Default modes are added in make_hlds.m.

tests/valid/Mmakefile:
tests/valid/zero_arity.m:
	Test case.

tests/invalid/Mmakefile:
	Use `--no-infer-det' when compiling missing_det_decls.m so that
	error messages for missing determinism declarations for local
	predicates are reported (one of the local predicates in that test
	case has no arguments).

tests/invalid/bigtest.err_exp:
	Remove the error message for a missing mode declaration for a zero
	arity predicate.

tests/invalid/duplicate_modes.err_exp:
	Remove a duplicate mode error for a zero arity predicate with
	a separate mode declaration.
1999-08-31 05:26:10 +00:00