profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/zsomogyi/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha be8ecd7c9bf3b93df068b9613598247a46a8bc6c

Add "Error:" at the start of an error message.

view details

push time in 5 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha d64961d79d1bb74dc6b9884cdd29e4fddf92c142

Use checked types/insts/modes in parse_tree_module_src. This means that we can do the exact same checks (and, if needed, generate the exact same error messages) when generating interface files as when generating target language code. This should also allow us to simplify the process of adding type, inst and mode definitions to the HLDS. compiler/prog_item.m: As above. Delete unused function. compiler/error_util.m: Add mechanisms that allow us to distinguish (a) error specs that represent a type, inst or mode name definition being invalid, from (b) other error specs. compiler/check_type_inst_mode_defns.m: Improve the error messages we generate, in several ways. First, for each message, specify a real severity. When the messages could be seen only when generating interface files, making them all warnings was fine and preserved old behavior, but since soon these will be the only place for these checks, we need to call errors errors. Second, specify, in the phase, which errors represent a invalid type, inst or mode definition, and which don't. Third, improve the wording of messages. In some places, do this by being clearer about the distinction between declarations and definitions. In others, do it by including more information in the message. In yet others, do it by recovering some kinds of mistakes (mostly items being in the wrong section) enough to avoid avalanche errors. Fourth, fix a bug. If a type ctor has an exported *declaration*, then it is ok for any foreign type definitions for that type_ctor being in the implementation section, but if the type_ctor has an exported Mercury *definition*, then any foreign_type definitions must be in the interface section as well. The code that handled both these situations did not enforce that. Fifth, fix another bug: do not include foreign type definitions in the source definitions of a type_ctor twice, once as a "du" (sic) definition, and once as itself. compiler/convert_parse_tree.m: Check type, inst and mode definitions in raw_compilation_units when creating parse_tree_module_srcs. compiler/comp_unit_interface.m: Make the code constructing interface files work from the checked maps in parse_tree_module_srcs. compiler/make_hlds_passes.m: Set the flags that say we have found invalid type, inst or mode definitions from the error specs constructed during the creation of the checked type, inst and mode maps. compiler/add_type.m: Comment out an error message for a condition that will be detected and reported by check_type_inst_mode_defns.m. compiler/make_hlds_separate_items.m: For now, turn checked maps of type, inst and mode definitions back to item lists for addition to the HLDS. Adding whole checked definitions to the HLDS will be done by a future change. compiler/make_hlds_error.m: Fix misleading indentation in an error message. compiler/parse_tree_out.m: Conform to the changes above. Generate output whose indentation does not depend on tab settings. compiler/check_raw_comp_unit.m: compiler/equiv_type.m: compiler/get_dependencies.m: compiler/grab_modules.m: compiler/module_qual.collect_mq_info.m: compiler/module_qual.qualify_items.m: Conform to the changes above. compiler/parse_type_defn.m: Fix misleading error message for ":- type <name> = <type>". tests/debugger/foreign_type.{m,exp}: Delete a redundant type declaration to avoid a warning, and update the .exp file to expect the new line numbers. tests/invalid/any_mode.err_exp: tests/invalid/bug436.err_exp: tests/invalid/bug476.err_exp: tests/invalid/exported_foreign_enum.err_exp: tests/invalid/fe_unmapped_nonverbose.err_exp: tests/invalid/fe_unmapped_verbose.err_exp: tests/invalid/foreign_enum_invalid.err_exp: tests/invalid/foreign_solver_type.err_exp: tests/invalid/foreign_type_visibility.err_exp: tests/invalid/pragma_qual_error.err_exp: tests/invalid/repeated_field_name.err_exp: tests/invalid/subtype_foreign.err_exp: tests/invalid/type_with_no_defn.err_exp: tests/invalid/types2.err_exp: tests/invalid/user_field_access_decl_conflict.err_exp: tests/invalid_nodepend/bad_foreign_type.err_exp: tests/invalid_nodepend/bigtest.err_exp: tests/invalid_nodepend/invalid_typeclass.err_exp: tests/invalid_nodepend/types.err_exp: tests/invalid_nodepend/uu_type.err_exp: tests/invalid_nodepend/where_abstract_enum.err_exp: Expect the new error messages. tests/invalid/abstract_solver_type.{m,err_exp}: tests/warnings/abstract_solver_type.{m,exp}: Move the abstract_solver_type test case from invalid to warnings, because this diff changes its only error to be only a warning. tests/invalid/Mmakefile

view details

push time in 5 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha cfe6782dd2ff415e032d5b5cbcfd72b8a667e543

