X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FHscTypes.lhs;h=7aacf9574bbc7ad86c98184d9f77cc9e82d6c175;hp=abebd14b6b4e956e03bfb8690453d37a88490d1d;hb=8102af4eac807ae4956a79b27f03fd890f8294c6;hpb=7fa5c11df9430fc35645bd7e74ad0f284e783d82 diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs index abebd14..7aacf95 100644 --- a/compiler/main/HscTypes.lhs +++ b/compiler/main/HscTypes.lhs @@ -13,7 +13,7 @@ module HscTypes ( ModuleGraph, emptyMG, ModDetails(..), emptyModDetails, - ModGuts(..), CgGuts(..), ModImports(..), ForeignStubs(..), + ModGuts(..), CoreModule(..), CgGuts(..), ModImports(..), ForeignStubs(..), ModSummary(..), ms_mod_name, showModMsg, isBootSummary, msHsFilePath, msHiFilePath, msObjFilePath, @@ -548,6 +548,22 @@ data ModGuts -- this one); c.f. tcg_fam_inst_env } +-- A CoreModule consists of just the fields of a ModGuts that are needed for +-- the compileToCoreModule interface. +data CoreModule + = CoreModule { + -- Module name + cm_module :: !Module, + -- Type environment for types declared in this module + cm_types :: !TypeEnv, + -- Declarations + cm_binds :: [CoreBind] + } + +instance Outputable CoreModule where + ppr (CoreModule {cm_module = mn, cm_types = te, cm_binds = cb}) = + text "%module" <+> ppr mn <+> ppr te $$ vcat (map ppr cb) + -- The ModGuts takes on several slightly different forms: -- -- After simplification, the following fields change slightly: