mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-17 14:57:03 +00:00
faa18a15bd332b51ec6d6fdae4d999ec2bf3fa82
71 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
46a67b0b48 |
When the typechecker finds highly ambiguous overloading, print what symbols
Estimated hours taken: 16
Branches: main
When the typechecker finds highly ambiguous overloading, print what symbols
were overloaded, and where they occurred. Without this information, it is
very hard to fix the error if the predicate body is at all large.
Fix some software engineering problems encountered during this process.
Modify some predicates in error_util in order to simplify their typical usage.
Change the type_ctor type to be not simply a sym_name - int pair but a type
with its own identifying type constructor. Change several other types that
were also sym_name - int pairs (mode_id, inst_id, item_name, module_qual.id
and the related simple_call_id) to have their own function symbols too.
compiler/typecheck_info.m:
Add a field to the typecheck_info structure that records the overloaded
symbols encountered.
compiler/typecheck.m:
When processing ambiguous predicate and function symbols, record this
fact in the typecheck_info.
Add a field to the cons_type_info structure to make this possible.
compiler/typecheck_errors.m:
When printing the message about highly ambiguous overloading,
what the overloaded symbols were and where they occurred.
compiler/error_util.m:
Make error_msg_specs usable with plain in and out modes by separating
out the capability requiring special modes (storing a higher order
value in a function symbol) into its own, rarely used type.
Make component_list_to_line_pieces a bit more flexible.
compiler/prog_data.m:
compiler/module_qual.m:
compiler/recompilation.m:
Change the types listed above from being equivalence types (pairs)
to being proper discriminated union types.
compiler/*.m:
Conform to the changes above.
In some cases, simplify the code's use of error_util.
tests/warnings/ambiguous_overloading.{m,exp}:
Greatly extend this test case to test the new functionality.
tests/recompilation/*.err_exp.2
Reflect the fact that the expected messages now use the standard
error_util way of quoting sym_name/arity pairs.
|
||
|
|
459847a064 |
Move the univ, maybe, pair and unit types from std_util into their own
Estimated hours taken: 18 Branches: main Move the univ, maybe, pair and unit types from std_util into their own modules. std_util still contains the general purpose higher-order programming constructs. library/std_util.m: Move univ, maybe, pair and unit (plus any other related types and procedures) into their own modules. library/maybe.m: New module. This contains the maybe and maybe_error types and the associated procedures. library/pair.m: New module. This contains the pair type and associated procedures. library/unit.m: New module. This contains the types unit/0 and unit/1. library/univ.m: New module. This contains the univ type and associated procedures. library/library.m: Add the new modules. library/private_builtin.m: Update the declaration of the type_ctor_info struct for univ. runtime/mercury.h: Update the declaration for the type_ctor_info struct for univ. runtime/mercury_mcpp.h: runtime/mercury_hlc_types.h: Update the definition of MR_Univ. runtime/mercury_init.h: Fix a comment: ML_type_name is now exported from type_desc.m. compiler/mlds_to_il.m: Update the the name of the module that defines univs (which are handled specially by the il code generator.) library/*.m: compiler/*.m: browser/*.m: mdbcomp/*.m: profiler/*.m: deep_profiler/*.m: Conform to the above changes. Import the new modules where they are needed; don't import std_util where it isn't needed. Fix formatting in lots of modules. Delete duplicate module imports. tests/*: Update the test suite to confrom to the above changes. |
||
|
|
12deb40264 |
Rename all the get access predicates in these modules that don't
Estimated hours taken: 0.1 Branches: main compiler/hlds_clauses.m: compiler/hlds_pred.m: Rename all the get access predicates in these modules that don't already have put "get" in their name. (The names of the set access predicates were OK already.) compiler/*.m: Conform to the above. All this was done by this sed script: s/clauses_info_varset/clauses_info_get_varset/ s/clauses_info_explicit_vartypes/clauses_info_get_explicit_vartypes/ s/clauses_info_vartypes/clauses_info_get_vartypes/ s/clauses_info_headvars/clauses_info_get_headvars/ s/clauses_info_clauses_rep/clauses_info_get_clauses_rep/ s/clauses_info_rtti_varmaps/clauses_info_get_rtti_varmaps/ s/pred_info_import_status/pred_info_get_import_status/ s/pred_info_arg_types/pred_info_get_arg_types/ s/pred_info_typevarset/pred_info_get_typevarset/ s/pred_info_tvar_kinds/pred_info_get_tvar_kinds/ s/pred_info_procedures/pred_info_get_procedures/ s/proc_info_context/proc_info_get_context/ s/proc_info_varset/proc_info_get_varset/ s/proc_info_vartypes/proc_info_get_vartypes/ s/proc_info_headvars/proc_info_get_headvars/ s/proc_info_inst_varset/proc_info_get_inst_varset/ s/proc_info_maybe_declared_argmodes/proc_info_get_maybe_declared_argmodes/ s/proc_info_argmodes/proc_info_get_argmodes/ s/proc_info_maybe_arglives/proc_info_get_maybe_arglives/ s/proc_info_declared_determinism/proc_info_get_declared_determinism/ s/proc_info_inferred_determinism/proc_info_get_inferred_determinism/ s/proc_info_goal/proc_info_get_goal/ s/proc_info_can_process/proc_info_get_can_process/ s/proc_info_rtti_varmaps/proc_info_get_rtti_varmaps/ s/proc_info_eval_method/proc_info_get_eval_method/ s/proc_info_is_address_taken/proc_info_get_is_address_taken/ s/proc_info_stack_slots/proc_info_get_stack_slots/ s/proc_info_liveness_info/proc_info_get_liveness_info/ s/proc_info_context/proc_info_get_context/ s/proc_info_context/proc_info_get_context/ s/proc_info_context/proc_info_get_context/ s/proc_info_context/proc_info_get_context/ s/proc_info_context/proc_info_get_context/ s/proc_info_context/proc_info_get_context/ s/proc_info_context/proc_info_get_context/ |
||
|
|
3ebda6545f |
Move the stuff currently in hlds_pred.m that deals with clauses into a new
Estimated hours taken: 1.5 Branches: main Move the stuff currently in hlds_pred.m that deals with clauses into a new module, hlds_clauses.m. Move the stuff currently in hlds_pred.m that deals with RTTI into a new module, hlds_rtti.m. Move the stuff currently in hlds_module.m that deals with predicate tables into a new module, pred_table.m. These changes make hlds_pred.m and hlds_module.m much more cohesive, but there are no changes in algorithms. compiler/hlds_clauses.m: compiler/hlds_rtti.m: compiler/pred_table.m: New modules as described above. In some cases, fix mixleading or ambiguous predicate names in the process, and convert a few predicates to functions. compiler/hlds_pred.m: compiler/hlds_module.m: Delete the stuff moved to other modules. compiler/*.m: In modules that need the functionality moved a new module, import the new module. It is rare for all the new modules to be needed, and many modules don't need any of the new modules at all. (For example, of the 200+ modules that import hlds_module.m, only about 40 need pred_table.m.) Conform to the few minor changes to e.g. predicate names. compiler/notes/compiler_design.html: Document the new modules. |
||
|
|
be5b71861b |
Convert almost all the compiler modules to use . instead of __ as
Estimated hours taken: 6 Branches: main compiler/*.m: Convert almost all the compiler modules to use . instead of __ as the module qualifier. In some cases, change the names of predicates and types to make them meaningful without the module qualifier. In particular, most of the types that used to be referred to with an "mlds__" prefix have been changed to have a "mlds_" prefix instead of changing the prefix to "mlds.". There are no algorithmic changes. |
||
|
|
9d8ca0ad37 |
Remove residual parts of the Aditi backend that weren't deleted the other day.
Estimated hours taken: 1.5 Branches: main Remove residual parts of the Aditi backend that weren't deleted the other day. configure.in: Mmake.common.in: Remove support for enabling the Aditi backend. runtime/mercury_aditi.h: Remove this file. runtime/Mmakefile: runtime/mercury.h: runtime/mercury_imp.h: runtime/mercury_ho_call.[ch]: runtime/mercury_wrapper.[ch]: Delete support for Aditi in the runtime. scripts/Mmake.rules: scripts/Mmake.vars.in: scripts/c2init.in: scripts/parse_ml_options.sh-subr.in: Remove mmake support for building .rlo files, etc. util/mkinit.c: Remove Aditi specific code. compiler/bytecode_data.m: compiler/closure_analysis.m: compiler/code_model.m: compiler/compile_target_code.m: compiler/det_analysis.m: compiler/handle_options.m: compiler/hlds_goal.m: compiler/hlds_module.m: compiler/make.dependencies.m: compiler/make.m: compiler/make.module_target.m: compiler/make.program_target.m: compiler/make.util.m: compiler/make_hlds_error.m: compiler/make_hlds_passes.m: compiler/mercury_to_mercury.m: compiler/mlds_to_gcc.m: compiler/modecheck_call.m: compiler/modules.m: compiler/opt_debug.m: compiler/options.m: compiler/prog_data.m: compiler/prog_foreign.m: compiler/prog_mode.m: compiler/prog_type.m: compiler/rtti.m: compiler/rtti_out.m: compiler/rtti_to_mlds.m: compiler/term_errors.m: compiler/unify_proc.m: mdbcomp/prim_data.m: Remove residual support for Aditi. library/ops.m: Remove the 'aditi_bottom_up' and 'aditi_top_down' operators from the ops table. doc/reference_manual.texi: doc/user_guide.texi: Delete the sections on the Aditi interface. extras/aditi/*: Delete this. |
||
|
|
45fdb6c451 |
Use expect/3 in place of require/2 throughout most of the
Estimated hours taken: 4 Branches: main compiler/*.m: Use expect/3 in place of require/2 throughout most of the compiler. Use unexpected/2 (or sorry/2) in place of error/1 in more places. Fix more dodgy assertion error messages. s/map(prog_var, mer_type)/vartypes/ where the latter is meant. |
||
|
|
5f589e98fb |
Various cleanups for the modules in the compiler directory.
Estimated hours taken: 4 Branches: main Various cleanups for the modules in the compiler directory. The are no changes to algorithms except the replacement of some if-then-elses that would naturally be switches with switches and the replacement of most of the calls to error/1. compiler/*.m: Convert calls to error/1 to calls to unexpected/2 or sorry/2 as appropriate throughout most or the compiler. Fix inaccurate assertion failure messages, e.g. identifying the assertion failure as taking place in the wrong module. Add :- end_module declarations. Fix formatting problems and bring the positioning of comments into line with our current coding standards. Fix some overlong lines. Convert some more modules to 4-space indentation. Fix some spots where previous conversions to 4-space indentation have stuffed the formatting of the code up. Fix a bunch of typos in comments. Use state variables in more places; use library predicates from the sv* modules where appropriate. Delete unnecessary and duplicate module imports. Misc. other small cleanups. |
||
|
|
21685c9e22 |
Improve the error messages generated for determinism errors involving committed
Estimated hours taken: 6
Branches: main
Improve the error messages generated for determinism errors involving committed
choice contexts. Previously, we printed a message to the effect that e.g.
a cc pred is called in context that requires all solutions, but we didn't say
*why* the context requires all solutions. We now keep track of all the goals
to the right that could fail, since it is these goals that may reject the first
solution of a committed choice goal.
The motivation for this diff was the fact that I found that locating the
failing goal can be very difficult if the conjunction to the right is
a couple of hundred lines long. This would have been a nontrivial problem,
since (a) unifications involving values of user-defined types are committed
choice goals, and (b) we can expect uses of user-defined types to increase.
compiler/det_analysis.m:
Keep track of goals to the right of the current goal that could fail,
and include them in the error representation if required.
compiler/det_report.m:
Include the list of failing goals to the right in the representations
of determinism errors involving committed committed choice goals.
Convert the last part of this module that wasn't using error_util
to use error_util. Make most parts of this module just construct
error message specifications; print those specifications (using
error_util) in only a few places.
compiler/hlds_out.m:
Add a function for use by the new code in det_report.m.
compiler/error_util.m:
Add a function for use by the new code in det_report.m.
compiler/error_util.m:
compiler/compiler_util.m:
Error_util is still changing reasonably often, and yet it is
included in lots of modules, most of which need only a few simple
non-parse-tree-related predicates from it (e.g. unexpected).
Move those predicates to a new module, compiler_util.m. This also
eliminates some undesirable dependencies from libs to parse_tree.
compiler/libs.m:
Include compiler_util.m.
compiler/notes/compiler_design.html:
Document compiler_util.m, and fix the documentation of some other
modules.
compiler/*.m:
Import compiler_util instead of or in addition to error_util.
To make this easier, consistently use . instead of __ for module
qualifying module names.
tests/invalid/det_errors_cc.{m,err_exp}:
Add this new test case to test the error messages for cc contexts.
tests/invalid/det_errors_deet.{m,err_exp}:
Add this new test case to test the error messages for unifications
inside function symbols.
tests/invalid/Mmakefile:
Add the new test cases.
tests/invalid/det_errors.err_exp:
tests/invalid/magicbox.err_exp:
Change the expected output to conform to the change in det_report.m,
which is now more consistent.
|
||
|
|
f9fe8dcf61 |
Improve the error messages generated for determinism errors involving committed
Estimated hours taken: 8
Branches: main
Improve the error messages generated for determinism errors involving committed
choice contexts. Previously, we printed a message to the effect that e.g.
a cc pred is called in context that requires all solutions, but we didn't say
*why* the context requires all solutions. We now keep track of all the goals
to the right that could fail, since it is these goals that may reject the first
solution of a committed choice goal.
The motivation for this diff was the fact that I found that locating the
failing goal can be very difficult if the conjunction to the right is
a couple of hundred lines long. This would have been a nontrivial problem,
since (a) unifications involving values of user-defined types are committed
choice goals, and (b) we can expect uses of user-defined types to increase.
compiler/det_analysis.m:
Keep track of goals to the right of the current goal that could fail,
and include them in the error representation if required.
compiler/det_report.m:
Include the list of failing goals to the right in the representations
of determinism errors involving committed committed choice goals.
Convert the last part of this module that wasn't using error_util
to use error_util. Make most parts of this module just construct
error message specifications; print those specifications (using
error_util) in only a few places.
compiler/hlds_out.m:
Add a function for use by the new code in det_report.m.
compiler/error_util.m:
Add a function for use by the new code in det_report.m.
compiler/error_util.m:
compiler/compiler_util.m:
Error_util is still changing reasonably often, and yet it is
included in lots of modules, most of which need only a few simple
non-parse-tree-related predicates from it (e.g. unexpected).
Move those predicates to a new module, compiler_util.m. This also
eliminates some undesirable dependencies from libs to parse_tree.
compiler/libs.m:
Include compiler_util.m.
compiler/notes/compiler_design.html:
Document compiler_util.m, and fix the documentation of some other
modules.
compiler/*.m:
Import compiler_util instead of or in addition to error_util.
To make this easier, consistently use . instead of __ for module
qualifying module names.
tests/invalid/det_errors_cc.{m,err_exp}:
Add this new test case to test the error messages for cc contexts.
tests/invalid/det_errors_deet.{m,err_exp}:
Add this new test case to test the error messages for unifications
inside function symbols.
tests/invalid/Mmakefile:
Add the new test cases.
tests/invalid/det_errors.err_exp:
tests/invalid/magicbox.err_exp:
Change the expected output to conform to the change in det_report.m,
which is now more consistent.
|
||
|
|
b2012c0c0e |
Rename the types 'type', 'inst' and 'mode' to 'mer_type', 'mer_inst'
Estimated hours taken: 8 Branches: main compiler/*.m: Rename the types 'type', 'inst' and 'mode' to 'mer_type', 'mer_inst' and 'mer_mode'. This is to avoid the need to parenthesize these type names in some contexts, and to prepare for the possibility of a parser that considers those words to be reserved words. Rename some other uses of those names (e.g. as item types in recompilation.m). Delete some redundant synonyms (prog_type, mercury_type) for mer_type. Change some type names (e.g. mlds__type) and predicate names (e.g. deforest__goal) to make them unique even without module qualification. Rename the function symbols (e.g. pure, &) that need to be renamed to avoid the need to parenthesize them. Make their replacement names more expressive. Convert some more modules to four space indentation. Avoid excessively long lines, such as those resulting from the automatic substitution of 'mer_type' for 'type'. |
||
|
|
d609181cb9 |
Consider types of the form
Estimated hours taken: 30
Branches: main
Consider types of the form
:- type x ---> f.
to be dummy types, since they contain no information. Optimize them the same
way we currently optimize io.state and store.store.
runtime/mercury_type_info.h:
Add a new type_ctor_rep for dummy types.
runtime/mercury_tabling.h:
Add a representation for "tabled" dummy types, which don't actually
have a level in the trie, so that the runtime system can handle that
fact.
runtime/mercury_ml_expand_body.h:
When deconstructing a value of a dummy type, ignore the actual value
(since it will contain garbage) and instead return the only possible
value of the type.
runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
runtime/mercury_deep_copy_body.c:
runtime/mercury_tabling.c:
runtime/mercury_unify_compare_body.h:
library/rtti_implementation.m:
Handle the type_ctor_rep of dummy types.
runtime/mercury_builtin_types.c:
Provide a place to record profiling information about unifications and
comparisons for dummy types.
runtime/mercury_mcpp.h:
java/runtime/TypeCtorRep.java:
library/private_builtin.m:
Add a new type_ctor_rep for dummy types, and fix some previous
discrepancies in type_ctor_reps.
mdbcomp/prim_data.m:
Move a bunch of predicates for manipulating special_pred_ids here from
the browser and compiler directories.
Rename the function symbols of the special_pred_id type to avoid the
need to parenthesize the old `initialise' function symbol.
Convert to four-space indentation.
mdbcomp/rtti_access.m:
Don't hardcode the names of special preds: use the predicates in
prim_data.m.
Convert to four-space indentation.
browser/declarative_execution.m:
Delete some predicates whose functionality is now in
mdbcomp/prim_data.m.
compiler/hlds_data.m:
Replace the part of du type that says whether a type an enum, which
used to be a bool, with something that also says whether the type is a
dummy type.
Convert to four-space indentation.
compiler/make_tags.m:
Compute the value for the new field of du type definitions.
compiler/hlds_out.m:
Write out the new field of du type definitions.
compiler/rtti.m:
Modify the data structures we use to create type_ctor_infos to allow
for dummy types.
Convert to four-space indentation.
compiler/type_ctor_info.m:
Modify the code that generates type_ctor_infos to handle dummy types.
compiler/type_util.m:
Provide predicates for recognizing dummy types.
Convert to four-space indentation.
compiler/unify_proc.m:
Generate the unify and compare predicates of dummy types using a new
code scheme that avoids referencing arguments that contain garbage.
When generating code for unifying or comparing other types, ignore
any arguments of function symbols that are dummy types.
Don't use DCG style access predicates.
compiler/higher_order.m:
Specialize the unification and comparison of values of dummy types.
Break up an excessively large predicate, and factor out common code
from the conditions of a chain of if-then-elses.
compiler/llds.m:
For each input and output of a foreign_proc, include a field saying
whether the value is of a dummy type.
compiler/pragma_c_gen.m:
Fill in the new fields in foreign_proc arguments.
compiler/hlds_goal.m:
Rename some predicates for constructing unifications to avoid
unnecessary ad-hoc overloading. Clarify their documentation.
Rename a predicate to make clear the restriction on its use,
and document the restriction.
Add a predicate for creating simple tests.
Add a utility predicate for setting the context of a goal directly.
compiler/modules.m:
Include dummy types interface files, even if they are private to the
module. This is necessary because with the MLDS backend, the generated
code inside the module and outside the module must agree whether a
function returning a value of the type returns a real value or a void
value, and this requires them to agree on whether the type is dummy
or not.
The impact on interface files is minimal, since very few types are
dummy types, and changing a type from a dummy type to a non-dummy type
or vice versa is an ever rarer change.
compiler/hlds_pred.m:
Provide a representation in the compiler of the trie step for dummy
types.
compiler/layout_out.m:
Print the trie step for dummy types.
compiler/table_gen.m:
Don't table values of dummy types, and record the fact that we don't
by including a dummy trie step in the list of trie steps.
compiler/add_pragma.m:
compiler/add_special_pred.m:
compiler/add_type.m:
compiler/aditi_builtin_ops.m:
compiler/bytecode.m:
compiler/bytecode_gen.m:
compiler/code_gen.m:
compiler/code_info.m:
compiler/continuation_info.m:
compiler/cse_detection.m:
compiler/det_report.m:
compiler/exception_analysis.m:
compiler/inst_match.m:
compiler/livemap.m:
compiler/llds_out.m:
compiler/llds_out.m:
compiler/middle_rec.m:
compiler/ml_call_gen.m:
compiler/ml_closure_gen.m:
compiler/ml_code_gen.m:
compiler/ml_code_util.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen.m:
compiler/mlds_to_c.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
compiler/mlds_to_il.m:
compiler/modecheck_unify.m:
compiler/modes.m:
compiler/opt_util.m:
compiler/post_term_analysis.m:
compiler/post_typecheck.m:
compiler/qual_info.m:
compiler/rl.m:
compiler/rl_exprn.m:
compiler/rl_key.m:
compiler/rtti_out.m:
compiler/simplify.m:
compiler/size_prof.m:
compiler/term_constr_initial.m:
compiler/term_constr_util.m:
compiler/term_norm.m:
compiler/termination.m:
compiler/trace.m:
compiler/typecheck.m:
compiler/unify_gen.m:
Conform to the changes above.
compiler/export.m:
compiler/exprn_aux.m:
compiler/foreign.m:
compiler/polymorphism.m:
compiler/proc_label.m:
compiler/rtti_to_mlds.m:
compiler/special_pred.m:
compiler/stack_alloc.m:
compiler/stack_layout.m:
compiler/state_var.m:
compiler/switch_util.m:
compiler/trace_params.m:
Conform to the changes above.
Convert to four-space indentation.
compiler/mlds_to_java.m:
compiler/var_locn.m:
Conform to the changes above, which requires threading the module_info
through the module.
Convert to four-space indentation.
compiler/mercury_compile.m:
Pass the module_info to mlds_to_java.m.
compiler/ml_util.m:
compiler/polymorphism.m:
compiler/type_ctor_info.m:
compiler/type_util.m:
Delete some previously missed references to the temporary types used
to bootstrap the change to the type_info type's arity.
compiler/polymorphism.m:
Turn back on an optimization that avoids passing parameters (such as
type_infos) to foreign_procs if they are not actually referred to.
compiler/prog_data.m:
Convert to four-space indentation.
library/svvarset.m:
Add a missing predicate.
trace/mercury_trace.c:
Delete the unused function that used to check for dummy types.
tests/debugger/field_names.{m,inp,exp}:
Add to this test case a test of the handling of dummy types. Check that
their values can be printed out during normal execution, and that the
debugger doesn't consider them live nondummy variables, just as it
doesn't consider I/O states live nondummy variables.
|
||
|
|
b54ab42d70 |
A simple tool for performing substitutions on the source files of the
Estimated hours taken: 0.5 Branches: main tools/subst: A simple tool for performing substitutions on the source files of the compiler. compiler/*.m: Change the names of the get predicates operating on module_infos to include "get" in the name, for uniformity. This was done mostly by the following sed script, with some manual cleanup afterwards to reduce excessive line lengths. s/module_info_types/module_info_get_type_table/ s/module_info_set_types/module_info_set_type_table/ s/module_info_insts/module_info_get_inst_table/ s/module_info_set_insts/module_info_set_inst_table/ s/module_info_modes/module_info_get_mode_table/ s/module_info_set_modes/module_info_set_mode_table/ s/module_info_ctors/module_info_get_cons_table/ s/module_info_set_ctors/module_info_set_cons_table/ s/module_info_classes/module_info_get_class_table/ s/module_info_set_classes/module_info_set_class_table/ s/module_info_instances/module_info_get_instance_table/ s/module_info_set_instances/module_info_set_instance_table/ s/module_info_superclasses/module_info_get_superclass_table/ s/module_info_set_superclasses/module_info_set_superclass_table/ s/module_info_assertion_table/module_info_get_assertion_table/ s/module_info_exclusive_table/module_info_get_exclusive_table/ s/module_info_ctor_field_table/module_info_get_ctor_field_table/ s/module_info_name/module_info_get_name/ s/module_info_globals/module_info_get_globals/ s/module_info_contains_foreign_types/module_info_get_contains_foreign_types/ s/module_info_num_errors/module_info_get_num_errors/ s/module_info_type_ctor_gen_infos/module_info_get_type_ctor_gen_infos/ s/module_info_stratified_preds/module_info_get_stratified_preds/ s/module_info_unused_arg_info/module_info_get_unused_arg_info/ s/module_info_exception_info/module_info_get_exception_info/ s/module_info_type_spec_info/module_info_get_type_spec_info/ s/module_info_no_tag_types/module_info_get_no_tag_types/ s/module_info_analysis_info/module_info_get_analysis_info/ s/module_info_aditi_top_down_procs/module_info_get_aditi_top_down_procs/ |
||
|
|
88828cca79 |
This is step 3 of eliminating the arguments of the type_ctor_info, type_info,
Estimated hours taken: 4 Branches: main This is step 3 of eliminating the arguments of the type_ctor_info, type_info, base_typeclass_info and typeclass_info type constructors. This step eliminates the temporary replacement types with the zero_ prefixes on their names. library/private_builtin.m: Remove the temporary replacement type constructors and the predicates that operate on them. runtime/mercury_builtin_types.[ch]: Remove the unify and compare predicates of the temporary replacement type constructors. runtime/mercury_type_info.h: runtime/mercury_grade.h: Increase binary compatibility version numbers to reflect the requirement on the compiler to generate references to arity-0 variants of type_ctor_info, type_info, base_typeclass_info and typeclass_info. runtime/mercury_type_info.h: runtime/mercury_make_type_info_body.h: compiler/rtti.m: Remove support for fake_arity types, since there aren't any anymore. trace/mercury_trace_vars.c: Remove references to the temporary replacement type constructors. |
||
|
|
3c60c0e485 |
Change a bunch of modules to import only one module per line, even
Estimated hours taken: 4 Branches: main compiler/*.m: Change a bunch of modules to import only one module per line, even from the library. compiler/mlds_to_il.m: compiler/mlds_to_managed.m: Convert these modules to our current coding style. Use state variables where appropriate. Use predmode declarations where possible. |
||
|
|
601fe20aba |
Simplify the structure of the compiler by removing the cycle
Estimated hours taken: 3.5 Branches: main Simplify the structure of the compiler by removing the cycle parse_tree -> backend_libs -> check_hlds -> parse_tree from the package dependency graph. I've done this by factoring out the code in backend_libs.foreign and backend_libs.name_mangle that is needed by the frontend of the compiler and putting it in a new module, parse_tree.prog_foreign. This removes the dependency between the parse_tree and backend_libs packages. The obvious downside to this is that the name mangler is now split in two, although such a division was always in implicit in the predicates of the name_mangle module anyway, ie. between those bits that operate on the HLDS/MLDS/LLDS level data structures and those that don't. compiler/name_mangle.m: compiler/foreign.m: compiler/prog_foreign.m: Move code for dealing with foreign language procedures that is required by the parse_tree package into a new module, prog_foreign. Update the formatting in some of these modules so that they match our current coding standard. compiler/*.m: Update to reflect the above change. compiler/notes/compiler_design.html: Include the new module. Fix some spelling errors. |
||
|
|
4970242093 |
Use proc_label data structure defined in mdbcomp.prim_data instead of proc_id
Estimated hours taken: 4 Branches: main Use proc_label data structure defined in mdbcomp.prim_data instead of proc_id defined in mdb.declarative_execution and delete proc_id, since these data structures are almost identical. browser/declarative_execution.m Remove proc_id and flat_module_name types. Use mdbcomp.prim_data.proc_label and mdbcomp.prim_data.module_name instead. browser/declarative_debugger.m browser/declarative_oracle.m browser/declarative_tree.m browser/declarative_user.m Use mdbcomp.prim_data.proc_label and mdbcomp.prim_data.module_name instead of mdb.declarative_execution.proc_id and mdb.declarative_execution.module_name. mdbcomp/prim_data.m compiler/prog_out.m Move sym_name_to_string from prog_out to prim_data. Fix comment for prog_out.sym_name_and_arity_to_string. compiler/bytecode.m compiler/check_typeclass.m compiler/code_gen.m compiler/deforest.m compiler/higher_order.m compiler/hlds_code_util.m compiler/hlds_error_util.m compiler/hlds_module.m compiler/hlds_out.m compiler/intermod.m compiler/layout_out.m compiler/make.module_target.m compiler/make_hlds.m compiler/mercury_compile.m compiler/mercury_to_mercury.m compiler/ml_elim_nested.m compiler/mlds_to_c.m compiler/mlds_to_gcc.m compiler/mlds_to_il.m compiler/mlds_to_java.m compiler/mlds_to_managed.m compiler/modes.m compiler/modules.m compiler/opt_debug.m compiler/options_file.m compiler/polymorphism.m compiler/prog_io.m compiler/prog_rep.m compiler/rl.m compiler/rl_exprn.m compiler/rl_gen.m compiler/rl_info.m compiler/rl_out.pp compiler/rtti.m compiler/rtti_out.m compiler/rtti_to_mlds.m compiler/source_file_map.m compiler/table_gen.m compiler/trans_opt.m compiler/unify_gen.m compiler/unique_modes.m compiler/unused_args.m Use mdbcomp.prim_data.sym_name_to_string instead of prog_out.sym_name_to_string. |
||
|
|
9521818650 |
Get the purity check pass to not issue warnings about unnecessary purity
Estimated hours taken: 16 Branches: main Get the purity check pass to not issue warnings about unnecessary purity annotations on compiler-generated predicates. The problem I am addressing is that when an optimization such as type specialization creates a clone of a predicate, that predicate gets all the original predicate's annotations. During the creation of a .opt file, purity checking sees the clauses of the original predicate and knows that the annotation is not redundant, but doesn't know that about the copy, since it has no definition at all (it doesn't need one). The fix is to put into each pred_info an indication of where the predicate came from, and to never warn about unnecessary purity annotations of predicates that the programmer didn't write. This diff also uses the origin indication to record human-usable names of compiler-generated or compiler-transformed predicates in RTTI for use by the debugger. compiler/hlds_pred.m: Replace two fields in pred_infos, that say (a) whether the predicate is a special (unify/compare/index/init) predicate and (b) whether it is a type class method implementation, with an origin field saying where the predicate came from. This field has several alternatives, special preds and type class method implementation being only two. Make the predicates that create pred_infos take an argument specifing where the predicate comes from. Replace a copy of one of the old fields in rtti_proc_labels with the new one. Make the name of the existing function more descriptive. compiler/purity.m: Use the origin field to suppress unnecessary annotation warnings for compiler-generated predicates. compiler/layout_out.m: Use the origin field to generate more human-friendly names for predicates, instead of the existing linker-friendly names. The debugger doesn't insist on predicate names being unique, even within a module. compiler/*.m: Conform to the changed interface of hlds_pred.m. The most significant changes were for recording the origin of new predicates. In one case (dnf.m) it also involved passing the required information down to the place where the new predicates were created through the dnf_info tuple instead of separate arguments, and switching to state variable notation. tests/debugger/*.exp*: tests/debugger/declarative/*.exp*: tests/hard_coded/*.exp*: Update the expected outputs to expect human-friendly predicate names. |
||
|
|
59d2d4a573 |
This adds a module mdbcomp__trace_counts that reads in the
Estimated hours taken: 17 Branches: main This adds a module mdbcomp__trace_counts that reads in the .mercury_trace_counts files produced by the compiler's trace mechanism. The format of said files was slightly changed. As the new module is to be used by the compiler and the debugger, it is placed in the mdbcomp module. This required bringing some types from the compiler into a new module within mdbcomp. browser/trace_counts.m: New module for reading execution trace summaries. browser/prim_data.m: New module holding types and predicates moved in from the compiler. Types: pred_or_func, sym_name, module_name, proc_label, special_pred_id, trace_port Predicates: string_to_sym_name, insert_module_qualifier The mode field of proc_label is now an int instead of a proc_id to avoid pulling proc_id into mdbcomp. browser/mdbcomp.m: Add trace_counts and prim_data to the mdbcomp module. browser/declarative_execution.m: Renamed mdb's definition of module_name to flat_module_name to avoid conflicts with the definition in mdbcomp__prim_data. runtime/mercury_trace_base.c: In the format of .mercury_trace_counts, write module and predicate names now use quoted atom syntax so that names with spaces and non-printable characters can be machine-parsed. browser/: compiler/: Many changes to account for movement of types, and the change to proc_label. |
||
|
|
941be20e27 |
Type_desc__get_functor looks up the types of the arguments of a function
Estimated hours taken: 16
Branches: main
Type_desc__get_functor looks up the types of the arguments of a function
symbol. This predicate used to abort when an argument has an existential
type. This diff makes type_desc__get_functor work even in that case.
However, since in such cases the type of an argument is not a ground type,
this diff has to add the concept of a pseudo_type_desc, a descriptor for
a not necessarily ground type. Pseudo_type_descs are implemented as
MR_PseudoTypeInfos.
runtime/mercury_type_info.[ch]:
Add new macros to operate on pseudo_type_infos. Most have a structure
modelled on corresponding macros operating on type_infos.
Provide versions of MR_get_arg_type_info, MR_compare_type_info,
MR_unify_type_info, MR_collapse_equivalences,
MR_type_params_vector_to_list, MR_create_type_info and
MR_create_type_info_maybe_existq that work on pseudo_type_infos,
not type_infos.
Change MR_pseudo_type_info_vector_to_type_info_list, which implements
the core of get_functor, to return pseudo_type_infos instead of
type_infos, and rename it to reflect this fact.
Change to four-space indentation to reduce the number of lines
that have to be wrapped.
runtime/mercury_make_type_info_body.h:
Generalize the code for creating type_infos to also be handle
pseudo_type_infos.
Change to four-space indentation to reduce the number of lines
that have to be wrapped.
runtime/mercury_type_desc.[ch]:
Provide versions of MR_make_type_ctor_desc and MR_type_ctor_and_args
that work on pseudo_type_infos, not type_infos.
Change to four-space indentation to reduce the number of lines
that have to be wrapped.
runtime/mercury_builtin_types.[ch]:
runtime/mercury_builtin_types_proc_layouts.h:
runtime/mercury_hlc_types.h:
runtime/mercury_unify_compare_body.h:
Add the C types, global variables and functions necessary for the
new builtin Mercury type pseudo_type_desc. This type must be builtin,
because its structure (MR_PseudoTypeInfo) is defined in C, and as such
cannot be unified, compared, deconstructed etc without hand-written
C code.
runtime/mercury_deep_copy.c:
runtime/mercury_deep_copy_body.h:
Handle the copying of pseudo_type_infos/pseudo_type_descs. This code
is almost the same as the code to copy type_infos, but must of course
handle type variables, and the arguments are themselves copied as
pseudo_type_infos, not type_infos.
runtime/mercury_types.h:
Since deep copy needs to create pseudo_type_infos, provide a version
of the MR_PseudoTypeInfo type without const.
runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
Handle pseudo_type_descs just as we handle type_descs: neither can be
constructed, nor do they have function symbols with named arguments.
runtime/mercury_ml_expand_body.c:
Provide code to deconstruct pseudo_type_descs. This code is almost
the same as the code to deconstruct type_descs, but must of course
handle type variables, and the arguments are themselves
pseudo_type_descs, not type_descs.
runtime/mercury_tabling.c:
Catch attempts to table pseudo_type_infos.
runtime/mercury_tags.h:
Add macros for constructing lists of
pseudo_type_infos/pseudo_type_descs.
runtime/mercury_wrapper.[ch]:
Define global variables holding the addresses of the typeinfos for
describing pseudo_type_descs and lists of pseudo_type_descs.
runtime/mercury_init.c:
Add the extern declarations required by new code in mkinit.c.
util/mkinit.c:
Make the addresses of the typeinfos for describing pseudo_type_descs
and lists of pseudo_type_descs, defined in the library, known to the
runtime.
library/type_desc.m:
Add a new builtin type, pseudo_type_desc, for describing possibly
nonground types.
Add utility predicates for operating on pseudo_type_descs.
library/private_builtin.m:
Handle the new builtin type.
Add builtin typeinfos for describing pseudo_type_descs and lists of
pseudo_type_descs, since some functions in the runtime need them
for memory profiling.
library/rtti_implementation.m:
Handle the new builtin type, mostly by ignoring it, since the backends
that use this module do not have any notion of pseudo_type_infos.
Bring the module up to date with our formatting guidelines.
library/construct.m:
Make get_functor return a list of pseudo_type_descs instead of
type_descs.
Change the name of the version of get_functor that returns argument
names, to distinguish it from the base version by more than just the
arity.
Make the order of predicates more logical.
library/std_util.m:
Change the name of the version of get_functor that returns argument
names, to distinguish it from the base version by more than just the
arity.
However, this name change is effectively the only change: both
get_functor and get_functor_with_names still return lists of
type_descs. This means that they will throw exceptions in the presence
of existential types, but code using them need no algorithmic changes.
library/term.m:
library/term_to_xml.m:
Add module qualifiers as necessary; no algorithmic changes.
library/list.m:
Add two general-purpose predicates, all_true and all_false,
for use in the other library modules.
compiler/ml_util.m:
compiler/mlds_to_gcc.m:
compiler/rtti.m:
compiler/type_ctor_info.m:
Make sure we handle the new builtin type as a builtin type, and not
try to have the compiler create a type_ctor_info for it.
deep_profiler/canonical.m:
Delete the local definition of all_true.
tests/hard_coded/construct_test.{m,exp}:
Update this test case to test the ability to retrieve the names of the
fields of function symbols with existential types.
Add module qualifications as necessary.
tests/hard_coded/construct_test_exist.{m,exp}:
Add a tougher test case to print the types of the arguments of
function symbols with existential types.
tests/hard_coded/Mmakefile:
Add the new test case, and sort the names of the tests.
|
||
|
|
42025cecfc |
Allow Aditi to call Mercury. At the moment, this involves Aditi
Estimated hours taken: 200
Branches: main
Allow Aditi to call Mercury. At the moment, this involves Aditi
loading a shared library containing the user's code.
runtime/mercury_aditi.h:
Define a structure MR_Aditi_Proc_Info used to describe
a procedure called by Aditi. Aditi will use dlsym() to
look up these structures in the shared library supplied
by the user.
compiler/rtti.m:
compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
compiler/ml_code_util.m:
compiler/mlds_to_gcc.m:
compiler/opt_debug.m:
Add an aditi_proc_info alternative to the rtti_data type,
which corresponds to an MR_AditiProcInfo structure in
the generated code.
In the rtti_proc_label type, record the determinism rather
than the code_model for use by Aditi.
compiler/options.m:
doc/user_guide.texi:
Add an option `--aditi-calls-mercury'.
This is needed for the Aditi tests, which currently don't
handle loading the shared libraries for user defined code.
Move `--aditi' into the compilation model options section.
compiler/rl.m:
Sort the constructors for d.u. types when creating an Aditi
type declaration to make it easier to find a particular
constructor.
compiler/code_model.m:
compiler/stack_layout.m:
Move represent_determinism into code_model.m, for use
by rtti_to_mlds.m.
compiler/rl_exprn.m:
compiler/rl_file.pp:
compiler/rl_out.pp:
compiler/hlds_module.m:
compiler/mercury_compile.m:
Create the procedures for each top-down Mercury goal which
needs to be called from Aditi.
Each created procedure has one input and one output argument,
both of which will have a `{}/N' type.
Allow nondet join conditions.
compiler/rl_exprn.m:
Use record syntax.
compiler/rl_out.pp:
Minor changes to the support for memoing.
runtime/Mmakefile:
runtime/mercury_imp.h:
runtime/mercury.h:
Add mercury_aditi.h.
runtime/mercury_stack_layout.m:
Add a comment about the duplication between MR_DETISM_*
and code_model.represent_determinism.
tests/valid/Mmakefile:
tests/valid/Mercury.options:
tests/valid/aditi_calls_mercury.m:
Test case.
Also, enable the Aditi tests in hlc grades.
|
||
|
|
e4b0328ade |
Provide a mechanism for declaring foreign types that can be operated on by
Estimated hours taken: 4
Branches: main
Provide a mechanism for declaring foreign types that can be operated on by
compare_representation. The intended use of the mechanism is to declare
a foreign type to represent proc_layouts in the declarative debugger,
as part of the representation of atoms; since atoms are keys in maps
in the oracle, they are input to compare_representation.
Since we don't want the result of compare_representation to change as
execution proceeds, we require an assertion that the foreign value is
stable, i.e. that the value of the foreign type variable completely
determines the data it points to, directly and indirectly. Proc_layouts
are static, so this is not a problem. Being able to do the comparison
requires the foreign type to be an integral type or a pointer, which
is what the existing can_pass_as_mercury_type assertion promises.
The stability is promised by a new assertion.
For foreign types that have both assertions, we use a new type_ctor_rep,
which differs from the existing type_ctor_rep for foreign types by doing
a real comparison instead of an abort in compare_representation.
doc/reference_manual.texi:
Document the new kind of assertion.
compiler/prog_data.m:
Add the new kind of assertion.
compiler/prog_io_pragma.m:
Parse the new kind of assertion.
compiler/rtti.m:
Add the representation of the new type_ctor_rep. Factor out the
stability of c_pointers as well as foreign types.
compiler/type_ctor_info.m:
Generate the new type_ctor_rep for types with both assertions.
compiler/foreign.m:
Export a predicate for use by type_ctor_info.m.
compiler/mercury_to_mercury.m:
Print the new assertion.
compiler/*.m:
Minor changes to conform to the diffs above.
Use state variable notation.
library/rtti_implementation.m:
Handle the new type_ctor_rep.
runtime/mercury_mcpp.h:
runtime/mercury_type_info.h:
java/runtime/TypeCtorRep.java:
Add the new type_ctor_rep to the runtime.
runtime/mercury_mcpp.h:
runtime/mercury_type_info.h:
compiler/type_ctor_info.m:
Increment the rtti version number.
When we rely on the availability of this new capability,
we should add a test for the new rtti version number to configure.in.
runtime/mercury_construct.c:
runtime/mercury_deconstruct.c:
runtime/mercury_ml_expand_body.h:
runtime/mercury_term_size.h:
Handle stable foreign types the same way as other foreign types.
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.h:
runtime/mercury_unify_compare_body.h:
Handle stable foreign types in a useful manner, relying on the
assertions behind them.
tests/hard_coded/stable_foreign.{m,exp}:
A test case for the handling of values of a stable foreign type.
tests/hard_coded/Mmakefile:
Enable the new test case.
|
||
|
|
885fd4a387 |
Remove almost all dependencies by the modules of parse_tree.m on the modules
Estimated hours taken: 12 Branches: main Remove almost all dependencies by the modules of parse_tree.m on the modules of hlds.m. The only such dependencies remaining now are on type_util.m. compiler/hlds_data.m: compiler/prog_data.m: Move the cons_id type from hlds_data to prog_data, since several parts of the parse tree data structure depend on it (particularly insts). Remove the need to import HLDS modules in prog_data.m by making the cons_ids that refer to procedure ids refer to them via a new type that contains shrouded pred_ids and proc_ids. Since pred_ids and proc_ids are abstract types in hlds_data, add predicates to hlds_data to shroud and unshroud them. Also move some other types, e.g. mode_id and class_id, from hlds_data to prog_data. compiler/hlds_data.m: compiler/prog_util.m: Move predicates for manipulating cons_ids from hlds_data to prog_util. compiler/inst.m: compiler/prog_data.m: Move the contents of inst.m to prog_data.m, since that is where it belongs, and since doing so eliminates a circular dependency. The separation doesn't serve any purpose any more, since we don't need to import hlds_data.m anymore to get access to the cons_id type. compiler/mode_util.m: compiler/prog_mode.m: compiler/parse_tree.m: Move the predicates in mode_util that don't depend on the HLDS to a new module prog_mode, which is part of parse_tree.m. compiler/notes/compiler_design.m: Mention prog_mode.m, and delete the mention of inst.m. compiler/mercury_to_mercury.m: compiler/hlds_out.m: Move the predicates that depend on HLDS out of mercury_to_mercury.m to hlds_out.m. Export from mercury_to_mercury.m the predicates needed by the moved predicates. compiler/hlds_out.m: compiler/prog_out.m: Move predicates for printing parts of the parse tree out of hlds_out.m to prog_out.m, since mercury_to_mercury.m needs to use them. compiler/purity.m: compiler/prog_out.m: Move predicates for printing purities from purity.m, which is part of check_hlds.m, to prog_out.m, since mercury_to_mercury.m needs to use them. compiler/passes_aux.m: compiler/prog_out.m: Move some utility predicates (e.g. for printing progress messages) from passes_aux.m to prog_out.m, since some predicates in submodules of parse_tree.m need to use them. compiler/foreign.m: compiler/prog_data.m: Move some types from foreign.m to prog_data.m to allow the elimination of some dependencies on foreign.m from submodules of parse_tree.m. compiler/*.m: Conform to the changes above, mostly by updating lists of imported modules and module qualifications. In some cases, also do some local cleanups such as converting predicate declarations to predmode syntax and fixing white space. |
||
|
|
c80d143cc8 |
The following change is only 98% complete, not 100%.
Estimated hours taken: 120
Branches: main
The following change is only 98% complete, not 100%. I am committing it in
this state because (1) we pass many more test cases in deep profiling grade
with it than without it, and (2) the double maintanance involved in fixing
CVS conflicts is preventing me from doing the last 2%.
Get the deep profiler to work for code that sets up to catch exceptions,
which for the last year or more has included the compiler, and to get it
almost working for code that actually catching exceptions.
The basic problem is that code that throws exceptions will in general cause
several calls to "return" without executing the exit or fail port codes that
the deep profiling transformation inserted into their bodies, and this leaves
the data structure being built by the deep profiling inconsistent. The solution
uses the same approach as we have adopted for the debugger: have the code that
handles the throwing of exceptions simulate a return from each call between
the throw and the catch, updating the deep profiling data structures as needed.
This requires us to be able to walk the stack at runtime not just in debugging
grades but also in deep profiling grades. Since the debugger already has the
mechanisms required for this, we reuse them. The procedure layouts used by the
debugger were designed to have three segments: the procedure stack walk
information, the procedure id, and the execution tracing information. We now
modify this design to make the third segment contain two pointers: to the
execution tracing information (for use by the debugger), and to the procedure's
proc_static structure (for use by deep profiling). Each pointer will be null
unless the pointed-to structure is required by compile-time options.
This common use by the debugger and by deep profiling of the stack-walk
structure and the procedure id structure (which deep profiling used to
generate independently and possibly redundantly) required some rearrangement
of the compiler's version of these data structures.
To make this rearrangement simpler, this diff removes a capability that
we theoretically supported but never used: turning on stack traces without
turning on execution tracing and vice versa. After this diff, stack tracing
is enabled if and only if either execution tracing or deep profiling is
enabled.
The diff also includes improvements in the debugging infrastructure for
debugging deep profiling, which were necessary for the implementation of the
rest of the changes.
compiler/deep_profiling.m:
The code in exception.m needs to know the locations of the variables
that we would pass to the exit or fail port code, so it can simulate
leaving the procedure invocation through the exception port. Without
this information, throwing an exception leaves the deep profiling
data structures of the procedure invocations between throw and catch
in an inconsistent state.
Deep_profiling.m creates these variables, but it doesn't know where
they will be at runtime, so it records their identities; the code
generator will allocate them stack slots and record the numbers of
these stack slots for placement in the now expanded proc layout
structures. Deep profiling used to generate static data structures
separately from the HLDS, but since the code generator now needs
access to them, we store their information in proc_infos in the HLDS.
Instead of passing the addresses of proc_static structures to the deep
profiling port procedures, pass the address of proc_layout structures,
since the information about the identities of procedures are now stored
not in the proc_static structure, but in the proc_layout structure
that points to the proc_static structure.
compiler/hlds_pred.m:
compiler/layout.m:
Move the definitions of the static data structures generated by deep
profiling from layout.m to hlds_pred.m, to allow deep_profiling.m
to store them in proc_infos.
compiler/hlds_pred.m:
compiler/rtti.m:
Move the definition of rtti_proc_label from rtti.m to hlds_pred.m,
since some of the new data structures in hlds_pred.m need it. Despite
its name, the rtti_proc_label type doesn't contain any info that
doesn't belong in the HLDS.
Add some information to the rtti_proc_label type that is now needed
by deep profiling, e.g. record determinisms instead of just code
models. Record explicitly the outcome of some tests that used to be
duplicated in more than one place in the compiler, e.g. for whether
the procedure (as opposed to the predicate) is imported. Change some
of the field names to be more precise about the field's meaning.
compiler/code_gen.m:
Transmit the contents of the deep profiling data structures stored in
the proc_info by deep_profiling.m to continuation_info.m, together
with the layout structures created for execution tracing and the
identities of the variables needed for handling exceptions,
when code generation for a procedure is complete.
After the goal that generates these variables, save them to stack
for use by the exception handler.
compiler/hlds_goal.m:
Add a feature to mark the goal that generates the deep profiling
variables needed by the exception handler.
compiler/hlds_llds.m:
Add a utility predicate for new code in code_gen.m
compiler/continuation_info.m:
Hold the deep profiling information computed by code_gen.m for use by
stack_layout.m.
compiler/layout.m:
compiler/layout_out.m:
Update the definitions of the data structures describing procedure
layouts, and the code writing them out, to reflect the use of some
parts of procedure layouts by deep profiling as well as debugging.
Change the layout structures generated by deep profiling to use
rtti_proc_labels, which are backend independent, instead of
proc_labels, which are specific to the LLDS backend.
Conform to the changes in runtime/mercury_stack_layout.h.
compiler/stack_layout.m:
Generate the updated version of proc_layout structures.
compiler/mercury_compile.m:
compiler/global_data.m:
Conform to the fact that deep profiling no longer generates layout
structures separate from proc_infos.
compiler/llds_out.m:
Register proc_layout structures instead of proc_static structures
for use by runtime/mercury_deep_profiling.c.
compiler/options.m:
compiler/handle_options.m:
Rename the require_tracing option as exec_trace, since this more
directly reflects its meaning.
Instead of having --debug set both require_tracing and stack_trace,
make it set (be the user-visible name of) just exec_trace;
the value of stack_trace is implied.
Turn off the specialization of deep profiling for self-tail-recursive
procedures for now. Due to the changes made by this diff in the data
structures involved in debugging, it cannot be debugged until this
change has been installed. Handling the full language is more important
than a specialization that reduces only stack space overheads, not
runtime overheads.
compiler/compile_target_code.m:
Conform to the changes in options.m and runtime/mercury_grade.h.
compiler/hlds_data.m:
Replace the deep_profiling_proc_static cons_id, and its associated tag,
to deep_profiling_proc_layout, since we now generate addresses of proc
layout structures, not of proc_static structures.
compiler/code_util.m:
Simplify some code based on the new info in rtti_proc_labels.
compiler/bytecode_gen.m:
compiler/dependency_graph.m:
compiler/higher_order.m:
compiler/hlds_out.m:
compiler/mercury_to_mercury.m:
compiler/ml_code_util.m:
compiler/ml_unify_gen.m:
compiler/opt_debug.m:
compiler/proc_label.m:
compiler/prog_rep.m:
compiler/rl_exprn.m:
compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
compiler/saved_vars.m:
compiler/switch_util.m:
compiler/unify_gen.m:
Minor changes to conform to the change from deep_profiling_proc_static
to deep_profiling_proc_layout, to the change in the structure of
rtti_proc_labels, to the changes in types of layout.m, and/or to the
new goal feature.
deep_profiler/measurements.m:
Reserve space for exception counts.
deep_profiler/html_format.m:
Add a column for exception counts.
deep_profiler/profile.m:
deep_profiler/read_profile.m:
Rename the data structures referring to compiler generated unify,
compare and index predicates to avoid misleading names: they are
not the only compiler generated predicates.
deep_profiler/read_profile.m:
runtime/mercury_deep_profiling.c:
Update the string that identifies deep profiling data files.
This is necessary because the format has changed: it now includes
information about exception port counts.
library/exception.m:
In deep profiling grades, execute the exception port code for every
procedure invocation between a throw and a catch, using the procedure
layout structures now generated by the compiler for every procedure.
Rename the function involved to reflect its new, more general purpose.
Update the definitions of the hand-written proc_static and proc_layout
structures for the procedures implemented via hand-written C code.
Indent C preprocessor directives and foreign_procs according to our
coding standards.
library/profiling_builtin.m:
Change the parameters of the call port code procedures from proc_static
to proc_layout. Reach the proc_static structure from the proc_layout
structure when needed. Include the proc_layout structure in any
messages from assertion failures.
Add some conditionally compiled debugging code.
Give some variables better names.
runtime/mercury_type_info.h:
runtime/mercury_builtin_types.c:
Move the macros required to create the proc_static structures
of unify and compare predicates from mercury_type_info.h
to mercury_builtin_types.c, since the latter is the only file
that needs them.
Use the same macros for creating the proc_static structures
of hand-written unify, compare and compare_reprentation predicates
as for user defined predicates. This required changing their naming
scheme.
runtime/mercury_unify_compare_body.h:
Conform to the new naming scheme.
runtime/mercury_ho_call.c:
Provide the mechanism for mercury_unify_compare_body.h to conform
to the new naming scheme.
Remove the definitions of the proc_static structures for
hand-written unify, compare and compare_reprentation predicates,
since these now have to be defined together with the corresponding
proc_layout structures in mercury_builtin_types.c.
runtime/mercury_builtin_types.[ch]:
Update the definitions of the hand-written proc_static and proc_layout
structures for the procedures implemented via hand-written C code,
and add the required declarations first.
Handle deep profiling of compare_representation as well as unify
and compare predicates on builtin types.
Handle deep profiling of compare_representation on user-defined types,
since this is done entirely in the runtime, not by compiler generated
predicates.
runtime/mercury_builtin_types_proc_layouts.h:
New header file containing the declarations of the proc layout
structures of the unify, compare and index predicates of builtin types.
Logically, these declarations belong in mercury_builtin_types.h,
but putting them there causes problems for the linker; the details
are explained in the file itself.
runtime/Mmakefile:
Add the new header file.
runtime/mercury_minimal_model.[ch]:
Update the definitions of the hand-written proc_static and proc_layout
structures for the procedures implemented via hand-written C code,
and add the required declarations first.
runtime/mercury_grade.h:
Replace the MR_REQUIRE_TRACING grade option with MR_EXEC_TRACING.
Besides being better named, the MR_EXEC_TRACING option implies
MR_STACK_TRACE.
Besides the overall binary compatibility version number, add subsidiary
version numbers for binary compatibility in deep profiling and
debugging grades. These will make it easier to bootstrap changes
(such as this) that affect binary compatibility only in such grades.
runtime/mercury_trace_base.c:
trace/mercury_trace.c:
Conform to the new names of the configuration parameters.
runtime/mercury_hand_compare_body.h:
runtime/mercury_hand_unify_body.h:
runtime/mercury_hand_unify_compare_body.h:
runtime/mercury_ho_call.c:
tools/make_port_code:
Pass proc_layout structures instead of proc_static structures
to deep profiling port routines.
runtime/mercury_conf_param.h:
Make MR_DEEP_PROFILING as well as MR_EXEC_TRACING imply MR_STACK_TRACE,
since deep profiling now needs stack tracing. (MR_STACK_TRACE needs
to be set in this file, because tests in this file depend on knowing
its value, and this file is among the first files included (in this
case indirectly) in mercury_imp.h.)
Document the macros controlling the debugging of deep profiling.
Enable printing of label names when the relevant deep profiling
debugging macro is set.
runtime/mercury_debug.c:
runtime/mercury_deep_rec_depth_actions.h:
runtime/mercury_deep_rec_depth_body.h:
runtime/mercury_exception_catch_body.h:
Get to proc_statics via proc_layouts.
runtime/mercury_deep_call_port_body.c:
runtime/mercury_deep_leave_port_body.c:
Get to proc_statics via proc_layouts.
Allow the debugger to disable deep profiling in Mercury code that is
part of the debugger, not of the user program being executed.
Add some more assertions.
runtime/mercury_engine.[ch]:
Add a new debugging flag that controls at runtime whether we generate
a human readable Deep.debug equivalent to the binary Deep.data files.
(We already had a mechanism for controlling this at compile time,
but this isn't flexible enough.)
runtime/mercury_wrapper.c:
Allow this new debugging flag to be set from MERCURY_OPTIONS.
runtime/mercury_deep_profiling.[ch]:
Respect this new debugging flag.
Update the hand-written proc_static structures representing the runtime
system.
Print out addresses of proc_layout as well as proc_static structures
when assertions fail.
Add a field to the measurement structure for exception port counts,
and write out this field with the other port counts.
Remove procedure id information from proc_static structures,
deep profiling now uses the procedure id in the proc_layout structure.
Add to proc_static structures fields that specify where, if anywhere,
the variables needed by exception.m to executed the exception port code
are in the procedure's stack frame.
Define a global flag that allows the debugger to disable deep
profiling in Mercury code that is part of the debugger, not of the
user program being executed.
Increase type safety by providing two versions of the function
for registering proc_layouts, one for the proc_layout structures
of user-defined predicates and one for unify, compare and index
predicates.
Fix a bug that occurs only if MR_DEEP_PROFILING_EXPLICIT_CALL_COUNTS is
defined (which it usually isn't): the initial call count was wrong.
runtime/mercury_deep_profiling_hand.h:
Fix a bug: the handwritten code saving deep profiling variables was
saving them in slots that didn't belong to the relevant stack frame.
Update to conform to the modified definitions of proc_static structures
and the fact that we now reach them via proc_layout structures.
runtime/mercury_exception_catch_body.h:
runtime/mercury_stacks.h:
Fix the other side of the bug in mercury_deep_profiling_hand.h
by reserving the right number of stack slots in the stack frames
of the various modes of exception__catch. Make it harder to make
the same bug in the future by getting the needed info from the
place in mercury_stacks.h that defines the structure of the relevant
stack frame.
runtime/mercury_proc_id.h:
Rename the procedure id structure fields referring to compiler
generated unify, compare and index predicates: they are not the only
compiler-generated predicates.
runtime/mercury_stack_layout.h:
Change procedure layout structures to allow them to be used for deep
profiling as well as for debugging, as described in the prologue above.
We don't need the capability to support label layout structures with
links to misnamed proc layout structures, and supporting it is
inconvenient, so delete the capability.
runtime/mercury_debug.c:
runtime/mercury_deep_profiling_hand.h:
runtime/mercury_layout_util.c:
runtime/mercury_ml_expand_body.h:
runtime/mercury_stack_trace.c:
runtime/mercury_types.h:
trace/mercury_trace_external.c:
Conform to the new names of the procedure id structure fields.
runtime/mercury_std.h:
Add some more arities for MR_PASTE for use in some of the modified
modules in the runtime.
trace/mercury_trace_internal.c:
Disable deep profiling actions in Mercury code that is part of the
debugger, not of the program being debugged.
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Make changes parallel to the ones in runtime/mercury_grade.h: delete
--stack-trace as an independent option, and make --debug set its
own option, not --require-tracing.
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/c2init.in:
scripts/mgnuc.in:
scripts/ml.in:
Conform to the changes in grade options for debugging and for deep
profiling.
tools/bootcheck:
If Mmake.stage.{browser,deep,library,runtime,trace}.params exist,
copy them to become the file Mmake.$dir.params in stage2/$dir
(where dir is derived from the name of the original file in the obvious
way). This allows more flexibility in the creation of the stage2;
for example, it allows some directories (e.g. runtime or library)
to be compiled with more debugging than other directories (e.g.
compiler). This may be required because compiling all directories
with lots of debugging may cause the linker to thrash.
Add an option, --disable-debug-libs, that clobbers the libraries
that should be linked in only in debugging grades.
To conserve disk space, remove Deep.data files created by the bootcheck
by default. Add an option, --keep-deep-data, to preserve these files.
Use a consistent mechanism (test -f) for testing the existence of
all files whose existence is tested.
When recording modification times, record the modification times
of some more files.
tests/hard_coded/Mmakefile:
In deep profiling grades, disable the test cases that we don't now
pass in such grades, and document the reasons for their failure.
Fix the misclassification of the write_binary test case.
|
||
|
|
8f1d366f1d |
This commit commits two separate but related changes.
Estimated hours taken: 16 Branches: main This commit commits two separate but related changes. The log messages for the two changes follow. ----------- Log message 1: Reduce the size of compiler-generated C source files even further. The reduction is 3 to 6% in non-debug LLDS grades, but 25 to 35% in debug grades. Together with my previous change, the size of parse_tree.modules.c has gone from more than 25 Mb to less than 8 Mb. The changes to the header files will be committed first, followed some days later by the changes to the compiler to generate the new macros. This gives time for people to "cvs update" their workspaces at their own pace before a change in the installed compiler forces them to do so. compiler/llds_out.m: Group the declarations of common_data structures, so that a single mention of the type name can be amortized over the declaration of many structures. Do not emit macro invocations needed only by time profiling unless we are doing time profiling. When emitting rvals, look for special cases in which we can emit shorter code: references to common_data structures and to type_ctor_info structures. Both occur a lot in the data structures the compiler generates in debugging grades. Record which type names have been declared, so we don't declare them twice. Convert some affected predicates to state variable syntax. compiler/layout_out.m: When possible, emit a shorthand macro that declares a label as it defines its label layout structure. compiler/rtti_out.m: Group the declarations of rtti data structures, so that a single mention of the type name can be amortized over the declaration of many structures. compiler/llds.m: Put common_data structures into a separate type, to allow them to be manipulated independently. Add a helper predicate. compiler/global_data.m: Conform to the changed types in llds.m. compiler/name_mangle.m: Add some helper predicates for use in llds_out.m and rtti_out.m. Reorder some predicate definitions for consistency with their declarations. compiler/rtti.m: Add a helper predicate. compiler/trace.m: Instead of generating long canned code fragments, generate calls to macros that expand to those canned code fragments. library/multi_map.m: Add function forms of the predicates in this module, for use in the modified compiler modules. runtime/mercury_misc.h: runtime/mercury_stack_layout.h: runtime/mercury_trace_base.h: runtime/mercury_type_info.h: Define the macros that the compiler now generates. runtime/mercury_goto.h: Define macros used to implement the macros in the above four header files. runtime/mercury_bootstrap.h: Move the definitions of bool, TRUE and FALSE to the section where they are defined only if the user asks for them. This is to avoid conflict with the module name "bool". tests/hard_coded/pragma_import.m: Rename bool to MR_bool. ----------- Log message 2: Generate even more compact output. These changes reduce the sizes of the C files generated from modules.m and make_hlds.m by about a further 15% in debug grades. The size of parse_tree.modules.c, originally about 25 Mb, is now down to 6.5 Mb, less than twice the size of parse_tree.modules.o (which is about 3.5 Mb). Even more dramatically, they reduce the size of parse_tree.modules.c and hlds.make_hlds.c by around 40% in non-debug grades, though the reduction is still larger in debug grades than in non-debug grades when expressed in bytes instead of as a percentage. compiler/layout_out.m: Declare more than one layout structure at a time when possible. compiler/llds_out.m: Declare and initialize more than one label at a time when possible. Even when declaring or initializing only one, get the macro definition to supply the mercury__ prefix. Use shorter macros to refer to stackvars and framevars. When referring to tagged pointers, use macros that supply the MR_mktag and MR_mkbody macros in the most common cases. When possible, emit calls in no-profiling forms, since these are shorter. |
||
|
|
ac354fc329 |
Eliminate an unnecessary difference between the compiler's representation of
Estimated hours taken: 4 Branches: main Eliminate an unnecessary difference between the compiler's representation of type constructor related RTTI structures and typeclass related RTTI structures. Just as for the former we separate out the identity of the type constructor, we now also separate out the identity of the type class for the latter. (That we didn't always do so was a historical accident, due to the fact that for a long time there was only one kind of type class related RTTI structure, base_typeclass_info.) compiler/rtti.m: Factor out the type class identity from tc_rtti_ids. Make base_typeclass_infos include a tc_name instead of a class_id (the same info in a different form) just as the other type class related tc_names do. compiler/base_typeclass_info.m: compiler/ml_unify_gen.m: compiler/mlds_to_gcc.m: compiler/name_mangle.m: compiler/opt_debug.m: compiler/rtti_out.m: compiler/rtti_to_mlds.m: compiler/unify_gen.m: Conform to the change above. In some cases, the change in representation allows us to eliminate duplicated code that wasn't worth factoring out with the previous representation. compiler/type_class_info.m: Export a function for use in the changed code in the above modules. |
||
|
|
4d9f8b8250 |
Fix a bug introduced by Simon's changes to equivalence types, which prevented
Estimated hours taken: 6
Branches: main
Fix a bug introduced by Simon's changes to equivalence types, which prevented
the browser for compiling when the library was compiled without intermodule
optimization. The symptom was a link error caused by the unify and compare
predicates for io__stream being local to io.c. This is a problem because
even though io__stream is primate to io.m, the browser generates references
to its unify and compare predicates, because io__stream is on the right hand
side of private type equivalences for io__input_stream and io__output_stream,
which are exported by io.m, and we now expand those equivalences.
compiler/hlds_data.m:
Add an extra field to type constructors' definitions, saying whether
the type constructor occurs on the right hand side of an equivalence.
Make the orders of some predicate declarations and definitions
consistent.
compiler/make_hlds.m:
Fill in this field with a placeholder value.
compiler/equiv_type_hlds.m:
Set this field to true if it is appropriate.
compiler/type_ctor_info.m:
Fill in this field for builtin types (for which its value is moot,
since such types are always exported).
compiler/hlds_pred.m:
Change the definition of procedure_is_exported to say that a procedure
is exported if it is a declared mode (not a mode created on demand in
the calling module) of a unify or compare predicate of a type
constructor in which this flag is set. This required changing the
interface of procedure_is_exported to include a module_info.
compiler/export.m:
compiler/ml_code_gen.m:
compiler/rtti.m:
Pass the extra argument to procedure_is_exported.
tests/hard_coded/abstract_eqv.{m,exp}:
tests/hard_coded/abstract_eqv_1.m:
A new test case to check for the bug fixed by this change.
tests/hard_coded/Mmakefile:
Enable the new test case.
|
||
|
|
5d6fd3bd6f |
Reduce the dependence of earlier parts of the compiler on the later ones.
Estimated hours taken: 4 Branches: main Reduce the dependence of earlier parts of the compiler on the later ones. Unnecessary import_module declarations in top level modules such as hlds.m cause unnecessary recompilations when adding new types in later modules, such as submodules of ll_backend.m. This change reduces the number of such unnecessary imports. There are no changes in algorithms, only functionality being moved around. compiler/code_model.m: Change this module from being a submodule of backend_libs.m to being a submodule of hlds.m, since nothing in it is dependent on any backend. compiler/arg_info.m: compiler/code_util.m: Change arg_info.m from being a submodule of ll_backend.m to being a submodule of hlds.m, since most of it is applicable to all current and foreseeable backends. Move the one exported predicate that is ll_backend dependent, and its support predicates, to code_util.m. compiler/backend_libs.m: compiler/ll_backend.m: compiler/hlds.m: Update include_module declarations in accordance with the above. compiler/prog_data.m: compiler/term_util.m: Instead of defining two separate types for holding argument size and termination information, one including HLDS-specific information (in term_util.m) and one not (in prog_data.m), use a polymorphic type defined in prog_data.m and two monomorphic instances. compiler/termination.m: compiler/mercury_to_mercury.m: Change the predicates for writing out argument size and termination information to handle the polymorphic type (we don't need special handling of the monomorphic versions), and move them from termination.m to mercury_to_mercury.m, since this allows us to avoid some undesirable dependencies. compiler/base_typeclass_info.m: compiler/hlds_code_util.m: Move the predicate make_instance_string from base_typeclass_info.m to hlds_code_util.m, again because it allows us to remove some undesirable dependencies. compiler/top_level.m: compiler/backend_libs.m: compiler/check_hlds.m: compiler/hlds.m: compiler/ll_backend.m: compiler/parse_tree.m: compiler/transform_hlds.m: Delete some import_module declarations of other top level modules in these top level modules. Some imports were totally unnecessary. Some imports were useful in only a small minority of submodules; those submodules now import the necessary top level modules directly. Move remaining import_module declarations to the implementation section where this is feasible. Where we still need to import modules we ideally shouldn't, note why. compiler/*.m: Update imports of code_util and arg_info. In some cases, import top level modules no longer imported by the parent module. In some cases, delete unnecessary imports. |
||
|
|
7274b57a57 |
More fixes for grade java.
Estimated hours taken: 0.5 Branches: main More fixes for grade java. library/builtin.m: Add Java stub implementation of compare_representation/3. compiler/rtti.m: Handle "TypeClassContraint_*" in tc_rtti_name_java_type the same way that we already handle it in ctor_rtti_name_java_type. |
||
|
|
f3830b9a35 |
Factor out some common code.
Estimated hours taken: 0.1 Branches: main Factor out some common code. compiler/rtti.m: Add a new predicate to test whether the name of an RTTI data structure we generate should be module qualified. compiler/mlds_to_c.m: compiler/mlds_to_gcc.m: Replace repeated instances of the same code with a call to the new predicate. |
||
|
|
c7f6612d9e |
Bug fixes and code simplifications in the RTTI handling
Estimated hours taken: 4 Branches: main Bug fixes and code simplifications in the RTTI handling for the Java back-end. compiler/rtti.m: For Java, map all the different C representations for TypeInfos to a single Java type "java.runtime.TypeInfo_Struct". Likewise map all the different C representations for type class constraints to a single Java type "java.runtime.TypeInfo_Struct". java/runtime/FA_PseudoTypeInfo_Struct1.java: java/runtime/FA_PseudoTypeInfo_Struct2.java: java/runtime/FA_TypeInfo_Struct1.java: java/runtime/FA_TypeInfo_Struct2.java: java/runtime/VA_PseudoTypeInfo_Struct0.java: java/runtime/VA_PseudoTypeInfo_Struct1.java: java/runtime/VA_PseudoTypeInfo_Struct2.java: java/runtime/VA_PseudoTypeInfo_Struct3.java: java/runtime/VA_PseudoTypeInfo_Struct4.java: java/runtime/VA_PseudoTypeInfo_Struct8.java: java/runtime/TypeclassInfo.java: Deleted these stub files, since they should no longer be needed. java/runtime/TypeInfo_Struct.java: Add two new constructors, corresponding to the constructors for the deleted FA_* and VA_*.java files. java/runtime/PseudoTypeInfo.java: Add some comments. Make the nullary constructor protected, to ensure that it is only used by derived classes, since it is only intended to be used for TypeInfo_Struct. |
||
|
|
647f7965ea |
Some fixes to the Java back-end, to make it work again after
Estimated hours taken: 3 Branches: main Some fixes to the Java back-end, to make it work again after Zoltan's recent type class RTTI changes. java/runtime/DuExistInfo.java: Add a new field "exist_constraints" to the DuExistInfo type and a corresponding argument to the constructor, to match Zoltan's recent changes. java/runtime/TypeClassId.java: java/runtime/TypeClassMethod.java: java/runtime/TypeClassDeclStruct.java: java/runtime/TypeClassConstraint.java: New files. These correspond to the C types MR_TypeClassId, MR_TypeClassMethod, MR_TypeClassDeclStruct, and MR_TypeClassConstraint in the C runtime. java/runtime/TypeCtorInfo_Struct.java: Add a comment. compiler/rtti_to_mlds.m: Don't cast null pointers to mlds__generic_type; they should have the right type already. Casting to mlds__generic_type here causes type errors for the Java back-end, because in Java there are no implicit conversions from Object (unlike C, which allows implicit conversions from `void *'). compiler/rtti.m: Change tc_rtti_name_java_type so that it maps the new typeclass-related RTTI types to the appropriate Java types. library/private_builtin.m: Define MR_PREDICATE and MR_FUNCTION. java/runtime/PredFunc.java: Fix a bug in my previous change: s/MR_PRED/MR_PREDICATE/ s/MR_FUNC/MR_FUNCTION/ |
||
|
|
9d892fbada |
Augment the descriptors of du functors with information about the type class
Estimated hours taken: 8 Branches: main Augment the descriptors of du functors with information about the type class constraints on their existentially typed arguments (if any). This is not yet used, but will be needed to perform type class membership tests (as we discussed on wednesday). We will need to bump the binary compatibility version number when we start relying on the newly generated data. Turn on the generation of the new type class descriptor data structures, since we now need them to describe functors with type class constraints. This in turn required making the generation of those data structures work for the MLDS backends as well as the LLDS backend. (The original diff that added those data structures updated only the LLDS backend.) compiler/mercury_compile.m: Always generate descriptors for type class declarations in both LLDS and MLDS backends. Generate descriptors for type class instances (which are not referred to from functor descriptors) only if --new-type-class-rtti is given. compiler/rtti.m: Instead of recording just the number of constraints on existentially typed arguments of functors, record the constraints themselves. Add new rtti_ids to describe (arrays of) constraints in DuExistInfos. Add predicates to look up the types of not just the data structures denoted by rtti_ids, but also their element types if they are arrays. This is needed because functor desciptors may now contain arrays of MR_TypeClassConstraints, even though we generate no data structure of that type; we generate structures of type MR_TypeClassConstraintN for various values of N, and cast them to MR_TypeClassConstraint. Factor out some common code. compiler/rtti_out.m: Implement the new field of DuExistInfos, and comment out the code needed to generate type class instances' method descriptors. Comment out the code for generating method addresses. (See the comment on mercury_typeclass_info.h below.) Fix a misleading variable name. compiler/rtti_to_mlds.m: Replace "not yet implemented" aborts when translating the new style type class decl and instance structures with actual translation code. Implement the new field of DuExistInfos. Factor out common code for making arrays of pseudo-typeinfos. compiler/mlds_to_gcc.m: Factor out the code for turning the type of an rtti data structure into the type of an array of them, to allow the latter step not to be done if we are want the type of the array elements. Add code for defining the types of type class declaration and instance descriptors. Implement the new field of DuExistInfos. compiler/type_ctor_info.m: Instead of recording just the number of constraints on existentially typed arguments of functors, record the constraints themselves. compiler/type_class_info.m: Generate instance descriptors only if requested. Export a function now needed by type_ctor_info.m. compiler/mlds.m: Allow mlds__rtti_type to refer to the types of elements of the arrays we generate, even if there is no rtti_id that has that type. compiler/mlds_to_c.m: Module qualify type class declaration and instance descriptors, at least for now; it is only base_typeclass_infos for which we need to detect duplicate definitions in different modules. Modify the types of du functor descriptors to include type class constraint information. compiler/ml_closure_gen.m: compiler/ml_util.m: compiler/mlds_to_c.m: compiler/mlds_to_java.m: compiler/opt_debug.m: Trivial changes to conform to the changes above. runtime/mercury_type_info.h: Add a field giving a list of type class constraints to MR_DuExistInfo. Move the definitions of the types describing type class constraints here from mercury_typeclass_info.h, since MR_DuExistInfo now refers to it. mercury_type_info.h cannot include mercury_typeclass_info.h without causing a circularity problem. runtime/mercury_types.h: Move a bunch of typedefs of structs here from mercury_typeclass_info.h, again to avoid circularity problems. runtime/mercury_typeclass_info.h: Remove the stuff moved to mercury_type_info.h and mercury_types.h. For now, do not include the code addresses of the procedure's representing an instance's methods in the instance structure, since the MLDS backend doesn't really have a notion of a generic code address, and even if it did it doesn't have an equivalent of the LLDS backend's code address to proc layout structure mapping, so the code addresses by themselves would be useless. (The code addresses needed for method calls are stored in the base_typeclass_info, not the instance structure.) When we want to start using information about instance methods in ways beyond what is afforded by the dictionary in the base_typeclass_info, we will need to revisit this decision, and will probably have to include the necessary information about the instance methods in the instance's data structure directly instead of via a pointer to the instance method implementations themselves. runtime/mercury_type_info.h: runtime/mercury_tags.h: Move a macro used to define enum constants that compiler generated code can refer to from mercury_type_info.h to mercury_tags.h (which already contains a similar macro whose definition is also dependent on --reserve-tag), since it is now also needed in mercury_proc_id.h. runtime/mercury_proc_id.h: Use that macro define MR_PREDICATE and MR_FUNCTION, since the compiler now generates references to them. |
||
|
|
b50430e8b9 |
Bug fixes for the Java back-end.
Estimated hours taken: 2 Branches: main Bug fixes for the Java back-end. The standard library now almost compiles in grade java. compiler/mlds_to_java.m: Output Java foreign declarations before any other code, to fix a problem with references to the TYPE_CTOR_REP constants in library/private_builtin.m. Fix some bugs where we were not being consistent about mangling the module name when naming the classes used to simulate taking procedure addresses. This bug broke Java compilation of library/char.m. Fix some bugs where the compiler was getting confused about which types map to array types in Java. For MLDS casts that cast to type_info or pseudo_type_info, generate Java constructor calls, not Java casts. This fixes type errors in the generated Java code. Simplify the code for hand_defined_type. compiler/rtti.m: Fix a bug in tc_rtti_name_java_type: map typeclass_infos to the Java type "java.lang.Object[]", not "java.lang.Integer[]". The latter didn't work because the elements which hold the method addresses do not have type java.lang.Integer. java/runtime/DuExistInfo.java: java/runtime/NotagFunctorDesc.java: Define constructors for these types. java/runtime/TypeInfo_Struct.java: Define some additional constructors for this type. library/builtin.m: Provide Java stub definitions of - classes for the types func/0 and c_pointer/0; - unify/compare preds for func, c_pointer, tuple, and void; Define Java definitions for the additional modes of compare/3 (they just call the first mode). library/exception.m: Define Java versions of make_io_state and consume_io_state, and Java stubs for throw_impl and catch_impl. Change try_all so that it calls catch_impl, like try does, rather than calling builtin_catch directly. This is needed since the .NET and Java back-ends only define catch_impl, not builtin_catch. library/io.m: Provide Java `pragma foreign_type' declarations for the types array.array(T) and io.system_error. This is needed to avoid compilation errors when building in grade `java'. library/private_builtin.m: Delete the Java definition of the type_info for type_info/1, because that is generated automatically now, after petdr's recent bug fix. Provide Java stubs definitions of the unify/compare preds for ref/1, heap_pointer/0, type_ctor_info, type_info, base_typeclass_info, and typeclass_info. Provide Java definition of dummy_var. library/type_desc.m: Provide Java stub definitions of - classes for type_desc/0 and type_ctor_desc/0 - unify/compare preds for those types library/store.m: Define unification and comparison predicates for the store(S) type. This is needed because the automatically generated ones might not have the right semantics, but also because the Java back-end generates some invalid code for the automatically generated unification and compare predicates (the generated code has some invalid references to "dummy_var"). |
||
|
|
12418653ee |
Bug fixes for the Java back-end.
Estimated hours taken: 12 Branches: main Bug fixes for the Java back-end. compiler/mlds_to_java.m: Fix a bug where we were outputting an incorrect type for nested structure initializers Fix a bug where we were outputting invalid syntax for some array initializers. Fix a bug where the code output for string comparisons was not properly parenthesized. compiler/mlds.m: Add a new argument to init_struct that specifies the type of the structure being initialized. This is needed to handled nested structure initializers for the Java back-end. compiler/rtti.m: Add new alternatives to ctor_rtti_name for all the types which are used as nested components of RTTI structures. This is needed in order to have appropriate RTTI types to use in rtti_to_mlds.m for the new field of init_struct. compiler/rtti_to_mlds.m: Substantial changes to fill in the new field of init_struct in all the generated initializers. compiler/ml_elim_nested.m: compiler/ml_optimize.m: compiler/ml_unify_gen.m: compiler/ml_util.m: compiler/mlds_to_c.m: compiler/mlds_to_gcc.m: compiler/mlds_to_il.m: Minor changes to handle the new argument to init_struct. compiler/mlds_to_gcc.m: compiler/opt_debug.m: Minor changes to handle the new alternatives for ctor_rtti_name. compiler/mlds_to_gcc.m: Fix a bug where it was generating a structure type, rather than an array thereof, for res_name_ordered_table. |
||
|
|
8693e293a2 |
This diff makes hlds_pred.m and many callers of its predicates easier to read
Estimated hours taken: 4 Branches: main This diff makes hlds_pred.m and many callers of its predicates easier to read and to maintain, but contains no changes in algorithms whatsoever. compiler/hlds_pred.m: Bring this module into line with our current coding standards. Use predmode declarations, functions, and state variable syntax when appropriate. Reorder arguments of predicates where necessary for the use of state variable syntax, and where this improves readability. Replace old-style lambdas with new-style lambdas or with partially applied named procedures. Standardize indentation. compiler/*.m: Conform to the changes in hlds_pred.m. This mostly means using the new argument orders of predicates exported by hlds_pred.m. Where this is now conveniently possible, change predicates to use state variable notation. In some modules, using state variable notation required changing the orders of arguments in the module's top predicate. compiler/passes_aux.m: Change the order of arguments in the calls this module makes to allow the callees to use state variable notation. Convert this module to state variable notation too. |
||
|
|
666c4b785e |
Move toward the proposed structures for representing type class information at
Estimated hours taken: 32
Branches: main
Move toward the proposed structures for representing type class information at
runtime by adding code for generating the structures corresponding to
base_typeclass_infos. The structures corresponding to typeclass_infos will
be added in a later change.
Register the new data structures in a table at runtime.
Add four new mdb developer commands for checking the contents of the new
type class table, as well as the contents of the existing type constructor
table: class_decl, type_ctor, all_class_decls and all_type_ctors.
compiler/rtti.m:
Add the data types required to represent the new runtime data
structures that will eventually replace base_typeclass_infos
inside the compiler.
Add the required function symbols to the data types representing both
the new RTTI data structures themselves and those representing
references to them.
Make the required changes to the predicates operating on the modified
data types, and add some required new predicates.
compiler/rtti_out.m:
Add code to write out the new data structures for the LLDS backend.
Make some changes in existing predicates to allow them to be used
in the new code.
compiler/layout_out.m:
Factor out some code that is now common with rtti_out.m.
compiler/type_class_info.m:
A new module to generate the new RTTI data structures.
compiler/backend_libs.m:
Include the new module.
compiler/options.m:
Add a new option, --new-type-class-rtti, to control whether we
invoke the top level predicate of type_class_info.m to generate
the new type class RTTI structures. We still generate and use
base_typeclass_infos regardless of the value of this option.
compiler/mercury_compile.m:
Invoke the code of the new module if --new-type-class-rtti is given.
compiler/opt_debug.m:
Add code to dump descriptions of the new rtti_ids.
compiler/mlds_to_gcc.m:
compiler/rtti_to_mlds.m:
Handle the new alternatives in the rtti data types, mostly by throwing
exceptions. The actual code should be written later by Fergus.
compiler/pseudo_type_info.m:
Module qualify the names of builtin types when generating
pseudo-typeinfos for them. This makes the naming scheme more regular.
compiler/base_typeclass_info.m:
compiler/notes/type_class_transformation.html:
Document the impending obsolescence of these files.
compiler/notes/work_in_progress.html:
List type class RTTI as work in progress.
library/list.m:
Add a utility predicate for use by compiler/rtti_out.m.
runtime/mercury_typeclass_info.h:
Make some changes in the C data types representing type class
information that I discovered to be necessary or advantageous
in the process of generating values of those types automatically.
Rename some types to make their names be better documentation.
Change some arrays of pointers to structures into arrays of structures,
where the structures at different array indexes are the same size.
Removing consts that rtti_out.m supplies automatically avoids
duplicate const errors from the C compiler.
Add #includes to make the file namespace clean.
Protect against multiple inclusion.
runtime/mercury_typeclass_info_example.c:
Remove this file. After the changes to mercury_typeclass_info.h, its
contents are no longer correct examples of the structures in
mercury_typeclass_info.h, and since the compiler can now generate
those structures automatically, hand-written examples no longer serve
any useful pupose.
runtime/mercury_types.h:
Add a new type, MR_CodePtr, for use in mercury_typeclass_info.h.
The compiler predicate tc_rtti_name_type wants single-word names
for types.
runtime/mercury_imp.h:
#include mercury_typeclass_info.h.
runtime/mercury_type_tables.[ch]:
Add functions to register and to look up type class declarations and
type class instances.
Add the functions and data structures required to look up all type
constructors and all type classes. The debugger uses these to support
the commands that let the programmer check the contents of these
tables.
Eventually, we should be able to use the type class tables to test
whether a vector of types is a member of a given type class.
runtime/mercury_wrapper.c:
runtime/mercury_type_info.[ch]:
Move the array of type_ctor_rep names from the mercury_wrapper module
to the mercury_type_info module, and make it always-defined and public;
the debugger also needs access to it now.
runtime/Mmakefile:
Add mercury_typeclass_info.h to the list of header files that other
files depend on.
trace/mercury_trace_internal.c:
Add four new mdb commands: class_decl, type_ctor, all_class_decls
and all_type_ctors.
Make some existing code follow our coding conventions.
doc/user_guide.texi:
doc/mdb_categories:
Document the four new mdb commands.
doc/reference_manual.texi:
Document (in a comment) the compiler's reliance on each type in an
instance declaration containing exactly one type constructor.
tests/debugger/class_decl.{m,inp,exp}:
A new test case to test the new mdb commands.
tests/debugger/Mmakefile:
tests/debugger/Mercury.options:
Add the new test case.
tests/debugger/completion.exp:
Expect the new commands to appear in the command name completion.
tests/debugger/mdb_command_test.inp:
Test the documentation of the new mdb commands.
Expect the new commands to appear in the command name completion.
|
||
|
|
7ef7bcbb30 |
Fix bugs in Zoltan's change to make array.array/1 a foreign type
Estimated hours taken: 3 Branches: main Fix bugs in Zoltan's change to make array.array/1 a foreign type which broke the IL backend, causing IL compilation errors when compiling the standard library. compiler/mlds_to_il.m: The type_ctor_info isn't defined in MC++ any more, so don't look for it in array__cpp_code.dll. compiler/rtti.m: compiler/type_ctor_info.m: Don't handle array as a special case. Array isn't builtin any more, so generate it as a foreign type, with the exception that the type_ctor_rep is TYPECTOR_REP_ARRAY, not TYPECTOR_REP_FOREIGN. This is needed so that accurate GC can trace arrays. |
||
|
|
31a4f2d85e |
Some fixes to the Java back-end to make it support RTTI
Estimated hours taken: 18 Branches: main Some fixes to the Java back-end to make it support RTTI better. The aim is to at least be able to *compile* code that makes use of polymorphism (e.g. the Mercury standard library!), although that aim is not yet achieved with this diff. Getting code which actually *uses* the RTTI to work is still a long way off... compiler/rtti.m: compiler/mlds_to_java.m: Fix some bugs in the code to output RTTI type names. compiler/mlds_to_java.m: Output the RTTI definitions. This is needed to avoid errors in code which references them. Handle initializers better; in particular deal with nested initializers properly. Pass the current module name down to output_lval, so that we can module-qualify data names only if they occur in a different module. This is needed to ensure that static data defined in other modules gets module-qualified, but local variables don't. This also required change some places which were incorrectly calling output_fully_qualified_name to instead call output_name. Add comments in the generated output code when generating "java.lang.Object", so that it is clearer what kind of object is involved. Add some special treatment for the types with hand-defined RTTI. java/runtime/*.java: Add some definitions of RTTI types, and some new constructors for the RTTI types that were already defined. These are currently all just stubs. |
||
|
|
599ef915d9 |
Instead of being relied on all over the place, centralize the compiler's
Estimated hours taken: 16 Branches: main Instead of being relied on all over the place, centralize the compiler's knowledge of the names of unify, compare and index predicates in one place, special_pred.m. This should make it easy to change the naming scheme once we switch over to compiler-generated type_ctor_infos for builtin types, which will eliminate the runtime system's knowledge of the naming scheme. compiler/hlds_pred.m: Add a field to pred_infos that says whether the predicate is a unify, compare or index predicate, and if so, for which type constructor. Code that used to test the predicate's name for __Unify__ etc now tests this field instead. Similarly the code that used to employ devious tricks to find out the type the unify/compare/index predicate is for. compiler/rtti.m: Include this field in rtti_proc_labels as well as pred_infos. compiler/make_hlds.m: Fill in this field as appropriate. compiler/proc_label.m: Replace the predicate name with special_pred_id in the proc_labels of unify, index and compare preds. compiler/special_pred.m: Narrow the interface to prevent reliance on the naming scheme for compiler-generated unify, compare and index predicates, except when absolutely necessary, i.e. when creating names for them. Narrow the mechanism required to reverse-engineer the type constructor a unify/compare/index predicate is for from the types to the functionality required by higher_order.m. compiler/code_gen.m: compiler/det_report.m: compiler/higher_order.m: compiler/intermod.m: compiler/layout_out.m: compiler/magic_util.m: compiler/ml_code_util.m: compiler/name_mangle.m: compiler/opt_debug.m: compiler/opt_util.m: compiler/optimize.m: compiler/polymorphism.m: compiler/post_typecheck.m: compiler/proc_label.m: compiler/rl_exprn.m: compiler/rl_key.m: compiler/simplify.m: compiler/termination.m: compiler/typecheck.m: compiler/unify_proc.m: compiler/unused_args.m: Update code and comments to conform to the changes above. compiler/hlds_out.m: Don't refer to the 'type' that a unify, compare or index predicate is for; refer to the type *constructor*. compiler/mlds_to_java.m: Delete an unused predicate. tests/invalid/purity/purity.err_exp: Update this expected output for the change in hlds_out.m. |
||
|
|
13bc17e046 |
Allow the compiler to generate type_ctor_infos for builtin and implementation
Estimated hours taken: 2 Branches: main Allow the compiler to generate type_ctor_infos for builtin and implementation artifact types if they are declared as foreign types with user-defined unify and compare preds. compiler/rtti.m: Define the full list of builtin and implementation artifact types (including robdds, which should be added shortly, and subgoals, which already exist, but don't yet have their own type_ctor_rep). Map them to their respective (possibly future) type_ctor_reps. compiler/type_ctor_info.m: Recognize builtin and implementation artifact types if we encounter a foreign type declaration for them. compiler/rtti_out.m: compiler/rtti_to_mlds.m: Add code to generate type_ctor_infos for builtin and implementation artifact types, if they are declared as foreign types. |
||
|
|
66eb5b46e4 |
Fix two related anomalies. One was that base_typeclass_infos were being
Estimated hours taken: 6 Branches: main Fix two related anomalies. One was that base_typeclass_infos were being created using the fcailities of rtti.m, but they were being referred to using data_addr, not rtti_addr, in the LLDS backend, and they had similar special treatment in the MLDS backend. The second is the special treatment of base_typeclass_infos within rtti.m, rtti_out.m and rtti_to_mlds.m, due to the fact that unlike the other data structures defined in rtti.m, their id does not include an rtti_type_ctor. When we move over to the proposed data structures for representing type class and instance information, base_typeclass_infos won't be alone in not including an rtti_type_ctor in their id. compiler/rtti.m: Introduce the notion of an rtti_id, which includes an rtti_type_ctor only for references to data structures for which that is appropriate. compiler/llds.m: compiler/mlds.m: Delete the redundant data_name base_typeclass_info. Use rtti_ids where appropriate. compiler/llds_out.m: Delete the code handling the deleted data_name base_typeclass_info. Conform to the changes to rtti.m and llds.m. compiler/ll_pseudo_type_info.m: compiler/ml_closure_gen.m: compiler/ml_unify_gen.m: compiler/ml_util.m: compiler/mlds_to_c.m: compiler/mlds_to_gcc.m: compiler/mlds_to_il.m: compiler/mlds_to_il.m: compiler/mlds_to_java.m: compiler/opt_debug.m: compiler/rtti_out.m: compiler/rtti_to_mlds.m: compiler/stack_layout.m: compiler/unify_gen.m: Conform to the changes above, which in several cases allows us to eliminate the special handling of base_typeclass_infos. compiler/base_typeclass_info.m: Follow up on an old XXX, and make a predicate tail recursive. |
||
|
|
f7dba9b8f8 |
Change "compiler_generated" in predicate names and field names
Estimated hours taken: 0.5 Branches: main compiler/*.m: Change "compiler_generated" in predicate names and field names to "is_unify_or_compare_pred", because that is the actual meaning of those predicates and fields. Delete the XXXs warning about the old misleading name. |
||
|
|
1cb657b998 |
Reduce inappropriate dependencies on ll_backend modules.
Estimated hours taken: 3 Branches: main Reduce inappropriate dependencies on ll_backend modules. Except for simplification of unnecessarily complicated logic in dependency_graph.m, this change only moves functionality around. compiler/llds_out.m: compiler/c_util.m: compiler/name_mangle.m: Move predicates that are used by multiple backends from ll_backend__llds_out to backend_libs__c_util and to a new module backend_libs__name_mangle. Make the relevant ones functions, and give some of them more meaningful names. compiler/trace.m: compiler/hlds_goal.m: Move a backend-independent predicate from ll_backend__trace to hlds__hlds_goal. compiler/llds.m: compiler/trace_params.m: Move the definition of the trace_port type from ll_backend__llds to libs__trace_params to avoid having libs__trace_params depend on ll_backend. compiler/exprn_aux.m: compiler/globals.m: Move the definition of the imported_is_constant from ll_backend__exprn_aux to libs__globals to avoid having libs__globals depend on ll_backend. compiler/*.m: Conform to the above changes. This removes many inappropriate dependencies on the LLDS backend. |
||
|
|
9551640f55 |
Import only one compiler module per line. Sort the blocks of imports.
Estimated hours taken: 2 Branches: main compiler/*.m: Import only one compiler module per line. Sort the blocks of imports. This makes it easier to merge in changes. In a couple of places, remove unnecessary imports. |
||
|
|
4954da84cc |
Reduce the dependence of the MLDS backend on the LLDS backend by moving
Estimated hours taken: 2 Branches: main Reduce the dependence of the MLDS backend on the LLDS backend by moving functionality dealing with proc_labels from the LLDS backend (code_util.m) to a new module, proc_label.m, which is part of backend_libs. compiler/code_util.m: compiler/proc_label.m: Move a type and some code from code_util to the new module. Convert predicates to functions as relevant. (The old code was written before functions were available). compiler/backend_libs.m: Add proc_label to the list of submodules. compiler/rtti.m: Rename a function to avoid a name clash with a function in proc_label.m. compiler/*.m: Conform to the changes above. Ensure that all imports of modules in the compiler directory are on lines of their own, to make CVS merges easier. Sort the imports. |
||
|
|
742c0a0a28 |
Fix a bug caused by the fake arities of the types defining typeinfos:
Estimated hours taken: 6
Branches: main
Fix a bug caused by the fake arities of the types defining typeinfos:
the debugger was trying to construct a typeinfo describing the types of
variables such as TypeInfo_for_K. The problem occured whenever the debugger
tried to do anything with such variables: either with print_optionals,
or via the node-creation function of the declarative debugger.
runtime/mercury_make_tyoe_info_body.h:
Special case the typeinfo-like fake-arity types.
runtime/mercury_type_info.h:
Add a flag for identifying typeinfo-like fake-arity types.
Also add flags for identifying variable-arity type constructors
and discriminated union type constructors. These flags cannot be
used until the compiler part of this change has been installed.
Make the flag field unconditionally part of type_ctor_infos,
now that all installed compilers generate it.
Factor out the macros for defining type_ctor_infos so that one
definition serves both backends. This also fixes a bug: the
MR_HIGHLEVEL_CODE version was using an obsolete version number.
Delete some obsolete forms of these macros.
runtime/mercury_mcpp.h:
Delete the obsolete forms of these macros from here too. They were
never used.
runtime/mercury_builtin_types.c:
Add the relevant flags to the definitions of the type_ctor_infos
of builtin types.
runtime/mercury_type_info.c:
Import a header now needed by mercury_make_type_info_body.h, which
is #included in this file.
runtime/Mmakefile:
Delete some redundant dependencies.
compiler/rtti.m:
Extend the type of type_ctor_info flags to include the new flags.
compiler/type_ctor_info.m:
Generate the new type_ctor_info flags, the ones that can be set
in type_ctor_infos generated by the compiler.
tests/debugger/declarative/mapinit.{m,inp,exp,exp2}:
New test case that exhibits the problem.
tests/debugger/declarative/Mmakefile:
Turn on the test case.
|
||
|
|
9aeb2516ec |
Avoid dependencies on ll_backend.code_util in *hlds.*.
Estimated hours taken: 1 Branches: main Avoid dependencies on ll_backend.code_util in *hlds.*. compiler/code_util.m: compiler/hlds_pred.m: Move the predicates to identify builtins into hlds_pred.m. compiler/*.m: Update calls and remove unnecessary imports. |
||
|
|
34a278b75b |
Add a facility for recording boolean flags in the RTTI structures
Estimated hours taken: 4 Branches: main Add a facility for recording boolean flags in the RTTI structures of type constructors. At the moment, the only flag records whether the type constructor has a tag value reserved for HAL variables. The flag is not used yet. runtime/mercury_type_info.h: Add the extra field if MR_TYPE_CTOR_INFO_HAS_FLAG is defined. (The #ifdef will be deleted once bootstrapping is complete.) runtime/mercury_mcpp.h: Add the extra field, since it will be needed after bootstrapping. compiler/llds_out.m: compiler/mlds_to_c.m: Define MR_TYPE_CTOR_INFO_HAS_FLAG for bootstrapping. compiler/rtti.m: Add the field to the backend-independent RTTI description of type_ctor_infos, together with its encoding function. compiler/type_ctor_info.m: Gather the information about the flags, for use when constructing the RTTI structure. compiler/rtti_out.m: Add the flag field to the type_ctor_info structure for the LLDS backend. compiler/rtti_to_mlds.m: Add the flag field to the type_ctor_info structure for the MLDS backends. compiler/mlds_to_gcc.m: Add the flag field to the type_ctor_info structure for the gcc backend. library/rtti_implementation.m: Add the flag field to list of fields of the type_ctor_info structure. |
||
|
|
f43612a3ee |
Avoid a bug where duplicate declarations were not being detected.
Estimated hours taken: 7 Branches: main Avoid a bug where duplicate declarations were not being detected. This prevented the compiler from bootstraping with MSVC in the grade none.gc.tr.debug. compiler/rtti.m: Remove the varset from the rtti_proc_label structure. This is because rtti_proc_label is used as part of the key for the decl_set structure and sometimes the varset contains all the variables in the proc and sometimes only the headvariables leading to different keys representing the same declaration. Instead record the prog_var and its name together in an assoc_list. compiler/code_util.m: compiler/ml_code_util.m: Handle the new rtti_proc_label structure. |