Improve diagnostics for circular insts and modes. compiler/add_mode.m: Improve diagnostics for circular insts and modes in several ways. - Generate one error message per cycle, not one error message per inst. In the case of cycles containing more than one inst or mode, this reduces clutter. - Unlike the old code, we do print a context for every inst or mode in a cycle, rather than just for the first. - Avoid module qualifying local inst and mode names unless that qualification actually avoids ambiguity. - Use more expansive wording that actually explains *why* a circular inst or mode is a problem. tests/invalid/circ_inst5.m: Extend this test case to test corner cases of the new code. tests/invalid/circ_inst.err_exp: tests/invalid/circ_inst2.err_exp: tests/invalid/circ_inst3.err_exp: tests/invalid/circ_inst4.err_exp: tests/invalid/circ_inst5.err_exp: tests/invalid/circ_mode.err_exp: tests/invalid/circ_mode2.err_exp: tests/invalid/circ_mode3.err_exp: tests/invalid/circ_mode4.err_exp: Expect the updated error messages.

view details

push time in 6 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 1e091980f0a909c6c99fc38ad7d6da5b5a63f32e

Move circularity check oversight to add_mode.m.

view details

push time in 7 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 089836c23e6976e95a3567a0a7a2596b136fb6f7

Fix a bug in lco.m that left vars undefined. compiler/lco.m: Do not replace a plain call such as type_check(E, T) with LCMCpr_type_check_1(E, AddrOfT) which does NOT bind T, if later code in the procedure needs the value of T in the current stack frame. This fixes Mantis bug 539. tests/valid/Mmakefile: Enable the bug539 test case. tests/valid/Mercury.options: Do not force bug539.m to be compiled in asm_fast.gc; the bug is not grade dependent.

view details

push time in 8 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 219198489f5ce00ae8c3b0308cebafa287e05842

Don't ask callers to pass unneeded info.

view details

push time in 9 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 02b4e185743c2f5c8a9ebcb90b9f60c42d99d735

Put related predicates together. Improve logging.

view details

push time in 9 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 1df97a0d13f730a7831a1bc7d6b32f62d886b961

Improve predicate names and comments.

view details

push time in 9 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 7f76db24718ba45b856d18d09be696340cbe0341

Don't override make rules in tests/invalid. tests/invalid/Mmakefile: Some test cases have long had separate make rules for them, which specified what actions should be taken for them. However, these test cases were also included in either the list of single-module test cases, or the list of multi-module test cases, each of which had a generic rule that *also* include actions. This got the right result because the specific rules are all after the generic rules, and later applicable rules override earlier ones. However, make print expressed its displease by printing not one but two separate warnings for each such test case, warnings like this: warning: overriding recipe for target 'illtyped_compare.err' warning: ignoring old recipe for target 'illtyped_compare.err' Currently, there is no mechanism to shut up these warnings for overrides. (A bug report filed against GNU make in 2019 asks for a mechanism that could do this, but it seems to have been completely ignored.) The only way to get rid of the warnings is therefore to eliminate the override. This diff does that by - introducing separate make variables to hold the list of plain single-module, plain multi-module, and C-interface-using test cases that have special make rules for them; - restricting the generic rules to the single-module and multi-module test cases that do NOT have special rules for them; but - including the test cases with special rules in the list of test cases to be executed.

view details

push time in 9 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 95d04ab947d1f767d7fd6472d8103d742c42c381

Add tests/valid/bug539.m. Add to Peter's test case a description of the cause of the problem.

view details

push time in 10 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 29ba71f6c7a3f3a33b7fc0b4661f00f2b4aa0589

Fix a bug in inst/mode circularity detection. It allowed circular insts to be added to the HLDS undetected, which meant a later pass got into an infinite loop. compiler/make_hlds_passes.m: Check for circularities in inst definitions only *after* all insts have been added to the HLDS, because until then, a circularity check may fail not because of the absence of a circularity in the inst definitions in the program, but because of the absence of a circularity in the inst definitions *added to the HLDS so far*. Do likewise for mode definitions. compiler/add_mode.m: To make the above possible, split the predicates that do circularity checks on insts and modes from the predicates that add insts and modes to the HLDS. tests/invalid/circ_inst5.m: Reorder inst definitions to expose the infinite loop bug in compilers without this diff. tests/invalid/circ_inst*.err_exp: tests/invalid/circ_mode*.err_exp: In the case of mutually recursive pairs of insts or modes, expect error messages for both definitions, not just the later definition.

view details

push time in 11 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha b19939be0742aec8966e785c7786bf3e6fdf56c4

Improve some comments.

view details

