[m-rev.] for review: unused imports analysis

Ian MacLarty maclarty at csse.unimelb.edu.au
Fri Sep 15 10:24:17 AEST 2006


On Wed, Sep 13, 2006 at 10:22:14PM +0200, Peter Ross wrote:
> Hi,
> 
> Note by default this option isn't enabled.  This is because I don't
> have the time to fix all the warnings in the compiler.  I've been
> testing this on a program we are developing here at MC.
> 
> ===================================================================
> 
> 
> 
> Branch: main
> Estimated hours: 24
> 
> Add an analysis which determines the set of modules which
> are imported but are not used.
> It also has a more precise analysis of those modules not needed
> in the interface, as it reports more modules than the current
> analysis.
> 
> compiler/unused_imports.m:
> 	The module which does the analysis.
> 
> compiler/make_hlds_passes.m:
> 	Record the parent used modules.
> 	Factor out the code for adding the module specifiers.
> 
> compiler/hlds_module.m:
> 	Add utility predicates for recording those modules
> 	used in the parent modules of the current module and
> 	those imports which are in the interface.
> 
> compiler/options.m:
> 	Add the option --warn-unused-imports.
> 	By default it's turned off because I have yet
> 	to run this analysis on the compiler and fix
> 	the modules.
> 
> compiler/check_hlds.m:
> compiler/mercury_compile.m:
> 	Add the analysis to the compiler.
> 
> doc/user_guide.texi:
> 	Document the new option.
> 

Please add a test case for the new analysis (preferably with an example
of an unused import that the new analysis will pick up and that the old one
won't).

Ian.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list