mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 12:26:29 +00:00
Estimated hours taken: 100
Branches: main
Make definitions of abstract types available when generating
code for importing modules. This is necessary for the .NET
back-end, and for `:- pragma export' on the C back-end.
compiler/prog_data.m:
compiler/modules.m:
compiler/make.dependencies.m:
compiler/recompilation.version.m:
Handle implementation sections in interface files.
There is a new pseudo-declaration `abstract_imported'
which is applied to items from the implementation
section of an interface file. `abstract_imported'
items may not be used in the error checking passes
for the curent module.
compiler/equiv_type_hlds.m:
compiler/notes/compiler_design.html:
New file.
Go over the HLDS expanding all types fully after
semantic checking has been run.
compiler/mercury_compile.m:
Add the new pass.
Don't write the `.opt' file if there are any errors.
compiler/instmap.m:
Add a predicate instmap_delta_map_foldl to apply
a procedure to all insts in an instmap.
compiler/equiv_type.m:
Export predicates for use by equiv_type_hlds.m
Reorder arguments so state variables and higher-order
programming can be used.
compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
Handle `:- pragma foreign_type' as a form of type
declaration rather than a pragma.
compiler/hlds_data.m:
compiler/*.m:
Add a field to the type_info_cell_constructor cons_id
to identify the type_ctor, which is needed by
equiv_type_hlds.m.
compiler/module_qual.m:
Donn't allow items from the implementation section of
interface files to match items in the current module.
compiler/*.m:
tests/*/*.m:
Add missing imports which only became apparent with
the bug fixes above.
Remove unnecessary imports which only became apparent with
the bug fixes above.
tests/hard_coded/Mmakefile:
tests/hard_coded/export_test2.{m,exp}:
Test case.
tests/invalid/Mmakefile:
tests/invalid/missing_interface_import2.{m,err_exp}:
Test case.
35 lines
835 B
Mathematica
35 lines
835 B
Mathematica
% Regression test for a case where cse_detection.m, det_analysis.m
|
|
% and simplify.m were not updating the instmap before processing
|
|
% a lambda expression, causing an abort in determinism analysis.
|
|
:- module lambda_instmap_bug.
|
|
|
|
:- interface.
|
|
|
|
:- import_module list, set, std_util.
|
|
|
|
:- type instr == pair(instruction, string).
|
|
|
|
:- type instruction
|
|
---> clear(int)
|
|
; drop(int)
|
|
; join(int, int, int).
|
|
|
|
:- pred detect_streams(set(int), list(instr), list(instr)).
|
|
:- mode detect_streams(in, in, out) is det.
|
|
|
|
:- implementation.
|
|
|
|
detect_streams(Streams, Instrs0, Instrs) :-
|
|
|
|
% Don't attempt to clear or drop streams.
|
|
IsNotStreamClear =
|
|
lambda([Instr::in] is semidet, (
|
|
\+ (
|
|
( Instr = clear(Rel) - _
|
|
; Instr = drop(Rel) - _
|
|
),
|
|
set__member(Rel, Streams)
|
|
)
|
|
)),
|
|
list__filter(IsNotStreamClear, Instrs0, Instrs).
|