push time in 11 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 4548706b8525b931abec4be3e29db5a656b1e0ee

Switch to checked type/inst/mode maps for .int0. compiler/prog_item.m: As above. compiler/comp_unit_interface.m: compiler/convert_parse_tree.m: compiler/equiv_type.m: compiler/get_dependencies.m: compiler/grab_modules.m: compiler/make_hlds_separate_items.m: compiler/module_qual.collect_mq_info.m: compiler/parse_tree_out.m: compiler/recompilation.check.m: compiler/recompilation.version.m: Conform to the change above.

view details

push time in 19 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 412651913935ebfa752b31b7b23ec2adf401c4a9

Separate subtypes from du types in parse trees. compiler/prog_data.m: Split type_details_sub from type_details_du, and separate parse_tree_sub_type from parse_tree_du_type. This gets us two things: - It allows us to encode the prohibition on user-specified equality and comparison predicates, and "where direct_arg is" clauses, on subtype definitions. - It gives us data types we can use to represent (a) only subtype definitions, and (b) only non-subtype du definitions. Note that this diff deliberately leaves the HLDS representation of subtypes unchanged. This is because while a subtype *definition* may not specify e.g. equality and comparison predicates, a subtype *can* have equality and comparison predicates; it just has to get them from its base type. And the same applies to direct args. compiler/parse_type_defn.m: Enforce the invariant that subtypes may not have user-specified equality and comparison predicates, or "where direct_arg is" clauses. If we find a subtype definition that does have one or both of these non-allowed and now-nonrepresentable components, we do still want to return the rest of the type definition, in order to avoid misleading error messages about that type having no definition at all. To make this possible, allow the parsing predicate to return error_specs "alongside", as well as "instead of", the item or marker being parsed. compiler/parse_item.m: compiler/parse_module.m: compiler/parse_class.m: Handle these "alongside" error messages. compiler/prog_item.m: Separate out subtypes from other du types in type definition maps. compiler/add_type.m: Delete a semantic check that is now in parse_type_defn.m. Conform to the change to the representations of subtypes/du types in the parse tree. compiler/item_util.m: Add a new utility function for subtypes. compiler/check_type_inst_mode_defns.m: compiler/comp_unit_interface.m: compiler/convert_parse_tree.m: compiler/decide_type_repn.m: compiler/equiv_type.m: compiler/get_dependencies.m: compiler/intermod.m: compiler/make_hlds_passes.m: compiler/make_hlds_separate_items.m: compiler/module_qual.collect_mq_info.m: compiler/module_qual.qualify_items.m: compiler/parse_tree_out.m: compiler/prog_type.m: compiler/recompilation.check.m: compiler/recompilation.version.m: Conform to the change to the representations of subtypes/du types in the parse tree.

view details

push time in 19 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 12605f8c1061592f66d0d5200402c98a466b41f3

Use checked type/inst/modes in parse_tree_int[123]s. With this change, we guarantee that if any type, inst or mode has inconsistent definitions in its defining module, those inconsistencies will not make it into the the module's .int/.int2/.int3 files, where they would confuse any compiler invocation that reads them in. compiler/prog_item.m: Replace {type,inst,mode}_ctor_defn_maps, which are unchecked, with {type,inst,mode}_ctor_checked_maps in parse_tree_int[123]s. To make this possible, - generalize the items containing inst and mode definitions the way that items containing type definitions have been generalized previously, to allow them to store particular *kinds* of inst or mode definitions; - move the definitions of type_ctor_checked_map and its components here from check_type_inst_mode_defns.m; and - add similar, but simpler, definitions for {inst,mode}_ctor_checked_map. compiler/check_type_inst_mode_defns.m: Delete the type definitions moved to prog_item.m. Modify the checking process slightly to allow it to check properly the definitions we now put into .int, .int2 and .int3 files. Add code to check inst and mode definitions as well as type definitions. Since insts and modes have only one non-abstract kind of definition, these codes are much simpler than the code for checking types. compiler/comp_unit_interface.m: Construct checked type, inst and mode definitions to put into .int, .int2 and .int3 files. The .int2 and .int3 parts were reasonably simple, but the .int part requires some detailed case-by-case analysis. compiler/convert_parse_tree.m: Check the type, inst and mode definitions read in from .int/.int2/.int3 files when creating their parse trees. If those files were generated by a compiler that has this diff, then this checking process should not find any problems. compiler/equiv_type.m: Operate on checked type, inst and mode definitions instead of their unchecked versions. Delete an unneeded field from a structure. compiler/error_util.m: Add {qual,unqual}_{inst,mode}_ctor as format components, so that any error messages about inst and mode definitions do not have to convert inst_ctors and mode_ctors to symname/arity pairs. compiler/item_util.m: Add some utility predicates and functions needed by the changes above. compiler/module_qual.collect_mq_info.m: Since checked type, inst and mode definitions can contain info that is derived from both the interface and implementation sections of a module, add the capability to get only the *publicly* declared types, insts and modes from their respective kinds of checked definitions. compiler/module_qual.qualify_items.m: Module qualify checked type, inst and mode definitions. compiler/module_qual.qual_errors.m: Treat references to inst_ctors and mode_ctors in qualification error messages the same way as we treat type_ctors. Also replace mq_ids that are intended to represent classes with class_ids, to represent the intent better. compiler/parse_tree_out.m: Output the updated parse_trees of .int/.int2/.int3 files. compiler/prog_data.m: Add an XXX about a future change. compiler/decide_type_repn.m: compiler/get_dependencies.m: compiler/grab_modules.m: compiler/make_hlds_separate_items.m: compiler/pred_table.m: compiler/recompilation.check.m: compiler/recompilation.version.m: Conform to the changes above. library/maybe.m: Add utility predicates needed by the code above. NEWS: Announce the new predicates in maybe.m. tools/intdiffall: A script that shows differences between the automatically generated interface files between stage 1 and stage 2, which helped debug this diff.

