Gentoo Archives: gentoo-commits

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