Files
mercury/tests/invalid/bug83.err_exp
Zoltan Somogyi d5ade25753 Implement the obsolete_proc pragma.
While the existing obsolete pragma declares an entire predicate or function
obsolete, the new obsolete_proc pragma does this for only THE NAMED MODE
of a predicate or function.

NEWS:
doc/reference_manual.texi:
    Mention and document the new pragma.

compiler/prog_item.m:
    Add the new pragma. Rename the old pragma to "obsolete_pred". (This affects
    only the compiler's internal name; the user visible name stays the same.)

    Move a type definition next to its related types.

compiler/parse_pragma.m:
    Read in the new pragma.

compiler/hlds_pred.m:
    Create a slot in proc_infos for the information in the new pragma.

compiler/add_pragma.m:
    Add the new pragma to the HLDS.

    To avoid adding to the substantial existing code duplication in this
    module, factor out two commonly recurring pieces of code: one that
    looks up the (hopefully unique) pred_id specified by a pragma, and
    one that looks up and (if found) transforms the procedure specified
    by a pragma.

    Use error-message phraseology consistent with that employed by
    the newly-factored-out predicate even in places that cannot use them.

    Move the code handling foreign_export pragma here from add_foreign_proc.m
    to take advantage of the newly-factored out predicates.

compiler/add_foreign_proc.m:
    Delete the code moved to add_pragma.m.

    Fix the structure of the remaining code by putting related code fragments
    next to each other.

compiler/simplify_goal_call.m:
    Generate warnings to obsolete procedures as well as obsolete predicates.

compiler/parse_tree_out_pragma.m:
    Output the new pragma.

    Factor out existing common code.

compiler/hlds_code_util.m:
    Put a predicate's arguments into a more meaningful order.

compiler/make_hlds_error.m:
    Allow the caller of report_undefined_pred_or_func_error to specify
    whether the error applies to a predicate or a function. Most callers
    don't have that info, but some do, and using this info when available
    allows us to generate a more specific error message.

compiler/add_clause.m:
    Conform to the changes above.

    Make a predicate easier to read by moving unimportant code out-of-line.

compiler/intermod.m:
    Conform to the changes above. Do this in a way that is adaptable to
    making intermod.m generate lists of items instead of simply writing
    stuff out, even though this makes the diff to this file more complex
    than immediately necessary.

compiler/add_mutable_aux_preds.m:
compiler/add_pragma_type_spec.m:
compiler/canonicalize_interface.m:
compiler/equiv_type.m:
compiler/get_dependencies.m:
compiler/item_util.m:
compiler/make_hlds_passes.m:
compiler/make_hlds_separate_items.m:
compiler/module_qual.qualify_items.m:
compiler/prog_data_pragma.m:
compiler/prog_item_stats.m:
compiler/recompilation.version.m:
    Conform to the changes above.

compiler/options.m:
    Provide a simple way for the configure script to test for the presence
    of this new addition.

tests/invalid/obsolete_proc_pragma.{m,err_exp}:
    A test case for the new pragma.

tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
    Enable the new test case, and set it to run with --halt-at-warn.

tests/invalid/bug83.err_exp:
tests/invalid/require_tailrec_invalid.err_exp:
    Update these two files to expect updated error messages.
2019-10-23 05:04:41 +11:00

8 lines
345 B
Plaintext

bug83.m:027: Error: ambiguous function name in `:- pragma foreign_export'
bug83.m:027: declaration.
bug83.m:027: The possible matches are:
bug83.m:027: function `io.make_io_error'/1,
bug83.m:027: function `bug83.make_io_error'/1.
bug83.m:027: An explicit module qualifier may be necessary to select the
bug83.m:027: right match.