view details

push time in 20 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 3c8e8ac97a8463f76735e0a582a47b91211c94b4

Add missing word in comment.

view details

push time in 20 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha f1a00cf806a394a83a95596b18f6d07ee05d5eee

Don't put comment into .opt files.

view details

push time in 20 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha b3b140207b04c8644df7bf4671b479223607bb00

Update the style of a test.

view details

push time in 21 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 83dede77f8a3a255f27596fb1cdd63eeb9c83d71

Fix output of trace goals in .opt. compiler/hlds_out_goal.m: Do not output io() and state() components in trace goals when generating output that is intended to be parsed as Mercury code (as opposed to when generating HLDS dumps), since in the goal in the scope will already have had applied to it the transformations needed to implement those components. This fixes the failure of tests/hard_coded/trace_goal_opt.

view details

push time in 22 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 3beb6b8eb85bd0acc14a20b75d777c82d9fcfa14

Fix non-rafeism.

view details

push time in 22 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha e0e36b2e245c377cb98dce3a1a091de6bfbff14f

Fix omitted spaces.

view details

push time in 22 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha e05af6a602e96cab96c5842e8785d60e02d67de8

Fix a comment.

view details

Zoltan Somogyi

commit sha 3445e21ce422050c08394dc174c3b4fd7106a40a

Fix rafe-isms.

view details

push time in 24 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 3ad06589b71010c86f5985064f3b50c61dae31ea

Rewrite the explanation of the state var transform.

view details

push time in 24 days

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha f8f71346c433c8daa12067507572580d37cd1d66

Fix a comment.

view details

Zoltan Somogyi

commit sha 57fa6d0e041e58a967b8cb047884125e431592ff

Make warn_implicit_stream_calls generate warnings. It used to generate only severity_informational messages.

view details

push time in a month

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 07ce690961e61c13c71e2f4ac60447accc5a241e

Fix formatting of trace goal parameters.

view details

push time in a month

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha f277de286f02a9b02cf1393b25373701c5c93ff0

Clarify documetation of state vars.

view details

push time in a month

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha b7b5eb22416a8aa248c80fca5671a28e93ec7071

Fix comments.

view details

Zoltan Somogyi

commit sha e85d98bac1c40c8f371eb6df59b81c71966ce1f3

Clarify some comments.

view details

push time in a month

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 8e9896a84de7253a7f718f7ec7d99302fcd63c32

Clarify some code.

view details

Zoltan Somogyi

commit sha cbb59b8364472677a3078fba1d7172290c949fac

Add bug538.m as feature request placeholder.

view details

push time in a month

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha efc3ce720baf9e73b34d8824557979a9ae469107

Simplify some code.

view details

push time in a month

push eventMercury-Language/mercury

Zoltan Somogyi

commit sha 22038a5b286a350f9bd861636a977f08dd6941e8

Rename check_parse_tree_type_defns.m ... ... to check_type_inst_mode_defns.m. compiler/parse_tree.m: Change the name in the include_module declaration. compiler/comp_unit_interface.m: compiler/convert_parse_tree.m: compiler/decide_type_repn.m: compiler/prog_foreign_enum.m: compiler/prog_item.m: Change the name in import_module declarations. compiler/notes/compiler_design.html: Change the name in the documentation.

view details

push time in a month