/[gentoo-x86]/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch
Gentoo

Contents of /dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Oct 4 20:57:12 2010 UTC (3 years, 11 months ago) by slyfox
Branch: MAIN
CVS Tags: HEAD
Export typechecker internals for haddock (alpha, ia64, ppc64). Allow ghc-ia64 to link very large applications (haddock).
(Portage version: 2.1.8.3/cvs/Linux x86_64)

1 commit c7d5e1322f54b5387767c15788d8372705b8981b
2 Author: Sergei Trofimovich <slyfox@gentoo.org>
3 Date: Sun Oct 3 22:32:12 2010 +0300
4
5 Sat Jul 31 14:55:06 EEST 2010 Ian Lynagh <igloo@earth.li>
6 * Expose the functions haddock needs even when haddock is disabled; #3558
7 ---
8 compiler/main/GHC.hs | 13 +++++++++++--
9 compiler/main/InteractiveEval.hs | 9 ---------
10 compiler/typecheck/TcRnDriver.lhs | 24 +++++++++++++++---------
11 3 files changed, 26 insertions(+), 20 deletions(-)
12
13 diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
14 index be7d574..2f25cbe 100644
15 --- a/compiler/main/GHC.hs
16 +++ b/compiler/main/GHC.hs
17 @@ -111,13 +111,13 @@ module GHC (
18 showModule,
19 isModuleInterpreted,
20 InteractiveEval.compileExpr, HValue, dynCompileExpr,
21 - lookupName,
22 GHC.obtainTermFromId, GHC.obtainTermFromVal, reconstructType,
23 modInfoModBreaks,
24 ModBreaks(..), BreakIndex,
25 BreakInfo(breakInfo_number, breakInfo_module),
26 BreakArray, setBreakOn, setBreakOff, getBreak,
27 #endif
28 + lookupName,
29
30 -- * Abstract syntax elements
31
32 @@ -243,9 +243,9 @@ import Linker ( HValue )
33 import ByteCodeInstr
34 import BreakArray
35 import InteractiveEval
36 -import TcRnDriver
37 #endif
38
39 +import TcRnDriver
40 import TcIface
41 import TcRnTypes hiding (LIE)
42 import TcRnMonad ( initIfaceCheck )
43 @@ -2711,3 +2711,12 @@ obtainTermFromId bound force id =
44 liftIO $ InteractiveEval.obtainTermFromId hsc_env bound force id
45
46 #endif
47 +
48 +-- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any
49 +-- entity known to GHC, including 'Name's defined using 'runStmt'.
50 +lookupName :: GhcMonad m => Name -> m (Maybe TyThing)
51 +lookupName name = withSession $ \hsc_env -> do
52 + mb_tything <- ioMsg $ tcRnLookupName hsc_env name
53 + return mb_tything
54 + -- XXX: calls panic in some circumstances; is that ok?
55 +
56 diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs
57 index 352fbf0..3339313 100644
58 --- a/compiler/main/InteractiveEval.hs
59 +++ b/compiler/main/InteractiveEval.hs
60 @@ -29,7 +29,6 @@ module InteractiveEval (
61 showModule,
62 isModuleInterpreted,
63 compileExpr, dynCompileExpr,
64 - lookupName,
65 Term(..), obtainTermFromId, obtainTermFromVal, reconstructType,
66 skolemiseSubst, skolemiseTy
67 #endif
68 @@ -922,14 +921,6 @@ parseName str = withSession $ \hsc_env -> do
69 (L _ rdr_name) <- hscParseIdentifier (hsc_dflags hsc_env) str
70 ioMsgMaybe $ tcRnLookupRdrName hsc_env rdr_name
71
72 --- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any
73 --- entity known to GHC, including 'Name's defined using 'runStmt'.
74 -lookupName :: GhcMonad m => Name -> m (Maybe TyThing)
75 -lookupName name = withSession $ \hsc_env -> do
76 - mb_tything <- ioMsg $ tcRnLookupName hsc_env name
77 - return mb_tything
78 - -- XXX: calls panic in some circumstances; is that ok?
79 -
80 -- -----------------------------------------------------------------------------
81 -- Getting the type of an expression
82
83 diff --git a/compiler/typecheck/TcRnDriver.lhs b/compiler/typecheck/TcRnDriver.lhs
84 index 323a167..342763d 100644
85 --- a/compiler/typecheck/TcRnDriver.lhs
86 +++ b/compiler/typecheck/TcRnDriver.lhs
87 @@ -9,10 +9,10 @@ module TcRnDriver (
88 #ifdef GHCI
89 tcRnStmt, tcRnExpr, tcRnType,
90 tcRnLookupRdrName,
91 - tcRnLookupName,
92 - tcRnGetInfo,
93 getModuleExports,
94 #endif
95 + tcRnLookupName,
96 + tcRnGetInfo,
97 tcRnModule,
98 tcTopSrcDecls,
99 tcRnExtCore
100 @@ -71,6 +71,7 @@ import Outputable
101 import DataCon
102 import Type
103 import Class
104 +import TcType
105 import Data.List ( sortBy )
106
107 #ifdef GHCI
108 @@ -83,7 +84,6 @@ import IfaceEnv
109 import MkId
110 import BasicTypes
111 import TidyPgm ( globaliseAndTidyId )
112 -import TcType ( isUnitTy, isTauTy, tyClsNamesOfDFunHead )
113 import TysWiredIn ( unitTy, mkListTy )
114 #endif
115
116 @@ -1015,7 +1015,6 @@ get two defns for 'main' in the interface file!
117 %*********************************************************
118
119 \begin{code}
120 -#ifdef GHCI
121 setInteractiveContext :: HscEnv -> InteractiveContext -> TcRn a -> TcRn a
122 setInteractiveContext hsc_env icxt thing_inside
123 = let -- Initialise the tcg_inst_env with instances from all home modules.
124 @@ -1046,6 +1045,7 @@ setInteractiveContext hsc_env icxt thing_inside
125
126
127 \begin{code}
128 +#ifdef GHCI
129 tcRnStmt :: HscEnv
130 -> InteractiveContext
131 -> LStmt RdrName
132 @@ -1401,6 +1401,7 @@ lookup_rdr_name rdr_name = do {
133
134 return good_names
135 }
136 +#endif
137
138 tcRnLookupName :: HscEnv -> Name -> IO (Messages, Maybe TyThing)
139 tcRnLookupName hsc_env name
140 @@ -1421,8 +1422,8 @@ tcRnLookupName' name = do
141 _ -> panic "tcRnLookupName'"
142
143 tcRnGetInfo :: HscEnv
144 - -> Name
145 - -> IO (Messages, Maybe (TyThing, Fixity, [Instance]))
146 + -> Name
147 + -> IO (Messages, Maybe (TyThing, Fixity, [Instance]))
148
149 -- Used to implement :info in GHCi
150 --
151 @@ -1432,8 +1433,14 @@ tcRnGetInfo :: HscEnv
152 -- *and* as a type or class constructor;
153 -- hence the call to dataTcOccs, and we return up to two results
154 tcRnGetInfo hsc_env name
155 - = initTcPrintErrors hsc_env iNTERACTIVE $
156 - let ictxt = hsc_IC hsc_env in
157 + = initTcPrintErrors hsc_env iNTERACTIVE $
158 + tcRnGetInfo' hsc_env name
159 +
160 +tcRnGetInfo' :: HscEnv
161 + -> Name
162 + -> TcRn (TyThing, Fixity, [Instance])
163 +tcRnGetInfo' hsc_env name
164 + = let ictxt = hsc_IC hsc_env in
165 setInteractiveContext hsc_env ictxt $ do
166
167 -- Load the interface for all unqualified types and classes
168 @@ -1482,7 +1489,6 @@ loadUnqualIfaces ictxt
169 isTcOcc (nameOccName name), -- Types and classes only
170 unQualOK gre ] -- In scope unqualified
171 doc = ptext (sLit "Need interface for module whose export(s) are in scope unqualified")
172 -#endif /* GHCI */
173 \end{code}
174
175 %************************************************************************
176
177 commit 83d056a7e15e3253c446d896707d0b012f9cf8b3
178 Author: Sergei Trofimovich <slyfox@gentoo.org>
179 Date: Sun Oct 3 22:30:53 2010 +0300
180
181 Sat Jul 31 02:50:01 EEST 2010 Ian Lynagh <igloo@earth.li>
182
183 * Always haddock by default
184 Revert this patch:
185 Matthias Kilian <kili@outback.escape.de>**20090920181319
186 Don't build haddock if HADDOC_DOCS = NO, and disable HADDOC_DOCS
187 if GhcWithInterpreter = NO
188 Haddock uses TcRnDriver.tcRnGetInfo, which is only available if
189 GHCI is built. Set HADDOC_DOCS to NO if GhcWithInterpreter is NO,
190 and disable the haddock build if HADDOC_DOCS = NO.
191 ---
192 ghc.mk | 2 --
193 mk/config.mk.in | 2 +-
194 2 files changed, 1 insertions(+), 3 deletions(-)
195
196 diff --git a/ghc.mk b/ghc.mk
197 index 9193f46..1b5d1f9 100644
198 --- a/ghc.mk
199 +++ b/ghc.mk
200 @@ -529,11 +529,9 @@ BUILD_DIRS += \
201 $(GHC_GENAPPLY_DIR)
202 endif
203
204 -ifneq "$(HADDOCK_DOCS)" "NO"
205 BUILD_DIRS += \
206 utils/haddock \
207 utils/haddock/doc
208 -endif
209
210 ifneq "$(CLEANING)" "YES"
211 BUILD_DIRS += \
212 diff --git a/mk/config.mk.in b/mk/config.mk.in
213 index 7399de0..55a9f19 100644
214 --- a/mk/config.mk.in
215 +++ b/mk/config.mk.in
216 @@ -736,7 +736,7 @@ SRC_ALEX_OPTS = -g
217 HSTAGS = @HstagsCmd@
218
219 # Should we build haddock docs?
220 -HADDOCK_DOCS = $(GhcWithInterpreter)
221 +HADDOCK_DOCS = YES
222 # And HsColour the sources?
223 ifeq "$(HSCOLOUR)" ""
224 HSCOLOUR_SRCS = NO

  ViewVC Help
Powered by ViewVC 1.1.20