Commit Graph

2 Commits

Author SHA1 Message Date
Zoltan Somogyi
c03b11ca48 Update the style of more test cases.
And updated expected outputs for changed line numbers.
2021-07-27 19:29:21 +10:00
Zoltan Somogyi
f0a1701bc8 Don't generate unused module warnings for implicitly imported format modules.
This fixes Mantis bug #370.

compiler/prog_data.m:
    Add a predicate to record that a predicate called "format" has
    been seen, so the compiler should treat the modules that may be implicitly
    imported in presence of such calls as being "used", in the sense that
    we shouldn't generate unused module warnings for them.

    Give the predicates that handle used modules meaningful names.

compiler/unused_imports.m:
    Call the new predicate in prog_data.m when we process any predicate
    called "format". We do this even if the callee is not string.format,
    io.format or stream.string_writer.format, since the parser may not
    have known this when implicitly importing the modules used in the
    translation of calls to those predicates.

    Give some predicates better names.

compiler/equiv_type.m:
compiler/hlds_module.m:
compiler/mercury_compile_front_end.m:
    Conform to the changes above

tests/valid/no_warn_format_imports.m:
    The test case for Mantis bug #370, under a more meaningful name.

tests/valid/Mmakefile:
tests/valid/Mercury.options:
    Enable the new test case, and compile it with the options
    required to manifest the bug, if it exists.
2014-12-30 00:05:01 +11:00