mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 02:43:40 +00:00
compiler/common.m:
compiler/const_prop.m:
compiler/format_call.m:
compiler/simplify_goal.m:
compiler/simplify_goal_call.m:
compiler/simplify_goal_conj.m:
compiler/simplify_goal_disj.m:
compiler/simplify_goal_ite.m:
compiler/simplify_goal_scope.m:
compiler/simplify_goal_switch.m:
compiler/simplify_goal_unify.m:
compiler/simplify_info.m:
compiler/simplify_proc.m:
Convert these modules, which comprise the simplification pass,
to use var_tables.
compiler/det_analysis.m:
compiler/det_report.m:
compiler/det_util.m:
Convert the modules of determinism analysis to use var_tables.
compiler/direct_arg_in_out.m:
Convert this module to use var_tables, because simplification uses it,
though it is also invoked separately. And this conversion is limited;
it still uses varsets and vartypes in the code that clones a procedure.
It will be simpler to fix this when pred_infos and proc_info switch over
to actually storing var_tables, not making them up on demand.
compiler/hlds_pred.m:
Export a predicate for use by new code in direct_arg_in_out.m.
compiler/goal_path.m:
Allow the code in this module to get its type information either
from vartypes or from var_tables, since some of the modules above
now need the latter.
compiler/instmap.m:
Provide a var_table variant of an existing predicate.
compiler/lambda.m:
compiler/par_loop_control.m:
compiler/pd_util.m:
Conform to the changes above.
compiler/typecheck.m:
compiler/typecheck_errors.m:
Fix an arguable bug exposed by the changes above. The invalid/bug257.m
test case contains a variable, Gee, which occurs only in a
"require_complete_switch [Gee]" scope. Typechecking did not assign it
even a dummy type, and this was not a problem, because the only
compiler pass that looked it, determinism analysis, needed only its name.
However, determinism analysis now gets the name from the var_table,
which has entries only for variables that have a type (since all variables
are supposed to have one after typechecking). This meant that the
old code of typecheck.m lead to a compiler crash when det_report.m
tried to look up this variable's name for the error report saying that
the goal in that require_complete_switch scope is not a switch on Gee.
Fix this by ensuring that variable appearing in scope_reasons
always have a type, even if that type is a type variable.
compiler/var_table.m:
Fix the code of the deletion predicates for situations in which
the highest numbered variable is deleted.
Delete the var_table_add_corresponding_lists predicate,
since its implementation cannot be made to work without access to the
module_info, which, due to being in parse_tree package, var_tables.m
cannot have.
Fix some variable names.
tests/invalid/bug257.err_exp:
Expect the warning that reports an unbound type.
10 lines
442 B
Plaintext
10 lines
442 B
Plaintext
bug257.m:017: In predicate `oops'/2:
|
|
bug257.m:017: warning: unresolved polymorphism.
|
|
bug257.m:017: The variable with an unbound type was:
|
|
bug257.m:017: Gee: V_1
|
|
bug257.m:017: The unbound type variable will be implicitly bound to the
|
|
bug257.m:017: builtin type `void'.
|
|
bug257.m:022: Error: the goal inside the require_complete_switch [Gee] scope is
|
|
bug257.m:022: not a switch on `Gee'.
|
|
For more information, recompile with `-E'.
|