~ubuntu-branches/ubuntu/precise/ghc/precise

« back to all changes in this revision

Viewing changes to utils/haddock/src/Haddock/Interface/AttachInstances.hs

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2011-10-31 13:31:12 UTC
  • mfrom: (8.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20111031133112-qimkbmi8v4ajx5bc
Tags: 7.0.4-8ubuntu1
* Merge with Debian, remaining changes:
  + Pass --hash-style=both --no-copy-dt-needed-entries --as-needed to the
  linker.
* Use dh-autoreconf

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import HscTypes (withSession)
32
32
#endif
33
33
import MonadUtils (liftIO)
34
 
#ifdef GHCI
35
34
import TcRnDriver (tcRnGetInfo)
36
 
#endif
37
35
import TypeRep hiding (funTyConName)
38
36
import Var hiding (varName)
39
37
import TyCon
58
56
attachToExportItem iface ifaceMap instIfaceMap export =
59
57
  case export of
60
58
    ExportDecl { expItemDecl = L _ (TyClD d) } -> do
61
 
#ifdef GHCI
62
59
      mb_info <- getAllInfo (unLoc (tcdLName d))
63
 
#else
64
 
      let mb_info = Nothing
65
 
#endif
66
60
      let export' =
67
61
            export {
68
62
              expItemInstances =
101
95
    modName = nameModule name
102
96
 
103
97
 
104
 
#ifdef GHCI
105
98
-- | Like GHC's getInfo but doesn't cut things out depending on the
106
99
-- interative context, which we don't set sufficiently anyway.
107
100
getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[Instance]))
108
101
getAllInfo name = withSession $ \hsc_env -> do 
109
102
   (_msgs, r) <- liftIO $ tcRnGetInfo hsc_env name
110
103
   return r
111
 
#endif
112
104
 
113
105
 
114
106
--------------------------------------------------------------------------------