Add tcRnGetNameToInstancesIndex
authorDouglas Wilson <douglas.wilson@gmail.com>
Thu, 8 Jun 2017 19:02:01 +0000 (15:02 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 8 Jun 2017 19:35:58 +0000 (15:35 -0400)
commit56ef54444b89b2332abe68ee62d88792f785f5a7
treed1bc9363c403a16d0532379fdbf0b8695ee800e2
parent3ee3822ce588565e912ab6211e9d2cd545fc6ba6
Add tcRnGetNameToInstancesIndex

This function in tcRnDriver, retrieves an index by name of all Class and
Family instances in the current environment.

This is to be used by haddock which currently looks up instances for
each name, which looks at every instance for every lookup.

Using this function instead of tcRnGetInfo, the haddock.base performance
test improves by 10%

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: alexbiehl, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3624
compiler/main/GHC.hs
compiler/typecheck/TcRnDriver.hs