Files
mercury/tests/hard_coded/word_aligned_pointer.exp
Peter Wang 62db25b371 Add foreign type assertion `word_aligned_pointer'.
Add a new foreign type assertion `word_aligned_pointer' that asserts the
necessary conditions for the compiler to use the direct argument functor
representation on constructors of a single argument of that foreign type.

The conditions on the values of the foreign type are

  - the values must fit in a single word

  - the values must be clear in the tag bits ("word-aligned")

The first condition is the same as that asserted by
`can_pass_as_mercury_type' so we let `word_aligned_pointer' imply
`can_pass_as_mercury_type'.

compiler/prog_data.m:
	Add `foreign_type_word_aligned_pointer' option.

	Wrap list(foreign_type_assertions) in a new type to dissuade
	direct checks for individual list members.

compiler/prog_io_pragma.m:
	Parse `word_aligned_pointer' as a foreign type assertion.

compiler/hlds_data.m:
	Add predicates for checking foreign type assertions.  The
	implication word_aligned_pointer => can_pass_as_mercury_type is
	implemented in a single place.

compiler/make_tags.m:
	Take `word_aligned_pointer' assertions into consideration when
	deciding if a constructor can use the direct argument functor
	representation.

	Clarify the code.

compiler/foreign.m:
compiler/llds.m:
compiler/llds_out_instr.m:
compiler/ml_foreign_proc_gen.m:
compiler/parse_tree_out.m:
compiler/type_ctor_info.m:
	Conform to changes.

doc/reference_manual.texi:
	Add documentation.

tests/hard_coded/Mmakefile:
tests/hard_coded/word_aligned_pointer.exp:
tests/hard_coded/word_aligned_pointer.m:
tests/hard_coded/word_aligned_pointer_2.m:
	Add test case.

NEWS:
	Announce change.
2015-09-30 15:26:28 +10:00

5 lines
48 B
Plaintext

yes(0xcafe)
yes(0xcafe)
yes(0xcafe)
yes(0xcafe)