2 % (c) The University of Glasgow, 2000
4 \section[CmTypes]{Types for the compilation manager}
8 Unlinked(..), isObject, nameOfObject, isInterpretable,
10 ModSummary(..), name_of_summary
23 | Trees [UnlinkedIBind] ItblEnv -- bunch of interpretable bindings, +
24 -- a mapping from DataCons to their itbls
26 instance Outputable Unlinked where
27 ppr (DotO path) = text "DotO" <+> text path
28 ppr (DotA path) = text "DotA" <+> text path
29 ppr (DotDLL path) = text "DotDLL" <+> text path
30 ppr (Trees binds _) = text "Trees" <+> ppr binds
32 isObject (DotO _) = True
33 isObject (DotA _) = True
34 isObject (DotDLL _) = True
37 nameOfObject (DotO fn) = fn
38 nameOfObject (DotA fn) = fn
39 nameOfObject (DotDLL fn) = fn
41 isInterpretable (Trees _ _) = True
42 isInterpretable _ = False
45 = LM ModuleName [Unlinked]
48 instance Outputable Linkable where
49 ppr (LM mod_nm unlinkeds) = text "LinkableM" <+> ppr mod_nm <+> ppr unlinkeds
50 ppr (LP package_nm) = text "LinkableP" <+> ptext package_nm
52 -- The ModuleLocation contains both the original source filename and the
53 -- filename of the cleaned-up source file after all preprocessing has been
54 -- done. The point is that the summariser will have to cpp/unlit/whatever
55 -- all files anyway, and there's no point in doing this twice -- just
56 -- park the result in a temp file, put the name of it in the location,
57 -- and let @compile@ read from that file on the way back up.
60 ms_mod :: Module, -- name, package
61 ms_location :: ModuleLocation, -- location
62 ms_srcimps :: [ModuleName], -- source imports
63 ms_imps :: [ModuleName] -- non-source imports
64 --ms_date :: Maybe ClockTime -- timestamp of summarised
65 -- file, if home && source
68 instance Outputable ModSummary where
70 = sep [--text "ModSummary { ms_date = " <> text (show ms_date),
72 nest 3 (sep [text "ms_mod =" <+> ppr (ms_mod ms) <> comma,
73 text "ms_imps =" <+> ppr (ms_imps ms),
74 text "ms_srcimps =" <+> ppr (ms_srcimps ms)]),
78 name_of_summary :: ModSummary -> ModuleName
79 name_of_summary = moduleName . ms_mod