This patch removes then need for haddock to reimplement the calculation of exported names from modules. Instead when renaming export lists ghc annotates each IE with its exported names.
Haddocks current export logic has caused lots of trouble in the past (on the Github issue tracker):
This is obiously the simplest possible way to achieve this. Another way would be to export functions like lookupAvails :: GlobalRdrEnv -> IE Name -> [Name] but this would require a major refactoring in GHC.