mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 21:03:53 +00:00
Estimated hours taken: 3
Branches: main
Fix the failure of the tabling/unused_args test case in grade hlc.gc. The root
cause of the failure was that the MLDS backend used the same template for
generating code for foreign_procs with determinism failure as it did for
foreign_procs with determinism semidet and cc_multi. The former aren't
supposed to assign to SUCCESS_INDICATOR, since their success is not in doubt,
but the code template assumed they did, and tested the value of this undefined
variable.
The manifestation of this error was that the predicate mark_as_failed in
table_builtin.m had an undefined success value.
Also, improve performance by passing foreign types as Mercury types if they
have the can_pass_as_mercury_type assertion.
compiler/ml_code_gen.m:
Fix this error for the MLDS C backend, and put a XXX next to the
relevant code for the other MLDS backends.
Pass foreign types with the can_pass_as_mercury_type assertion as
Mercury types.
compiler/foreign.m:
In the data structure recording information about foreign types,
record not only their names but also the assertions about them.
Return this extra information in the outputs of the relevant
predicates, for use in ml_code_gen.m.
Remove module qualifications from predicate names, since the
inconsistencies between predicate declarations and definitions
(some had module qualifications, some didn't) were confusing mtags.
compiler/export.m:
Minor diffs to conform to the changed interface of foreign.m.
tests/tabling/unused_argument.{m,exp}*:
Make this test case tougher by testing not just unused arguments,
but also a tabled predicate without inputs (which are handled specially
in table_gen.m).
13 lines
161 B
Plaintext
13 lines
161 B
Plaintext
foo
|
|
bar
|
|
foo_fail failed, as expected
|
|
foo
|
|
bar
|
|
foo_fail failed, as expected
|
|
foo
|
|
bar
|
|
foo_fail failed, as expected
|
|
no_input executed
|
|
no_input_output
|
|
no_input_output
|