Understanding how warnings on unused functions work

Raghu Ranganathan rraghu.11502 at gmail.com
Tue Mar 14 06:15:29 UTC 2023


This is related to a feature in the futhark compiler 
<https://github.com/diku-dk/futhark/issues/550>, which is a language 
with a similar module system.

I am trying to create a tool to detect unused top-level functions in 
Futhark, and I have been looking in the ghc codebase to find out how it 
does so. So far I have found these areas:

 1. warning flag
    <https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Driver/Flags.hs#L556-557>
 2. WarnUnusedTopBinds
    <https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Rename/Utils.hs#L355>

The project is a bit too big for my machine to take, so HLS is not 
helping me with finding where the computation of unused bindings 
(specifically functions) is done.
I would like some help with finding where ghc does this computation, and 
maybe some help with the naming conventions of the code.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20230314/f84c73f7/attachment.html>


More information about the Glasgow-haskell-users mailing list